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(); }
private async void btnCoreCancel_ClickAsync(object sender, EventArgs e) { var result = await DataSync.CancelSyncCompanyCoreAsync(_coreSyncList); if (!result.Successful) { GuiCommon.ShowMessage(result.DisplayMessage()); } }
private bool HasInternetConnection() { if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { GuiCommon.ShowMessage("No internet connection, cannot sync."); return(false); } return(true); }
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."); } }
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."); } }
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."); } }
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); } }
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]); } }
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(); }