private static void OnProductSelectedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { UInventoryItemAdjustment control = obj as UInventoryItemAdjustment; MInventoryAdjustment d = (MInventoryAdjustment)e.NewValue; updateGui(control, d); }
private void cmdAdjustmentDelete_Click(object sender, RoutedEventArgs e) { MInventoryAdjustment pp = (MInventoryAdjustment)(sender as Button).Tag; mv.RemoveAdjustment(pp); vw.IsModified = true; }
private static void updateGui(UInventoryItemAdjustment control, MInventoryAdjustment v) { if ((v == null) || (control == null)) { return; } MInventoryAdjustment o = new MInventoryAdjustment(v.GetDbObject().Clone()); control.lkupItem.SelectedObject = o.ItemObj; control.txtQuantity.Text = o.AdjQuantity; control.txtAmount.Text = o.AdjAmount; }
private void updateObject() { MInventoryAdjustment v = (MInventoryAdjustment)ProductSelected; if (v == null) { return; } v.ItemObj = null; if (lkupItem.SelectedObject != null) { //if (lkupItem.Lookup == LookupSearchType.InventoryItemLookup) //{ // v.ItemObj = lkupItem.SelectedObject; //} } v.AdjQuantity = txtQuantity.Text; v.AdjAmount = txtAmount.Text; v.ItemObj = lkupItem.SelectedObject; }
private void createAdjustDoc() { String toLocationCode = "LOCATION01"; String toLocationID = "2"; MInventoryDoc md = new MInventoryDoc(new CTable("")); md.DocumentDate = DateTime.Now; md.DocumentType = "4"; md.ToLocation = toLocationID; md.ToLocationCode = toLocationCode; md.AdjustmentBy = "1"; md.IsInternalDoc = false; int internalCnt = 0; int docCnt = 0; foreach (CTable o in inventoryItems) { MInventoryItem mi = new MInventoryItem(o); //en.Note = String.Format("META|{0}|{1}|{2}|{3}|{4}|{5}", // en.ItemUOMName, // en.ItemCategoryName, // en.ItemTypeName, // en.Temp2, // en.Temp3, // en.Temp4 // ); //"Temp2", //จำนวนคงเหลือ //"Temp3", //ราคา/หน่วย //"Temp4", //มูลค่าคงเหลือ string source = mi.Note; if (source.Equals("")) { continue; } string[] stringSeparators = new string[] { "|" }; string[] results = source.Split(stringSeparators, StringSplitOptions.None); if (results.Length < 7) { continue; } String balanceQty = results[4]; String balanceAmt = results[6]; if (internalCnt >= 30) { docCnt++; md.Note = "ตั้งยอดยกมา 000" + docCnt; OnixWebServiceAPI.SubmitObjectAPI("CreateInventoryDoc", md.GetDbObject()); md = new MInventoryDoc(new CTable("")); md.IsInternalDoc = false; md.DocumentDate = DateTime.Now; md.DocumentType = "4"; md.ToLocation = toLocationID; md.ToLocationCode = toLocationCode; md.AdjustmentBy = "1"; internalCnt = 0; } MInventoryAdjustment ai = new MInventoryAdjustment(new CTable("")); ai.ExtFlag = "A"; ai.ItemID = mi.ItemID; ai.ItemCode = mi.ItemCode; ai.AdjQuantity = balanceQty; ai.AdjAmount = balanceAmt; ai.AdjustmentByDetails = "1"; md.AddAdjustment(ai); importStatusUpdate(internalCnt, inventoryItems.Count); internalCnt++; } if (internalCnt > 0) { docCnt++; md.Note = "ตั้งยอดยกมา 000" + docCnt; OnixWebServiceAPI.SubmitObjectAPI("CreateInventoryDoc", md.GetDbObject()); } importStatusUpdate(inventoryItems.Count, inventoryItems.Count); }