PDA development data downloaded from DB to PDA local

Source: Internet
Author: User

public string downfile = "\ \ download. txt";//download path public string LoadFile = "\ \ Upload. txt";//upload path public list<string& Gt        _readtxt = new list<string> ();            Public MainForm () {InitializeComponent ();        Tbdelivery.focus ();  private void Btndownload_click (object sender, EventArgs e) {try {if (TbDelivery.Text.Trim (). Length = = 0) {MES. Pda. Core.Service.MessageServices.ShowWarm ("Please scan the supply number first!")                    ");                    Tbdelivery.focus ();                Return } else {if (!                    Checkdelivery ()) {return; } if (System.IO.File.Exists (Downfile)) {StreamReader Objread                        ER = new StreamReader (downfile);                        String sline = ""; sline = Objreader.readliNE (); if (sline! = string.                            Empty) {string[] ss = Sline.split (', '); if (ss.                                Length > 0) {if (ss[0]! = TbDelivery.Text.Trim ()) {MES. Pda. Core.Service.MessageServices.ShowWarm ("This machine has been downloaded supply number:" + ss[0] + ", please scan the supply number and upload. Download the other supply numbers again!

"); Objreader.close (); Return } else {MES. Pda. Core.Service.MessageServices.ShowWarm ("The supply number has been downloaded, please scan and upload!")

"); Objreader.close (); Return }}} objreader.close (); } else {FileStream fs = System.IO.File.Create (Downfile); StreamWriter SW = new StreamWriter (FS, System.Text.Encoding.GetEncoding ("UTF-8")); String sql = Sql.getdelivery (TbDelivery.Text.Trim ()); Daisy.Common.McsClient.McsDataReader reader = (Daisy.Common.McsClient.McsDataReader) MES. Pda. Core.Service.DatabaseAccessService.execute (SQL, MES. Pda. Core.Service.ReturnType.RESULTSET); if (Reader.rownumber = = 0) {MES. Pda. Core.Service.MessageServices.ShowWarm ("Get Supply number information failed!") "); Sw. Close (); Return } else {String sline = string. Empty; while (reader. Read ()) {//mes. Pda. Core.Service.MessageServices.ShowWarm (reader.getstring (2)); sline = reader.getstring (0) + "," + reader.getstring (1) + "," + reader.getstring (2) + "," + reader.getstring (3) + "," + RE Ader.getstring (4) + "," + reader.getstring (5); Sw. WriteLine (sline); Sw. WriteLine (sline); } SW. Flush (); Sw. Close (); } var sqlload = "{? =call apps.cux_pda_load_scan_utl.init_data_download ('" + TbDelivery.Text.Trim () + "')}"; Mes. Pda. Core.Service.MessageServices.ShowWarm (SQL); Return string ret = (string) MES. Pda. Core.Service.DatabaseAccessService.execute (Sqlload, returntype.string); if (!ret. StartsWith ("[email protected]")) {MES. Pda. Core.Service.MessageServices.ShowWarm (ret); Return } else {MES. Pda. Core.Service.MessageServices.ShowWarm ("Download successful!

"); Btnscan.focus (); }}}} catch (Exception ex) {MES. Pda. Core.Service.MessageServices.ShowWarm (ex. ToString ()); } }


PDA development data downloaded from DB to PDA local

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.