private void LoadData() { this.Title = Caption; CTable t = new CTable("INVENTORY_TX"); vw = new MInventoryTransaction(t); //vw.LocationObj = this.locationObj; vw.CreateDefaultValue(); DataContext = vw; CUtil.EnableForm(false, this); if (Mode.Equals("E")) { CTable newDB = actualView.GetDbObject().Clone(); vw.SetDbObject(newDB); vw.NotifyAllPropertiesChanged(); radUp.IsChecked = vw.UpSelected; radDown.IsChecked = vw.DownSelected; } else { vw.DownSelected = true; radDown.IsChecked = true; } vw.IsModified = false; CUtil.EnableForm(true, this); }
private void cmdAction_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; currentViewObj = (MInventoryTransaction)btn.Tag; btn.ContextMenu.IsOpen = true; }
private void lsvImportItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (lsvImportItem.SelectedItems.Count == 1) { currentViewObj = (MInventoryTransaction)lsvImportItem.SelectedItems[0]; ShowEditWindow(); } }
protected override MBaseModel createObject() { mv = new MInventoryTransaction(new CTable("")); mv.CreateDefaultValue(); mv.TxType = "E"; mv.ReturnedAllFlag = "N"; if (dt == InventoryDocumentType.InvDocReturn) { mv.TxType = "I"; } return(mv); }
private void createInfoEntries() { AddInfoControl(new CCriteriaEntry(CriteriaEntryType.ENTRY_LABEL, "", "from_location")); AddInfoControl(new CCriteriaEntry(CriteriaEntryType.ENTRY_TEXT_BOX, "LocationToName", "")); MInventoryTransaction m = (MInventoryTransaction)model; MInventoryDoc d = (MInventoryDoc)GetDefaultData(); if (d != null) { m.LocationID = d.ToLocation; m.LocationToName = d.ToLocationName; m.ReturnedAllFlag = "N"; } }
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(); CRow ft = (CRow)rowdef["FOOTER_LEVEL1"]; CRow ftr = ft.Clone(); MInventoryTransaction v = new MInventoryTransaction(o); double newh = AvailableSpace - nr.GetHeight(); if (Parameter.GetFieldValue("COSTING_TYPE").Equals("MOVE")) { nr.FillColumnsText((row + 1).ToString(), v.DocumentDateFmt, v.DocumentNo, v.LocationName, v.LocationToName, v.ItemCode, v.ItemNameThai , CUtil.FormatNumber(v.ItemQuantity, "-"), CUtil.FormatNumber(v.ItemPrice, "-"), CUtil.FormatNumber(v.ItemAmount, "-")); totals += CUtil.StringToDouble(v.ItemAmount); } rpp.AddReportRow(nr); if (row == rowcount - 1) { newh = newh - ftr.GetHeight(); if (newh > 0) { ftr.FillColumnsText("", CLanguage.getValue("total"), "", "", "", "", "", "", "", CUtil.FormatNumber(totals.ToString(), "-")); rpp.AddReportRow(ftr); totals = 0; } } if (newh < 0) { rpp.IsNewPageRequired = true; } else { AvailableSpace = newh; } return(rpp); }
public WinAddEditExportItem(InventoryDocumentType dt) { DocType = dt; vw = new MInventoryTransaction(new CTable("")); vw.LocationObj = this.locationObj; vw.CreateDefaultValue(); vw.TxType = "E"; if (DocType == InventoryDocumentType.InvDocXfer) { vw.TxType = "X"; } DataContext = vw; InitializeComponent(); }
public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData() { CTable tb = model.GetDbObject(); items = OnixWebServiceAPI.GetListAPI("GetBorrowedItemList", "BORROWED_ITEM_LIST", tb); lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned(); itemSources.Clear(); int idx = 0; foreach (CTable o in items) { MInventoryTransaction v = new MInventoryTransaction(o); v.RowIndex = idx; itemSources.Add(v); idx++; } Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources); return(tuple); }
private void addReturnDocItems(ArrayList items) { //To prevent the duplication selection Hashtable hash = CUtil.ObserableCollectionToHash(mv.TxItems, "BorrowID"); foreach (MInventoryTransaction ai in items) { if (hash.ContainsKey(ai.InventoryTxID)) { continue; } MInventoryTransaction di = new MInventoryTransaction(new CTable("")); di.SetDbObject(ai.GetDbObject().CloneAll()); di.InventoryTxID = ""; di.ExtFlag = "A"; di.TxType = "I"; di.BorrowID = ai.InventoryTxID; di.BorrowDocumentNo = ai.DocumentNo; di.ItemQuantity = ai.ReturnQuantityNeed; mv.AddTxItem(di, dt); } }
public CInventoryDocItem(MInventoryTransaction di, String lang, MReportConfig cfg) { rptConfig = cfg; mi = di; Lang = lang; }