Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (!dxValidationProvider1.Validate())
                {
                    return;
                }
                DataRowView drSelectedCounter = cmbCounter.GetSelectedDataRow() as DataRowView;
                ObjPOSRep.SavePOSConfiguration(cmbBranch.EditValue, cmbCounter.EditValue
                                               , drSelectedCounter["DAYCLOSUREID"], drSelectedCounter["BRANCHREFUNDID"]);

                SplashScreenManager.ShowForm(null, typeof(frmWaitForm), true, true, false);
                Utility.branchinfo.BranchCounterID = cmbCounter.EditValue;
                Utility.branchinfo.BranchID        = cmbBranch.EditValue;
                string HDDSno = Utility.GetHDDSerialNumber();
                objCloudRepository.CheckOrAddHDDSerialNumber(Utility.branchinfo.BranchCounterID, HDDSno);
                Utility.StartSync(null, true);
                objSyncRepository.SaveHDDSNo(HDDSno);
                DataSet dsRestoreData = objCloudRepository.GetDaySequence(cmbCounter.EditValue);
                objSyncRepository.ImportDaySequence(dsRestoreData);

                SplashScreenManager.CloseForm();
                Application.Restart();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }