示例#1
0
        private void backgroundWorker1_Upload(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            if (Uploading.CheckServer())
            {
                for (int i = 0; i < 16; i++)
                {
                    FeedBack("PROCESS " + i.ToString());
                    //try
                    //{
                    process(i);
                    //}
                    //catch (Exception c)
                    //{
                    //    FeedBack("PROCESSING ERROR " + i.ToString() + " " + c.Message.ToString());
                    //}

                    bwLite.ReportProgress(i);
                    Thread.Sleep(1500);
                }
            }
            else
            {
                FeedBack("No internet connection ");
                bwLite.Dispose();
            }
        }
示例#2
0
        private void process(int count)
        {
            int val = count;

            switch (val)
            {
            case 1:
                Uploading.Patients();

                break;

            case 2:
                Uploading.Users();
                break;

            case 3:
                Uploading.Events();
                break;

            case 14:

                if (Uploading.CheckServer())
                {
                    Uploading.updateSyncTime();
                    FeedBack("Uploading and Downloading of information complete");

                    FeedBack("LAST SYNC " + Helper.lastSync);
                    bwLite.Dispose();
                    return;
                }
                else
                {
                    FeedBack("No valid connection ");
                }
                break;

            default:
                FeedBack("Processing");
                break;
            }
        }