private void fmSelector_Load(object sender, EventArgs e) { MyToolbox mt = new MyToolbox(); if (Selector == 0) { lbCaption.Text = mt.ReadResFile(this.Name + "InventoryCaption"); lbHelpTxt.Text = mt.ReadResFile(this.Name + "InventoryHelp"); } if (Selector == 1) { lbCaption.Text = mt.ReadResFile(this.Name + "TransferCaption"); lbHelpTxt.Text = mt.ReadResFile(this.Name + "TransferHelp"); } }
private void GetData() { BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; string lokation = ""; string placering = ""; string varenr = ""; string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.UtcNow; lot = tbInputData.Text; string uom = ""; string vl = ""; try { if (!WareHouse.WSReturnLotInfo(lot, Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uom, ref vl)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message1")); } else { lokation = Globals.theLocation; lbPID.Text = lot; lbLocation.Text = lokation; lbBin.Text = placering; lbItemNo.Text = varenr; lbDescription.Text = beskrivelse; lbQuantity.Text = antal.ToString(CultureInfo.GetCultureInfo(Globals.theLanguageCode).NumberFormat); lbUnitOfMesure.Text = uom; lbExpiredate.Text = mhd.ToShortDateString(); lbVendorLot.Text = vl; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText2"); lbNewLocation.Text = lokation; BinContentTool btool = new BinContentTool(); lbStdBin.Text = btool.GetDefaultBin(Globals.theLocation, varenr); tbInputData.Text = ""; Globals.step = 1; } } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { WareHouse.Dispose(); lbNewLocation.Text = lokation; tbInputData.Text = ""; } }
private void btlLogout_Click(object sender, EventArgs e) { BalanceWarehouse Warehouse = new BalanceWarehouse(); Warehouse.UseDefaultCredentials = true; try { if (Warehouse.WSEndProgramCode(tbInputData.Text)) { Application.ExitThread(); } else { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Error1")); } tbInputData.Text = ""; } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } }
public void GetPidData(string Data) { #region Local variables string lokation = Globals.theLocation; string placering = ""; string varenr = ""; string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.Now; string uom = ""; string vl = ""; bool b_recount = false; MyToolbox mt = new MyToolbox(); #endregion BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; ItemTool it = new ItemTool(); this.pbIndicator.Image = WindowsFormsApplication1.Properties.Resources.animatedCircle; this.pbIndicator.Visible = true; if (tbInputData.Text.Equals("#")) { if (Selector == 0) { // Kald formen til optælling uden P-ID, hvis det er en holdbarhedsvare tilføjes data og et P-ID. fmInventory inv = new fmInventory(tbInputData.Text); inv.ShowDialog(); tbInputData.Text = ""; } if (Selector == 1) { // Bruges pt ikke tbInputData.Text = ""; } } else { try { switch (it.TypeOfItem(ref Data, Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uom, ref vl, ref b_recount)) { case 0: { MessageBoxExample.MyMessageBox.ShowBox(string.Format(mt.ReadResFile(this.Name.ToString() + "Error1"), Data)); tbInputData.Text = ""; } break; case 1: { if (Selector == 0) { fmPidInventory pi = new fmPidInventory(Data); pi.ShowDialog(); tbInputData.Text = ""; } if (Selector == 1) { // Kalde form til at afvikle flytning af varer med P-ID fmPidItemTransfer pit = new fmPidItemTransfer(Data); pit.ShowDialog(); tbInputData.Text = ""; } } break; case 2: { #region GetBincontent BinContentTool bct = new BinContentTool(); if (bct.GetItemBincontent(Globals.theLocation, "", Data.ToUpper(), ref antal, ref uom)) { if (Selector == 0) { // Kalde form til at afvikle optælling af varer uden P-ID fmInventory inv = new fmInventory(Data); inv.ShowDialog(); tbInputData.Text = ""; } if (Selector == 1) { // Kalde form til at afvikle flytning af varer uden P-ID fmItemTransfer itf = new fmItemTransfer(Data); itf.ShowDialog(); tbInputData.Text = ""; } } #endregion /* * if (WareHouse.WSGetItemBinInformation(Globals.theWinlogon, Globals.theLocation, Data.ToUpper()) > 0) * { * if (Selector == 0) * { * // Kalde form til at afvikle optælling af varer uden P-ID * fmInventory inv = new fmInventory(Data); * inv.ShowDialog(); * tbInputData.Text = ""; * } * * if (Selector == 1) * { * // Kalde form til at afvikle flytning af varer uden P-ID * fmItemTransfer itf = new fmItemTransfer(Data); * itf.ShowDialog(); * tbInputData.Text = ""; * } * } */ } break; case 3: { if (WareHouse.WSGetBinContentInformation(Globals.theWinlogon, Globals.theLocation, Data.ToUpper()) > 0) { fmBinContent fm = new fmBinContent(1, Data.ToUpper()); fm.ShowDialog(); tbInputData.Text = ""; } } break; } } catch (Exception ex) { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; MessageBoxExample.MyMessageBox.ShowBox(ex.Message.ToString()); tbInputData.Text = ""; } finally { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; WareHouse.Dispose(); } } }
private void tbInputData_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { switch (Globals.GlobalStep) { case 0: { if (tbInputData.Text.Equals("")) { break; } BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; string lokation = ""; string placering = ""; string varenr = ""; string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.UtcNow; string uof = ""; string vl = ""; lot = tbInputData.Text; try { if (!WareHouse.WSReturnLotInfo(tbInputData.Text.ToString(), Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uof, ref vl)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message1")); break; } else { lokation = Globals.theLocation; lbLocation.Text = lokation; lbBin.Text = placering; lbItemNo.Text = varenr; lbDescription.Text = beskrivelse; lbQuantity.Text = antal.ToString(CultureInfo.GetCultureInfo(Globals.theLanguageCode).NumberFormat); lbExpiredate.Text = mhd.ToShortDateString(); lbUnitOfMesure.Text = uof; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText2"); tbInputData.Text = ""; lbFromPID.Text = lot; lbVendorLot.Text = vl; Globals.step++; } } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { WareHouse.Dispose(); tbInputData.Text = ""; } } break; case 1: { if (tbInputData.Text.Equals("")) { break; } if (decimal.Parse(tbInputData.Text) >= decimal.Parse(lbQuantity.Text)) { MessageBoxExample.MyMessageBox.ShowBox(string.Format(mt.ReadResFile(this.Name.ToString() + "Message4"), (decimal.Parse(lbQuantity.Text)).ToString())); break; } lbNewQty.Text = tbInputData.Text; tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; g_NyPid = WareHouse.WSReturnNewPID(); WareHouse.WSPrintPidPrev(g_NyPid, Globals.theWinlogon, lbItemNo.Text, lbNewQty.Text, lbExpiredate.Text, lbVendorLot.Text, lbUnitOfMesure.Text); // Print af ny label. if (Globals.theShowMessage) { MessageBoxExample.MyMessageBox.ShowBox(g_NyPid.ToString()); } WareHouse.Dispose(); Globals.step++; } break; case 2: { if (tbInputData.Text.Equals("")) { break; } if (!g_NyPid.Equals(tbInputData.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message2")); break; } lbNewLot.Text = tbInputData.Text; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText4"); tbInputData.Text = mt.ReadResFile(this.Name.ToString() + "TextBox1"); Globals.step++; } break; case 3: { BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; this.pbIndicator.Image = WindowsFormsApplication1.Properties.Resources.animatedCircle; this.pbIndicator.Visible = true; try { WareHouse.WSPostLotSplit(Globals.theTransferTemplateName, Globals.theTransferBatchName, lbItemNo.Text.ToString(), lbUnitOfMesure.Text, Globals.theWinlogon, lbLocation.Text.ToString(), lbBin.Text.ToString(), lot.ToString(), lbLocation.Text.ToString(), lbBin.Text.ToString(), lbNewLot.Text.ToString(), decimal.Parse(lbNewQty.Text.ToString()), false, DateTime.Parse(lbExpiredate.Text.ToString()), DateTime.Now, lbVendorLot.Text); WareHouse.WSPrintPid(lbFromPID.Text, Globals.theWinlogon); } catch (Exception ex) { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText1"); tbInputData.Text = ""; lbLocation.Text = ""; lbBin.Text = ""; lbItemNo.Text = ""; lbDescription.Text = ""; lbQuantity.Text = ""; lbExpiredate.Text = ""; lbNewQty.Text = ""; lbNewLot.Text = ""; lbUnitOfMesure.Text = ""; lbVendorLot.Text = ""; lbFromPID.Text = ""; WareHouse.Dispose(); Globals.step = 0; } } break; } } if ((e.KeyChar == (char)Keys.Escape) || (e.KeyChar == (char)Keys.Tab)) { switch (Globals.step) { case 4: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText4"); tbInputData.Text = mt.ReadResFile(this.Name.ToString() + "TextBox1"); } break; case 3: { Globals.step--; tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); } break; case 2: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText2"); tbInputData.Text = ""; } break; case 1: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText1"); tbInputData.Text = ""; lbLocation.Text = ""; lbBin.Text = ""; lbItemNo.Text = ""; lbDescription.Text = ""; lbQuantity.Text = ""; lbExpiredate.Text = ""; lbNewQty.Text = ""; lbNewLot.Text = ""; lbUnitOfMesure.Text = ""; lbFromPID.Text = ""; } break; case 0: this.Close(); break; } } }
private void GetPurchaseOrder(string OrderNo) { PurchaseOrderCard_Service purchaseorderservice = new PurchaseOrderCard_Service(); purchaseorderservice.UseDefaultCredentials = true; List <PurchaseOrderCard_Filter> PurchaseOrderFilterArray = new List <PurchaseOrderCard_Filter>(); PurchaseOrderCard_Filter PurchaseOrderNoFilter = new PurchaseOrderCard_Filter(); PurchaseOrderNoFilter.Field = PurchaseOrderCard_Fields.No; PurchaseOrderNoFilter.Criteria = OrderNo; PurchaseOrderFilterArray.Add(PurchaseOrderNoFilter); PurchaseOrderCard [] PurchaseOrder = purchaseorderservice.ReadMultiple(PurchaseOrderFilterArray.ToArray(), "", 1000); if (PurchaseOrder.Count() > 0) { foreach (var PO in PurchaseOrder) { if (PO.Status == 0) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message4")); break; } lbName.Text = PO.Buy_from_Vendor_Name.ToString(); if (!string.IsNullOrEmpty(PO.Buy_from_Vendor_Name_2)) { lbName2.Text = PO.Buy_from_Vendor_Name_2.ToString(); } if (!string.IsNullOrEmpty(PO.Buy_from_Address)) { lbAddress.Text = PO.Buy_from_Address.ToString(); } BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; try { if (WareHouse.WSCreateWarehouseInboundDoc(OrderNo)) { // Hent købsmodtagelseslinjer GetReceiptliens(OrderNo, OrderType); } } catch (Exception ex) { Globals.step = 0; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "LabelInputText1"); MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { WareHouse.Dispose(); tbInputData.Text = ""; btnDecoder.Visible = true; } } } else { tbInputData.Text = ""; MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message2")); } }
public void ReturnReceipts(string LocationCode) { if (dtBin == null) { dtBin = new DataTable(); dtBin.Columns.Add(mt.ReadResFile(this.Name.ToString() + "No"), typeof(string)); dtBin.Columns.Add(mt.ReadResFile(this.Name.ToString() + "Name"), typeof(string)); dtBin.Columns.Add(mt.ReadResFile(this.Name.ToString() + "Order"), typeof(string)); } else { dtBin.Rows.Clear(); } PurchaseOrderList_Service purchaseorderservice = new PurchaseOrderList_Service(); purchaseorderservice.UseDefaultCredentials = true; List <PurchaseOrderList_Filter> PurchaseOrderFilterArray = new List <PurchaseOrderList_Filter>(); PurchaseOrderList_Filter LocationFilter = new PurchaseOrderList_Filter(); LocationFilter.Field = PurchaseOrderList_Fields.Location_Code; LocationFilter.Criteria = LocationCode; PurchaseOrderFilterArray.Add(LocationFilter); PurchaseOrderList_Filter StatusFilter = new PurchaseOrderList_Filter(); StatusFilter.Field = PurchaseOrderList_Fields.Status; StatusFilter.Criteria = Status.Released.ToString(); PurchaseOrderFilterArray.Add(StatusFilter); PurchaseOrderList_Filter AssignedFilter = new PurchaseOrderList_Filter(); AssignedFilter.Field = PurchaseOrderList_Fields.Assigned_User_ID; AssignedFilter.Criteria = Globals.theWinlogon; PurchaseOrderFilterArray.Add(AssignedFilter); PurchaseOrderList [] PurchaseOrderResult = purchaseorderservice.ReadMultiple(PurchaseOrderFilterArray.ToArray(), "", 1000); if (PurchaseOrderResult.Count() > 0) { foreach (var item in PurchaseOrderResult) { if (item.No != "") { dtBin.Rows.Add(new object[] { item.No, item.Buy_from_Vendor_Name, (item.Vendor_Order_No == null ? "" : item.Vendor_Order_No) }); } } dataGridView1.DataSource = dtBin; dataGridView1.RowHeadersVisible = false; dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridView1.Update(); tbFilter.Focus(); } else { fmWhseReceiptSingle wrs = new fmWhseReceiptSingle(); wrs.ShowDialog(); this.Close(); } }
public void GetPidData(string Data) { #region Local variables string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.Now; string uom = ""; string vl = ""; bool b_recount = false; MyToolbox mt = new MyToolbox(); #endregion BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; ItemTool it = new ItemTool(); try { data = Data = WareHouse.WSGetItemCrossRef(Data); } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } try { switch (it.TypeOfItem(ref Data, Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uom, ref vl, ref b_recount)) { case 0: { MessageBoxExample.MyMessageBox.ShowBox(string.Format(mt.ReadResFile(this.Name.ToString() + "Error1"), Data)); tbInputData.Text = ""; } break; case 1: { lbDescription.Text = string.Format("{0} {1}", varenr, beskrivelse); ReturnIndex = 1; //P-ID } break; case 2: { lbDescription.Text = string.Format("{0} {1}", varenr, beskrivelse); ReturnIndex = 2; //Vareinfo } break; case 3: { lbDescription.Text = string.Format("{0} {1}", Data, ""); ReturnIndex = 3; //Placering } break; } } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message.ToString()); tbInputData.Text = ""; } finally { WareHouse.Dispose(); } if (ReturnIndex > 0) { btPrint.Enabled = true; } else { btPrint.Enabled = false; } }
private void tbInputData_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { switch (Globals.GlobalStep) { case 0: { if (tbInputData.Text.Equals("")) { break; } lbLocation.Text = ""; lbBin.Text = ""; lbItemNo.Text = ""; lbDescription.Text = ""; lbQuantity.Text = ""; lbUnitOfMesure.Text = ""; lbExpiredate.Text = ""; lbVendorLot.Text = ""; BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; string lokation = ""; string placering = ""; string varenr = ""; string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.UtcNow; lot = tbInputData.Text; string vl = ""; string uom = ""; bool b_recount = false; string refNo = tbInputData.Text.ToUpper(); ItemTool it = new ItemTool(); this.pbIndicator.Image = WindowsFormsApplication1.Properties.Resources.animatedCircle; this.pbIndicator.Visible = true; try { refNo = WareHouse.WSGetItemCrossRef(refNo); } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } try { switch (it.TypeOfItem(ref refNo, Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uom, ref vl, ref b_recount)) { case 0: { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message1")); } break; case 1: { if (lokation.Equals("")) { lokation = Globals.theLocation; } if (b_recount) { break; } lbLocation.Text = lokation; lbBin.Text = placering; lbItemNo.Text = varenr; lbDescription.Text = beskrivelse; lbQuantity.Text = antal.ToString(CultureInfo.GetCultureInfo(Globals.theLanguageCode).NumberFormat); lbUnitOfMesure.Text = uom; lbExpiredate.Text = mhd.ToShortDateString(); lbVendorLot.Text = vl; } break; case 2: { if (WareHouse.WSGetItemBinInformation(Globals.theWinlogon, Globals.theLocation, refNo) > 0) { fmBinContent fm = new fmBinContent(2, refNo); fm.ShowDialog(); this.Close(); } } break; case 3: { if (WareHouse.WSGetBinContentInformation(Globals.theWinlogon, Globals.theLocation, refNo) > 0) { fmBinContent fm = new fmBinContent(1, tbInputData.Text.ToUpper()); fm.ShowDialog(); this.Close(); } } break; } } catch (Exception ex) { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; MessageBoxExample.MyMessageBox.ShowBox(ex.Message.ToString()); } finally { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; WareHouse.Dispose(); tbInputData.Focus(); tbInputData.SelectAll(); } } break; } } if ((e.KeyChar == (char)Keys.Escape) || (e.KeyChar == (char)Keys.Tab)) { switch (Globals.step) { case 3: { Globals.step = 0; this.Close(); } break; case 2: { Globals.step = 0; this.Close(); } break; case 1: { Globals.step = 0; this.Close(); } break; case 0: this.Close(); break; } } }
private void GetItemData(string input) { bool UseMhd = false; BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; if (input.Equals("#")) { lbLocation.Text = Globals.theLocation; CaptionItem(); Globals.GlobalStep = 0; } else { try { if (WareHouse.WSItemUsesTracking(input)) { g_PID = WareHouse.WSReturnNewPID(); b_NewPID = true; b_confirmPid = true; } UseMhd = WareHouse.WSItemUsesMhdTracking(input); lbDescription.Text = WareHouse.WSReturnItemDescription(input); if (lbDescription.Text.Equals("")) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message8")); tbInputData.Focus(); tbInputData.SelectAll(); } lbUnitOfMesure.Text = WareHouse.WSReturnItemUnitOfMesure(itemno, 2); lbItemNo.Text = input; } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } CaptionBin(); Globals.GlobalStep = 1; } }
public void GetPidData() { #region Local variables string lokation = Globals.theLocation; string placering = ""; string varenr = ""; string beskrivelse = ""; decimal antal = 0; DateTime mhd = DateTime.Now; string uom = ""; string vl = ""; MyToolbox mt = new MyToolbox(); #endregion BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; ItemTool it = new ItemTool(); if (thepid.Equals("#")) { g_PID = WareHouse.WSReturnNewPID(); b_NewPID = true; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv Placering. tbInputData.Text = ""; lbLocation.Text = Globals.theLocation; if (Globals.theShowMessage) { MessageBoxExample.MyMessageBox.ShowBox(g_PID.ToString()); } b_confirmPid = true; Globals.step++; } try { if (it.TypeOfItem(ref thepid, Globals.theLocation, ref placering, ref varenr, ref beskrivelse, ref antal, ref mhd, ref uom, ref vl, ref recountpid) == 1) { lbLocation.Text = lokation; if (lokation.Equals("")) { lokation = Globals.theLocation; } lbBin.Text = placering; lbItemNo.Text = varenr; lbDescription.Text = beskrivelse; lbQuantity.Text = antal.ToString(CultureInfo.GetCultureInfo(Globals.theLanguageCode).NumberFormat); lbUnitOfMesure.Text = uom; lbExpiredate.Text = mhd.ToShortDateString(); lbPID.Text = thepid; lbVendorLot.Text = vl; bool FirstInventory = false; if (recountpid) { if (Globals.thePhysCountMode) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv placering Globals.step++; } else { b_NewPID = true; b_confirmPid = false; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv Placering. tbInputData.Text = ""; Globals.step++; } } else { if (Globals.thePhysCountMode) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv placering Globals.step++; } else { if (!FirstInventory) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText6"); // Angiv Antal. Globals.step = 5; } else { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv placering Globals.step++; } } } } else { if (!WareHouse.WSPIDExists(tbInputData.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message1")); tbInputData.SelectAll(); //break; } if (WareHouse.WSLotInfoUsed(tbInputData.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message1")); // break; } else { b_NewPID = true; b_confirmPid = false; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); // Angiv Placering. tbInputData.Text = ""; lbLocation.Text = Globals.theLocation; Globals.step++; } } } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message.ToString()); } finally { WareHouse.Dispose(); } }
private void tbInputData_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { switch (Globals.GlobalStep) { case 0: { if (tbInputData.Text.Equals("")) { break; } } break; case 1: { if (tbInputData.Text.Equals("")) { break; } BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; if (!WareHouse.WSBinExists(Globals.theLocation, tbInputData.Text.ToUpper())) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message4")); tbInputData.Focus(); tbInputData.SelectAll(); break; } if (!WareHouse.WSInventoryAllowed(Globals.theLocation, tbInputData.Text.ToUpper())) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message10")); tbInputData.Focus(); tbInputData.SelectAll(); break; } // Cykliskoptælling i kld begynd if (Globals.thePhysCountMode) { if (tbInputData.Text.ToUpper() != lbBin.Text) { if (MessageBox.Show(string.Format("Placeringen {0} er forskellig fra {1}{2}Der er registreret på P-ID {3}. Er placeringen {4} rigtig?{5}Hvis ja, så flyttes P-ID {6} til den scannede placering", tbInputData.Text, lbBin.Text, Environment.NewLine, lbPID.Text, tbInputData.Text, Environment.NewLine, lbPID.Text), "Placering", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { var service = new BalanceWarehouse(); service.UseDefaultCredentials = true; service.WSPostTransfer(Globals.theTransferTemplateName, Globals.theTransferBatchName, lbItemNo.Text, lbUnitOfMesure.Text, Globals.theWinlogon, Globals.theLocation, lbBin.Text, lbPID.Text, Globals.theLocation, tbInputData.Text, lbPID.Text, decimal.Parse(lbQuantity.Text), false, DateTime.Parse(lbExpiredate.Text.ToString()), DateTime.Now, 0); lbBin.Text = tbInputData.Text.ToUpper(); } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText6"); // Angiv antal Globals.step = 5; break; } else { tbInputData.Text = ""; tbInputData.Focus(); break; } } tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText6"); // Angiv antal Globals.step = 5; break; } // Cykliskoptælling i kld s**t lbBin.Text = tbInputData.Text; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText4"); tbInputData.Text = ""; bool FirstInventory = false; if (!FirstInventory) { Globals.step++; } else { if (!WareHouse.WSItemUsesTracking(lbItemNo.Text)) { MessageBoxExample.MyMessageBox.ShowBox(string.Format("Varen {0} kan ikke tælles op på et lotnummer,{1}da der ikke er en varesporringskode på varen", lbItemNo.Text, Environment.NewLine)); tbInputData.Text = ""; tbInputData.Focus(); break; } bool UseMhd = false; UseMhd = WareHouse.WSItemUsesMhdTracking(lbItemNo.Text); if (UseMhd) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText5"); tbInputData.Mask = mt.ReadResFile(this.Name.ToString() + "DataMask"); tbInputData.Text = ""; Globals.step++; } else { tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText6"); // Angiv antal Globals.step = 5; } } } break; case 2: { bool UseMhd = false; BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; try { if (!WareHouse.WSItemUsesTracking(tbInputData.Text)) { MessageBoxExample.MyMessageBox.ShowBox(string.Format("Varen {0} kan ikke tælles op på et lotnummer,{1}da der ikke er en varesporringskode på varen", lbItemNo.Text, Environment.NewLine)); break; } if (WareHouse.WSItemUsesTracking(tbInputData.Text) && (!recountpid)) { g_PID = WareHouse.WSReturnNewPID(); b_NewPID = true; } UseMhd = WareHouse.WSItemUsesMhdTracking(tbInputData.Text); lbDescription.Text = WareHouse.WSReturnItemDescription(tbInputData.Text); if (lbDescription.Text.Equals("")) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message8")); tbInputData.Focus(); tbInputData.SelectAll(); } lbUnitOfMesure.Text = WareHouse.WSReturnItemUnitOfMesure(tbInputData.Text, 2); lbItemNo.Text = tbInputData.Text; } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); tbInputData.Text = ""; tbInputData.Focus(); break; } if (UseMhd) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText5"); tbInputData.Mask = mt.ReadResFile(this.Name.ToString() + "DataMask"); tbInputData.Text = ""; Globals.step++; } else { tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText7"); Globals.step = 4; } } break; case 3: { if (tbInputData.Text.Equals("")) { break; } bool OK = false; DateTime TestDate = new DateTime(1, 1, 1); try { TestDate = Convert.ToDateTime(tbInputData.Text); if (TestDate.CompareTo(DateTime.Now) >= 1) { OK = true; } else { OK = false; MessageBoxExample.MyMessageBox.ShowBox(string.Format(mt.ReadResFile(this.Name.ToString() + "Message5"), TestDate.ToShortDateString(), Environment.NewLine, Environment.NewLine, DateTime.Today.ToShortDateString())); } } catch (Exception ex) { OK = false; MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } if (OK) { lbExpiredate.Text = tbInputData.Text; tbInputData.Mask = ""; tbInputData.Text = ""; Globals.step++; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText7");; tbInputData.Text = ""; } else { tbInputData.Text = ""; } } break; case 4: { if (tbInputData.Text.Equals("")) { break; } lbVendorLot.Text = tbInputData.Text; tbInputData.Text = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText6"); Globals.step++; } break; case 5: { if (tbInputData.Text.Equals("")) { break; } // Kontrol på, at der ikke tælles på en ikke tilladt placeringstype kode BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; if (!WareHouse.WSInventoryAllowed(Globals.theLocation, lbBin.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message10")); tbInputData.Focus(); tbInputData.SelectAll(); break; } decimal d = 0; // Angivelse af antal. if (!decimal.TryParse(tbInputData.Text, out d)) { break; } if (d < 0) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message6")); tbInputData.SelectAll(); break; } if (d > 1000000) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message9")); tbInputData.SelectAll(); break; } lbPhysQty.Text = tbInputData.Text; if (b_NewPID && b_confirmPid) { Globals.step++; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText8"); tbInputData.Text = ""; } else { Globals.step = 7; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText9"); tbInputData.Text = mt.ReadResFile(this.Name.ToString() + "TextBox1"); } if ((b_NewPID) && (decimal.Parse(lbPhysQty.Text) > 0)) { WareHouse.WSPrintPidPrev(g_PID, Globals.theWinlogon, lbItemNo.Text, lbPhysQty.Text, lbExpiredate.Text, lbVendorLot.Text, lbUnitOfMesure.Text); } WareHouse.Dispose(); } break; case 6: { if (b_confirmPid) { if (g_PID != tbInputData.Text) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message2")); tbInputData.Focus(); tbInputData.SelectAll(); break; } } BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; try { if (WareHouse.WSLotInfoUsed(tbInputData.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message2")); tbInputData.Focus(); tbInputData.SelectAll(); break; } } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } try { if (!WareHouse.WSLotInfoExists(lbItemNo.Text, tbInputData.Text, lbVendorLot.Text)) { MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(this.Name.ToString() + "Message2")); tbInputData.Focus(); tbInputData.SelectAll(); break; } thepid = tbInputData.Text; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText9"); tbInputData.Text = mt.ReadResFile(this.Name.ToString() + "TextBox1"); Globals.step++; } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { WareHouse.Dispose(); } } break; case 7: { BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; try { DateTime d; if (lbExpiredate.Text != "") { DateTime.TryParse(lbExpiredate.Text, out d); } else { d = DateTime.Now; } this.pbIndicator.Image = WindowsFormsApplication1.Properties.Resources.animatedCircle; this.pbIndicator.Visible = true; WareHouse.WSPostPhysicalInventory(Globals.thePhysInvTemplateName, Globals.thePhysInvBatchName, lbItemNo.Text.ToString(), Globals.theWinlogon, lbLocation.Text, lbBin.Text, thepid, decimal.Parse(lbPhysQty.Text), lbUnitOfMesure.Text, false, true, d, lbVendorLot.Text, DateTime.Now); if ((!b_NewPID) && (decimal.Parse(lbQuantity.Text) != decimal.Parse(lbPhysQty.Text))) { //WareHouse.WSPrintPID(lot); } if ((Globals.thePrintInvPid) && (!b_NewPID)) { WareHouse.WSPrintPid(thepid, Globals.theWinlogon); } } catch (Exception ex) { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { this.pbIndicator.Image = null; this.pbIndicator.Visible = false; //lblInputText3 lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText1"); tbInputData.Text = ""; lbLocation.Text = ""; lbBin.Text = ""; lbItemNo.Text = ""; lbDescription.Text = ""; lbQuantity.Text = ""; lbExpiredate.Text = ""; lbUnitOfMesure.Text = ""; lbPhysQty.Text = ""; lbVendorLot.Text = ""; lbPID.Text = ""; WareHouse.Dispose(); thepid = ""; g_PID = ""; b_NewPID = false; b_confirmPid = false; Globals.step = 0; this.Close(); } } break; } } if ((e.KeyChar == (char)Keys.Escape) || (e.KeyChar == (char)Keys.Tab)) { switch (Globals.step) { case 6: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText8"); tbInputData.Text = ""; } break; case 5: { if (!b_NewPID) { this.Close(); Globals.step = 0; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText1"); tbInputData.Text = ""; b_NewPID = false; b_confirmPid = false; tbInputData.Text = ""; lbLocation.Text = ""; lbBin.Text = ""; lbItemNo.Text = ""; lbDescription.Text = ""; lbQuantity.Text = ""; lbExpiredate.Text = ""; lbPID.Text = ""; lbVendorLot.Text = ""; } else { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText7"); tbInputData.Text = ""; } } break; case 4: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText5"); tbInputData.Mask = mt.ReadResFile(this.Name.ToString() + "DataMask"); } break; case 3: { Globals.step--; tbInputData.Mask = ""; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText4"); } break; case 2: { Globals.step--; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText3"); } break; case 1: { Globals.step = 0; this.Close(); } break; case 0: { Globals.step = 0; this.Close(); } break; } } }
private void edtTextID_KeyPress(object sender, KeyPressEventArgs e) { if ((e.KeyChar == (char)Keys.Escape) || (e.KeyChar == (char)Keys.Tab)) { switch (Globals.TheGlobalStep) { case 1: this.Close(); break; case 0: this.Close(); break; } } if (e.KeyChar == (char)Keys.Enter) { switch (Globals.TheGlobalStep) { case 1: { BalanceProduktion TimeJob = new BalanceProduktion(); TimeJob.UseDefaultCredentials = true; if (Globals.TheGlobalCome) { try { if (TimeJob.WSCreateTimeStampLine(Employee.TheEmployeeNo, Employee.TheTimeGroupCode, Employee.TheAbsenceCode, DateTime.Now.Date, DateTime.Now, 1)) { edtTextID.Text = mt.ReadResFile(this.Name.ToString() + "OK01"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } timer1.Interval = 1500; timer1.Start(); } else { try { if (TimeJob.WSCreateTimeStampLine(Employee.TheEmployeeNo, Employee.TheTimeGroupCode, Employee.TheAbsenceCode, DateTime.Now.Date, DateTime.Now, 2)) { edtTextID.Text = mt.ReadResFile(this.Name.ToString() + "OK01"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } timer1.Interval = 1500; timer1.Start(); } Globals.TheGlobalStep = 0; TimeJob.Dispose(); } break; } } }
private void ExtractLineData() { WhaLine = WarehouseActivityLineList.ElementAt(WhaLineIndex); lbLines.Text = string.Format("{0} af {1}", (WhaLineIndex + 1), NoOfLines.ToString()); lbSourceNo.Text = WhaLine.theSourceNo; lbItemNo.Text = WhaLine.theItemNo; lbDescription.Text = WhaLine.theDescription; lbLotNo.Text = WhaLine.theLotNo; lbQty.Text = WhaLine.theQtyToHandle.ToString(); lbBincode.Text = WhaLine.theBin; lbUnits.Text = WhaLine.theUnitOfMesure; BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; lbQuantity.Text = WareHouse.WSReturnRemaningQtyPickorder(WhaLine.theNo, WhaLine.theLineNo).ToString(CultureInfo.GetCultureInfo(Globals.theLanguageCode).NumberFormat); UseTracking = WareHouse.WSItemUsesTracking(WhaLine.theItemNo); WareHouse.Dispose(); if (UseTracking) { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "LabelInputText2"); tbInputData.Text = ""; Globals.GlobalStep = 1; } else { lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "LabelInputText5"); tbInputData.Text = ""; Globals.GlobalStep = 3; } }
private void edtTextID_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { switch (Globals.TheGlobalStep) { case 1: { if (edtTextID.Text.Equals("")) { break; } lblHeaderText.Text = mt.ReadResFile(this.Name.ToString() + "LeadText01"); BalanceProduktion TimeJob = new BalanceProduktion(); TimeJob.UseDefaultCredentials = true; if (Globals.TheGlobalCome) { try { if (TimeJob.WSCreateProdRessLine(Employee.TheEmployeeNo, Employee.TheWorkingWorkCenter, DateTime.Now, DateTime.MinValue, "J")) { edtTextID.Text = mt.ReadResFile(this.Name.ToString() + "OK01"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } TimeJob.Dispose(); } else { try { if (TimeJob.WSCreateProdRessLine(Employee.TheEmployeeNo, Employee.TheWorkingWorkCenter, DateTime.MinValue, DateTime.Now, "J")) { edtTextID.Text = mt.ReadResFile(this.Name.ToString() + "OK01"); } else { edtTextID.Text = mt.ReadResFile(this.Name.ToString() + "ERROR01"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Globals.TheGlobalStep = 0; TimeJob.Dispose(); timer1.Interval = 1500; timer1.Start(); } break; } } if ((e.KeyChar == (char)Keys.Escape) || (e.KeyChar == (char)Keys.Tab)) { switch (Globals.TheGlobalStep) { case 0: this.Close(); break; } } }
private void GetData() { BalanceWarehouse WareHouse = new BalanceWarehouse(); WareHouse.UseDefaultCredentials = true; try { lbLocation.Text = Globals.theLocation; lbItemNo.Text = itemno; lbQuantity.Text = "0"; lblInputText.Text = mt.ReadResFile(this.Name.ToString() + "lblInputText1"); lbNewLocation.Text = Globals.theLocation; tbInputData.Text = ""; Globals.step = 0; lbDescription.Text = WareHouse.WSReturnItemDescription(itemno); if (lbDescription.Text.Equals("")) { MessageBoxExample.MyMessageBox.ShowBox(string.Format("Varen {0} findes ikke", itemno)); tbInputData.Focus(); tbInputData.SelectAll(); } lbUnitOfMesure.Text = WareHouse.WSReturnItemUnitOfMesure(itemno, 2); BinContentTool btool = new BinContentTool(); lbStdBin.Text = btool.GetDefaultBin(Globals.theLocation, itemno); } catch (Exception ex) { MessageBoxExample.MyMessageBox.ShowBox(ex.Message); } finally { WareHouse.Dispose(); lbNewLocation.Text = Globals.theLocation; tbInputData.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { string test = textBox1.Text == "1" ? "fmPickActivityListSourseType1" : "fmPickActivityListSourseType11"; MessageBoxExample.MyMessageBox.ShowBox(mt.ReadResFile(test)); }