public UFormPurchaseOrderService(MBaseModel model, int page, int totalPage, MReportConfig cfg, CReportPageParam param) { if (model == null) { model = new MAuxilaryDoc(new Wis.WsClientAPI.CTable("")); } dataSource = model; pageNo = page; pageCount = totalPage; pageParam = param; rptConfig = cfg; init(); MAuxilaryDoc ad = (dataSource as MAuxilaryDoc); numberTextAmount = ad.ArApAmtFmt; primaryColumns.Clear(); primaryColumns.Add(new GridLength(31, GridUnitType.Star)); primaryColumns.Add(new GridLength(9, GridUnitType.Star)); primaryColumns.Add(new GridLength(9, GridUnitType.Star)); primaryColumns.Add(new GridLength(9, GridUnitType.Star)); primaryColumns.Add(new GridLength(9, GridUnitType.Star)); primaryColumns.Add(new GridLength(9, GridUnitType.Star)); primaryColumns.Add(new GridLength(8, GridUnitType.Star)); primaryColumns.Add(new GridLength(8, GridUnitType.Star)); primaryColumns.Add(new GridLength(8, GridUnitType.Star)); DataContext = model; InitializeComponent(); }
public void DisplayQR() { MAuxilaryDoc ad = (dataSource as MAuxilaryDoc); string ppid = ad.PromptPayID; if (string.IsNullOrEmpty(ppid)) { return; } var items = ad.PaymentCriteriaes; if ((items == null) || (items.Count <= 0)) { uPromptPayQR.Amount = "0.00"; } else { MPaymentCriteria mp = items[items.Count - 1]; uPromptPayQR.Amount = mp.RemainAmount; } uPromptPayQR.PropmtPayID = ppid; uPromptPayQR.GenerateQR(); }
public UFormQuotationComplex(MBaseModel model, int page, int totalPage, MReportConfig cfg, CReportPageParam param) { if (model == null) { model = new MAuxilaryDoc(new Wis.WsClientAPI.CTable("")); } dataSource = model; pageNo = page; pageCount = totalPage; pageParam = param; rptConfig = cfg; init(); MAuxilaryDoc ad = (dataSource as MAuxilaryDoc); numberTextAmount = ad.ArApAmtFmt; amountFmt = ad.ArApAmtFmt; primaryColumns.Clear(); primaryColumns.Add(new GridLength(10, GridUnitType.Star)); primaryColumns.Add(new GridLength(60, GridUnitType.Star)); primaryColumns.Add(new GridLength(30, GridUnitType.Star)); DataContext = model; InitializeComponent(); //These 2 lines are important to place here after InitializeComponent(); headerPanel = grdBody; tablePanel = dckBody; descriptionColumnIndex = 1; }
private MAuxilaryDoc getPurchaseOrderObject(String id) { CUtil.EnableForm(false, ParentControl); CTable t = new CTable(""); MAuxilaryDoc md = new MAuxilaryDoc(t); md.AuxilaryDocID = id; CTable obj = OnixWebServiceAPI.GetAuxilaryDocInfo(md.GetDbObject()); md.SetDbObject(obj); md.InitAuxilaryDocItem(); md.InitPaymentCriteria(); md.InitEntityAddresses(); String tmp = md.EntityBankAccountID; md.InitEntityBankAccounts(); md.EntityBankAccountID = tmp; CUtil.EnableForm(true, ParentControl); return(md); }
public WinAddEditPurchaseOrder(String md, ObservableCollection <MBaseModel> pItems, MAuxilaryDoc actView, AuxilaryDocumentType dt) { actualView = actView; parentItemsSource = pItems; Mode = md; docType = dt; vw = new MAuxilaryDoc(new CTable("")); DataContext = vw; InitializeComponent(); }
private MAccountDoc constructSaleOrderFromQuotation(MAuxilaryDoc quotation) { CTable qt = OnixWebServiceAPI.GetAuxilaryDocInfo(quotation.GetDbObject()); MAuxilaryDoc qd = new MAuxilaryDoc(qt); qd.InitAuxilaryDocItem(); qd.InitEntityAddresses(); MAccountDoc md = new MAccountDoc(new CTable("")); md.DocumentType = ((int)AccountDocumentType.AcctDocSaleOrder).ToString(); md.DocumentDate = qd.DocumentDate; md.DocumentDesc = qd.DocumentDesc; md.DueDate = qd.DocumentDate; md.ProjectID = qd.ProjectID; md.ProjectCode = qd.ProjectCode; md.ProjectName = qd.ProjectName; md.ProjectGroupName = qd.ProjectGroupName; md.EntityId = qd.EntityId; md.EntityCode = qd.EntityCode; md.EntityName = qd.EntityName; md.EntityAddressID = qd.EntityAddressID; md.EmployeeID = qd.EmployeeID; md.EmployeeCode = qd.EmployeeCode; md.EmployeeName = qd.EmployeeName; CTable cust = OnixWebServiceAPI.GetEntityInfo(qd.EntityObj.GetDbObject()); MEntity en = new MEntity(cust); en.InitEntityAddress(); md.ReloadEntityAddresses(en.AddressItems); md.BranchId = qd.BranchId; md.VATType = qd.VatType; md.RefQuotationNo = qd.DocumentNo; md.RefQuotationID = qd.AuxilaryDocID; foreach (MAuxilaryDocItem ad in qd.AuxilaryDocItems) { MAccountDocItem adi = new MAccountDocItem(ad.GetDbObject()); adi.ExtFlag = "A"; md.AddAccountDocItem(adi); } md.CalculateExtraFields(); md.IsModified = true; return(md); }
private void cmdSave_Click(object sender, RoutedEventArgs e) { if (!vw.IsModified) { return; } Boolean r = SaveData("N"); if (r) { actualView = vw; Mode = "E"; LoadData(); vw.IsModified = false; } }
private MAuxilaryDoc getDocumentObject(String id) { CUtil.EnableForm(false, ParentControl); CTable t = new CTable(""); MAuxilaryDoc md = new MAuxilaryDoc(t); md.AuxilaryDocID = id; CTable obj = OnixWebServiceAPI.GetAuxilaryDocInfo(md.GetDbObject()); md.SetDbObject(obj); md.InitAuxilaryDocItem(); md.InitEntityAddresses(); CUtil.EnableForm(true, ParentControl); return(md); }
public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData() { (model as MAuxilaryDoc).DocumentType = ((int)docType).ToString(); items = OnixWebServiceAPI.GetAuxilaryDocList(model.GetDbObject()); lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned(); itemSources.Clear(); //int idx = 0; foreach (CTable o in items) { MAuxilaryDoc v = new MAuxilaryDoc(o); //v.RowIndex = idx; itemSources.Add(v); //idx++; } Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources); return(tuple); }
private void showEditWindow() { String caption = CLanguage.getValue("purchase_po"); if (!CHelper.VerifyAccessRight("PURCHASE_PO_VIEW")) { return; } MAuxilaryDoc v = (MAuxilaryDoc)currentObj; WinAddEditPurchaseOrder w = new WinAddEditPurchaseOrder("E", itemSources, v, docType); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getPurchaseOrderObject(w.CreatedID)); wp.ShowDialog(); } }
private void mnuContextMenu_Click(object sender, RoutedEventArgs e) { MenuItem mnu = (sender as MenuItem); string name = mnu.Name; if (name.Equals("mnuEdit")) { showEditWindow(); } else if (name.Equals("mnuCopy")) { CTable t = currentObj.GetDbObject(); //t.SetFieldValue("IS_ONLY_HEAD", "Y"); CUtil.EnableForm(false, ParentControl); CTable newobj = OnixWebServiceAPI.CopyAuxilaryDoc(t); if (newobj != null) { MAuxilaryDoc ivd = new MAuxilaryDoc(newobj); ItemAddedEvent(ivd, e); } else { //Error here CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null); } CUtil.EnableForm(true, ParentControl); } else if (name.Equals("mnuPrint")) { CUtil.EnableForm(false, ParentControl); WinFormPrinting wp = new WinFormPrinting("grpSaleQuotation", getDocumentObject((currentObj as MAuxilaryDoc).AuxilaryDocID)); wp.ShowDialog(); CUtil.EnableForm(true, ParentControl); } }
private void showEditWindow() { String caption = CLanguage.getValue("sale_quotation"); if (!CHelper.VerifyAccessRight("SALE_QUOTATION_VIEW")) { return; } MAuxilaryDoc v = (MAuxilaryDoc)currentObj; WinAddEditQuotation w = new WinAddEditQuotation("E", itemSources, v, docType, "2"); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { WinFormPrinting wp = new WinFormPrinting("grpSaleQuotation", getDocumentObject(w.CreatedID)); wp.ShowDialog(); } }
public UFormQuotationAttachSheet(MBaseModel model, int page, int totalPage, MReportConfig cfg, CReportPageParam param) { dataSource = model; pageNo = page; pageCount = totalPage; pageParam = param; rptConfig = cfg; init(); MAuxilaryDoc ad = (dataSource as MAuxilaryDoc); if (ad != null) { numberTextAmount = ad.ArApAmtFmt; amountFmt = ad.ArApAmtFmt; } primaryColumns.Clear(); primaryColumns.Add(new GridLength(10, GridUnitType.Star)); primaryColumns.Add(new GridLength(100, GridUnitType.Star)); primaryColumns.Add(new GridLength(20, GridUnitType.Star)); primaryColumns.Add(new GridLength(20, GridUnitType.Star)); primaryColumns.Add(new GridLength(25, GridUnitType.Star)); primaryColumns.Add(new GridLength(15, GridUnitType.Star)); DataContext = model; InitializeComponent(); //These 2 lines are important to place here after InitializeComponent(); headerPanel = grdBody; tablePanel = dckBody; descriptionColumnIndex = 1; }
public override MBaseModel CreateDefaultData() { MAuxilaryDoc ma = new MAuxilaryDoc(new CTable("")); return(ma); }
public WinAddEditPaymentCriteria(MAuxilaryDoc pv) { parentView = pv; InitializeComponent(); }