예제 #1
0
        private void UploadBillsToServer()
        {
            PhoneTool ptool  = new PhoneTool();
            string    phone  = ptool.PhoneNumber();
            string    serial = ptool.DeviceIdIMEI();


            bills     = GetBills();
            invcount += bills.Count;
            if (bills.Count > 0)
            {
                _client.UploadOutletBillsAsync(bills.ToArray(), comp, brn, serial, ver);
            }
            else
            {
                RunOnUiThread(() => Uploadhandle.Invoke(CallingActivity, invcount, _errmsg));
            }
        }
예제 #2
0
        private void UploadBillsToServer()
        {
            PhoneTool ptool  = new PhoneTool();
            string    phone  = ptool.PhoneNumber();
            string    serial = ptool.DeviceIdIMEI();
            string    comp   = ((GlobalvarsApp)CallingActivity.Application).COMPANY_CODE;
            string    brn    = ((GlobalvarsApp)CallingActivity.Application).BRANCH_CODE;

            bills     = GetBills();
            invcount += bills.Count;
            if (bills.Count > 0)
            {
                _client.UploadOutletBillsAsync(bills.ToArray(), comp, brn, serial, phone);
            }
            else
            {
                RunOnUiThread(() => Uploadhandle.Invoke(CallingActivity, invcount, _errmsg));
            }
        }
예제 #3
0
        private void InsertRunoIntoDb(List <RunnoInfo> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                var list2 = db.Table <AdNumDate> ().ToList <AdNumDate> ();
                foreach (var runinfo in list)
                {
                    var found = list2.Where(x => x.Month == runinfo.Month && x.Year == runinfo.Year && x.TrxType == runinfo.Trxtype).ToList();
                    if (found.Count > 0)
                    {
                        found [0].RunNo = runinfo.RunNo;
                        db.Update(found [0]);
                    }
                    else
                    {
                        AdNumDate num = new AdNumDate();
                        num.ID      = -1;
                        num.Month   = runinfo.Month;
                        num.Year    = runinfo.Year;
                        num.RunNo   = runinfo.RunNo;
                        num.TrxType = runinfo.Trxtype;
                        db.Insert(num);
                    }
                }
            }
            string dmsg = CallingActivity.Resources.GetString(Resource.String.msg_successdownrunno);

            if (_downloadAll)
            {
                _downloadPro = true;
                DownloadAllhandle.Invoke(CallingActivity, 0, dmsg);                // "Successfully downloaded runing no.");
                FireEvent(EventID.DOWNLOADED_RUNNO);
            }
            else
            if (CallingActivity != null)
            {
                Downloadhandle.Invoke(CallingActivity, 0, dmsg);
            }
        }
예제 #4
0
        void _client_GetItemLastPricesCompleted(object sender, GetItemLastPricesCompletedEventArgs e)
        {
            //InsertItemPriceIntoDb
            List <ItemLastPrice> list = new List <ItemLastPrice> ();
            string msg = null;

            if (e.Error != null)
            {
                msg = e.Error.Message;
            }
            else if (e.Cancelled)
            {
                msg = CallingActivity.Resources.GetString(Resource.String.msg_reqcancel);
            }
            else
            {
                list = e.Result.ToList <ItemLastPrice>();
                RunOnUiThread(() => InsertItemPriceIntoDb(list));
            }

            if (msg != null)
            {
                RunOnUiThread(() => Downloadhandle.Invoke(CallingActivity, 0, msg));
            }
        }