public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData() { (model as MCashDoc).DocumentType = ((int)docType).ToString(); items = OnixWebServiceAPI.GetListAPI("GetCashDocList", "CASH_DOC_LIST", model.GetDbObject()); lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned(); itemSources.Clear(); foreach (CTable o in items) { MCashDoc v = null; if (docType == CashDocumentType.CashDocImport) { v = new MCashDocIn(o); } else { v = new MCashDocOut(o); } itemSources.Add(v); } Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources); return(tuple); }
public override CReportDataProcessingProperty DataToProcessingProperty(CTable o, ArrayList rows, int row) { int rowcount = rows.Count; CReportDataProcessingProperty rpp = new CReportDataProcessingProperty(); CRow r = (CRow)rowdef["DATA_LEVEL1"]; CRow nr = r.Clone(); MCashDocOut v = new MCashDocOut(o); double newh = AvailableSpace - nr.GetHeight(); nr.FillColumnsText((row + 1).ToString(), v.DocumentNo, v.DocumentDateFmt, v.AccountNo, v.BankName, v.TotalAmountFmt, v.DocumentStatusDesc, v.Note); totals[5] = totals[5] + CUtil.StringToDouble(v.TotalAmount); rpp.AddReportRow(nr); if (row == rowcount - 1) { //End row CRow ft = (CRow)rowdef["FOOTER_LEVEL1"]; CRow ftr = ft.Clone(); ftr.FillColumnsText(CLanguage.getValue("total"), "", "", "", "", CUtil.FormatNumber(totals[5].ToString()), "", ""); rpp.AddReportRow(ftr); newh = AvailableSpace - ftr.GetHeight(); } if (newh < 0) { rpp.IsNewPageRequired = true; } else { AvailableSpace = newh; } return(rpp); }
protected override MBaseModel createObject() { MCashDoc mv = null; if (docType == CashDocumentType.CashDocImport) { mv = new MCashDocIn(new CTable("")); } else if (docType == CashDocumentType.CashDocExport) { mv = new MCashDocOut(new CTable("")); } mv.CreateDefaultValue(); mv.DocumentDate = DateTime.Now; mv.DocumentType = ((Int32)docType).ToString(); mv.IsInternalDoc = false; mv.DocumentStatus = ((int)CashDocumentStatus.CashDocPending).ToString(); mv.AllowNegative = CGlobalVariable.IsCashNegativeAllow(); return(mv); }
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")) { CUtil.EnableForm(false, ParentControl); CTable newobj = OnixWebServiceAPI.SubmitObjectAPI("CopyCashDoc", currentObj.GetDbObject()); if (newobj != null) { MCashDoc ivd = null; if (docType == CashDocumentType.CashDocImport) { ivd = new MCashDocIn(newobj); } else { ivd = new MCashDocOut(newobj); } ItemAddedEvent(ivd, e); } else { //Error here CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null); } CUtil.EnableForm(true, ParentControl); } }
public CCriteriaCashInOut(MCashDocOut docOut) : base(docOut, "CCriteriaCashInOut") { }