コード例 #1
0
        private async void btnSystemStart_ClickAsync(object sender, EventArgs e)
        {
            if (!HasInternetConnection())
            {
                return;
            }

            CL_Dialog.PleaseWait.Show("Data syncing...\r\nPlease Wait", ParentForm);

            SyncResult result = await DataSync.HandShakeAsync();

            if (result.Successful)
            {
                var resultSync = await DataSync.RunSyncSystem(_systemSyncList);

                if (resultSync.Successful)
                {
                    string msg = LoginUser.AddSqlUsers();
                    if (msg != null)
                    {
                        GuiCommon.ShowMessage(msg);
                    }
                }

                GuiCommon.ShowMessage(resultSync.DisplayMessage());
                AfterSync?.Invoke();
            }
            else
            {
                GuiCommon.ShowMessage(result.DisplayMessage());
            }

            CL_Dialog.PleaseWait.Hide();
        }
コード例 #2
0
        private async void btnCoreCancel_ClickAsync(object sender, EventArgs e)
        {
            var result = await DataSync.CancelSyncCompanyCoreAsync(_coreSyncList);

            if (!result.Successful)
            {
                GuiCommon.ShowMessage(result.DisplayMessage());
            }
        }
コード例 #3
0
        private bool HasInternetConnection()
        {
            if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
            {
                GuiCommon.ShowMessage("No internet connection, cannot sync.");
                return(false);
            }

            return(true);
        }
コード例 #4
0
 public void LoadFromTemplate()
 {
     if (LabourTimeEntry.CopyDataFromTemplate(_headerRecord.ProjectId, _headerRecord.LogDate, _headerRecord.Id))
     {
         SetCurrent(_headerRecord);
         LemHeader.SqlUpdateSubmitStatus(_headerRecord.Id, EnumSubmitStatus.Open);
     }
     else
     {
         GuiCommon.ShowMessage("The template data is not available.");
     }
 }
コード例 #5
0
 public void LoadFromPrevDay()
 {
     if (EquipTimeEntry.CopyDataFromPrevDay(_headerRecord.ProjectId, _headerRecord.LogDate, _headerRecord.Id))
     {
         SetCurrent(_headerRecord);
         LemHeader.SqlUpdateSubmitStatus(_headerRecord.Id, EnumSubmitStatus.Open);
     }
     else
     {
         GuiCommon.ShowMessage("The previous day data is not available.");
     }
 }
コード例 #6
0
ファイル: ucFieldPO.cs プロジェクト: haizhizhong/ReflexMobile
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (gvDetail.RowCount > 0)
     {
         SetSubmitStatus(EnumSubmitStatus.Ready);
         btnSubmit.Enabled = false;
     }
     else
     {
         GuiCommon.ShowMessage("PO must contain at least 1 detail record.");
     }
 }
コード例 #7
0
 private void gvLabour_RowDeleting(object sender, DevExpress.Data.RowDeletingEventArgs e)
 {
     if (GuiCommon.ShowMessage("Delete Record?", "Confirmation", PopupType.Yes_No) == PopupResult.No)
     {
         e.Cancel = true;
     }
     else
     {
         DataRow row = gvLabour.GetDataRow(e.RowHandle);
         LabourTimeEntry.DeleteEntry((int)row[colId.FieldName]);
         LemHeader.SqlUpdateSubmitStatus(_headerRecord.Id, EnumSubmitStatus.Open);
     }
 }
コード例 #8
0
ファイル: ucFieldPO.cs プロジェクト: haizhizhong/ReflexMobile
        private void gvPO_RowDeleting(object sender, DevExpress.Data.RowDeletingEventArgs e)
        {
            DataRow row = gvPO.GetDataRow(e.RowHandle);

            if ((string)row[colStatus.FieldName] == Enum.GetName(typeof(EnumSubmitStatus), EnumSubmitStatus.Submitted))
            {
                e.Cancel = true;
                GuiCommon.ShowMessage("Cannot delete a submitted PO.");
                return;
            }

            if (GuiCommon.ShowMessage("Delete Record?", "Confirmation", PopupType.Yes_No) == PopupResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                FieldPO.SqlDelete((int)row[colId.FieldName]);
            }
        }
コード例 #9
0
        private async void btnCoreStart_ClickAsync(object sender, EventArgs e)
        {
            if (!HasInternetConnection())
            {
                return;
            }

            CL_Dialog.PleaseWait.Show("Data syncing...\r\nPlease Wait", ParentForm);

            SyncResult result = await DataSync.HandShakeAsync();

            if (result.Successful)
            {
                var resultSync = await DataSync.RunSyncCompanyCore(_coreSyncList);

                GuiCommon.ShowMessage(resultSync.DisplayMessage());
                AfterSync?.Invoke();
            }
            else
            {
                GuiCommon.ShowMessage(result.DisplayMessage());
            }
            CL_Dialog.PleaseWait.Hide();
        }