private void cmdSaleOrderUnlink_Click(object sender, RoutedEventArgs e) { CTable m = new CTable(""); m.SetFieldValue("ACCOUNT_DOC_ID", vw.RefSaleOrderID); CUtil.EnableForm(false, this); CTable t = OnixWebServiceAPI.GetAccountDocInfo(m); CUtil.EnableForm(true, this); if (t == null) { return; } MAccountDoc vm = new MAccountDoc(t); Boolean ok = CHelper.AskConfirmMessage(vm.DocumentNo, "ERROR_SALE_ORDER_UNLINK"); if (!ok) { return; } OnixWebServiceAPI.UnlinkSaleOrderFromInvoice(vw.GetDbObject()); vw.RefSaleOrderID = ""; }
private Boolean ValidateData() { Boolean result = false; result = CHelper.ValidateLookup(lblSaleMan, uSalesman, false); if (!result) { return(result); } result = CHelper.ValidateLookup(lblCustomer, uCustomer, false); if (!result) { return(result); } result = CHelper.ValidateTextBox(lblDesc, txtDesc, true); if (!result) { return(result); } result = CHelper.ValidateComboBox(lblBranch, cboBranch, false); if (!result) { return(result); } Boolean isService = !vw.IsInInventory(); result = CHelper.ValidateComboBox(lblFrom, cboFrom, isService); if (!result) { return(result); } if (vw.IsChangeByDrCr) { Boolean flag = CHelper.AskConfirmMessage("", "ERROR_CHANGE_BY_DRCR"); return(flag); } if (dt == AccountDocumentType.AcctDocSaleOrder) { result = CHelper.ValidateLookup(lblProject, uProject, false); if (!result) { return(result); } } return(result); }
private void CmdDelete_Click(object sender, RoutedEventArgs e) { MEmployeeLeave mv = (MEmployeeLeave)vw; MLeaveRecord pp = (MLeaveRecord)(sender as Button).Tag; bool result = CHelper.AskConfirmMessage(pp.LeaveDate.ToString(), "CONFIRM_DELETE_ITEM"); if (result) { mv.RemoveLeaveRecord(pp); mv.CalculateLeaveTotal(); mv.IsModified = true; } }
private Boolean validatePaymentCriteria <T>(ObservableCollection <T> collection, TabItem titem, Boolean chkCnt) where T : MBaseModel { int idx = 0; int cnt = 0; double total = 0.00; foreach (MBaseModel t in collection) { MPaymentCriteria c = (MPaymentCriteria)t; idx++; if (c.IsEmpty) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); titem.IsSelected = true; return(false); } double pct = CUtil.StringToDouble(c.Percent); total = total + pct; cnt++; } if ((cnt <= 0) && chkCnt) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_ITEM_COUNT", null); titem.IsSelected = true; return(false); } if (cnt > 0) { if (!vw.PmtVatAmtFmt.Equals(vw.VatAmtFmt)) { String temp = String.Format("{0} != {1}", vw.PmtVatAmtFmt, vw.VatAmtFmt); Boolean result = CHelper.AskConfirmMessage(temp, "ERROR_VAT_DIFFERENT"); return(result); } } return(true); }
private Boolean ValidateData() { Boolean result = false; result = CHelper.ValidateTextBox(lblRefDoc, txtRefDoc, false); if (!result) { return(result); } result = CHelper.ValidateLookup(lblSupplier, uSupplier, false); if (!result) { return(result); } result = CHelper.ValidateTextBox(lblDesc, txtDesc, true); if (!result) { return(result); } result = CHelper.ValidateComboBox(lblBranch, cboBranch, false); if (!result) { return(result); } Boolean isService = !vw.IsInInventory(); result = CHelper.ValidateComboBox(lblTo, cboTo, isService); if (!result) { return(result); } if (vw.IsChangeByDrCr) { Boolean flag = CHelper.AskConfirmMessage("", "ERROR_CHANGE_BY_DRCR"); return(flag); } return(result); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (isLogin) { Boolean result = CHelper.AskConfirmMessage("CONFIRM_EXIT"); if (result) { CUtil.EnableForm(false, this); CConfig.ConfigWrite(); OnixWebServiceAPI.Logout(new CTable("DUMMY")); CUtil.EnableForm(true, this); //e.Cancel = true; return; } e.Cancel = true; } CConfig.ConfigWrite(); }
private void mnuVoidMenu_Click(object sender, RoutedEventArgs e) { String status = (currentObj as MAccountDoc).DocumentStatus; if (!status.Equals(((int)InventoryDocumentStatus.InvDocApproved).ToString())) { CHelper.ShowErorMessage("", "ERROR_DOC_STATUS", null); return; } Boolean result = CHelper.AskConfirmMessage("CONFIRM_VOID_DOCUMENT"); if (!result) { return; } MAccountDoc md = (MAccountDoc)currentObj; WinAddEditVoidedDoc w = new WinAddEditVoidedDoc(md); w.Caption = md.DocumentNo; w.ShowDialog(); }
private void mnuDelete_Click(object sender, RoutedEventArgs e) { MenuItem mni = (MenuItem)sender; MAuxilaryDocSubItem itm = (MAuxilaryDocSubItem)mni.Tag; if (vw.ItemDetails.Count <= 1) { CHelper.ShowErorMessage("", "ERROR_MUST_KEEP", null); return; } Boolean result = CHelper.AskConfirmMessage(itm.Index, "CONFIRM_DELETE_DATA"); if (!result) { return; } vw.RemoveItemDetail(itm); vw.CalculateSubItemTotal(); vw.IsModified = true; }
private Boolean ValidateData() { Boolean result = false; result = CHelper.ValidateLookup(lblCustomer, uCustomer, false); if (!result) { return(result); } result = CHelper.ValidateTextBox(lblDesc, txtDesc, true); if (!result) { return(result); } result = CHelper.ValidateComboBox(lblBranch, cboBranch, false); if (!result) { return(result); } result = validateReceiptItem(); if (!result) { return(result); } if (vw.IsChangeByDrCr) { Boolean flag = CHelper.AskConfirmMessage("", "ERROR_CHANGE_BY_DRCR"); return(flag); } return(result); }