Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
        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();
                }
            }
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        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();
            }
        }