public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData() { MVTaxDocument ad = (model as MVTaxDocument); CTable tb = ad.GetDbObject(); tb.SetFieldValue("DOCUMENT_TYPE_SET", "(1,2,3)"); items = OnixWebServiceAPI.GetListAPI("GetTaxDocList", "TAX_DOC_LIST", tb); lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned(); itemSources.Clear(); int idx = 0; foreach (CTable o in items) { MVTaxDocument v = new MVTaxDocument(o); v.RowIndex = idx; itemSources.Add(v); idx++; } Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources); return(tuple); }
public void ShowEditWindowEx(MVTaxDocument actDoc) { if (!CHelper.VerifyAccessRight("PURCHASE_TAXDOC_EDIT")) { return; } CWinLoadParam param = new CWinLoadParam(); TaxDocumentType dt = (TaxDocumentType)CUtil.StringToInt(actDoc.DocumentType); if (dt == TaxDocumentType.TaxDocPP30) { param.Caption = CUtil.TaxDocTypeToString(dt); param.Mode = "E"; param.ActualView = actDoc; FactoryWindow.ShowWindow("WinAddEditTaxPP30", param); } else { param.Caption = CUtil.TaxDocTypeToString(dt); param.Mode = "E"; param.GenericType = ""; param.ActualView = actDoc; FactoryWindow.ShowWindow("WinAddEditTaxFormPRV3_53", param); } }
public static MAccountDoc TaxDocToAccountDoc(MVTaxDocument td, UIElement parent) { MAccountDoc ad = new MAccountDoc(new CTable("")); if (td.ChequeID.Equals("")) { String supplierCode = CGlobalVariable.GetGlobalVariableValue("REVENUE_DEP_SUPPLIER_CODE"); if (supplierCode.Equals("")) { CHelper.ShowErorMessage("REVENUE_DEP_SUPPLIER_CODE", "error_revenue_dep_code_missing", null); return(null); } MEntity en = new MEntity(new CTable("")); en.EntityCode = supplierCode; en.Category = "2"; CUtil.EnableForm(false, parent); ArrayList arr = OnixWebServiceAPI.GetListAPI("GetEntityList", "ENTITY_LIST", en.GetDbObject()); CUtil.EnableForm(true, parent); if ((arr == null) || (arr.Count <= 0)) { CHelper.ShowErorMessage(supplierCode, "error_supplier_code_missing", null); return(null); } CTable obj = (CTable)arr[0]; en.SetDbObject(obj); ad.EntityObj = en; ad.EntityName = en.EntityName; } else { ad.ChequeID = td.ChequeID; } ad.IsPopulateChequeAmt = true; return(ad); }
public static CTable ApproveChequeFromTaxDoc(MVTaxDocument doc) { CTable dat = new CTable(""); Boolean approveCheque = CGlobalVariable.GetGlobalVariableValue("CHEQUE_APPROVE_IMMEDIATE_FLAG").Equals("Y"); if (!approveCheque) { return(dat); } dat.SetFieldValue("CHEQUE_ID", doc.ChequeID); CTable cheque = OnixWebServiceAPI.SubmitObjectAPI("GetChequeInfo", dat); if (cheque != null) { cheque = OnixWebServiceAPI.SubmitObjectAPI("ApproveCheque", cheque); } return(cheque); }