示例#1
0
 ///Returns list of all addresses in the database
 public static string getAddressList(string input)
 {
     try
     {
         clsDB         myDB = new clsDB();
         SqlCommand    cmd  = new SqlCommand();
         StringBuilder sB   = new StringBuilder();
         using (myDB.OpenConnection())
         {
             using (SqlDataReader dR = (SqlDataReader)myDB.ExecuteSP(DBK.SP.spGETKVPFULLADDRESS, new List <SqlParameter>(), clsDB.SPExMode.READER, ref cmd))
             {
                 if (dR != null && dR.HasRows)
                 {
                     while (dR.Read())
                     {
                         sB.Append("<p>" + myDB.Fld2Str(dR[DBK.valDISPLAYEDVALUE]) + "</p>");
                     }
                 }
                 else
                 {
                     sB.Append("<p>No addresses found when executing stored procedure " + DBK.SP.spGETKVPFULLADDRESS + " in WebMethod getAddressList.</p>");
                 }
             }
         }
         return(sB.ToString());
     } catch (Exception ex)
     {
         return((ex.Message + ex.StackTrace).Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()));
     }
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string html = "";

            try
            {
                //Check for URL Parameters-- that determines if this page is being called to view an existing bom
                string p     = Request.QueryString["p"];
                string pR    = Request.QueryString["pR"];
                string bR    = Request.QueryString["bR"];
                string desNm = Request.QueryString["h"];
                if (p != null && pR != null && bR != null)
                {
                    CustomCode x = new CustomCode();
                    html = x.DownloadHTMLforBOM(p, pR, bR);
                    divResult.Controls.Add(new LiteralControl(html));
                    txtProduct.Text       = p.ToUpper();
                    txtProductRev.Text    = pR.ToUpper();
                    txtBOMRev.Text        = bR.ToUpper();
                    txtProductStatus.Text = x.GetProductStatus(p, pR, bR).ToUpper();
                    if (txtProductStatus.Text.ToUpper() == RELEASEKEY.ToUpper())
                    {
                        btnUpload.Enabled = false;
                        btnUpload.Style.Add("display", "none");
                        divBrowse.Style.Add("display", "none");
                    }

                    this.Title = txtProduct.Text + " Rev " + txtProductRev.Text + " (BOM Rev " + txtBOMRev.Text.PadLeft(2, '0') + ")";
                }
                else if (desNm != null)
                {
                    CustomCode x = new CustomCode();
                    html = x.DownloadHTMLforBOMHistory(desNm);
                    divResult.Controls.Add(new LiteralControl(html));
                    txtProduct.Text       = desNm.ToUpper();
                    txtProductRev.Text    = "";
                    txtBOMRev.Text        = "";
                    txtProductStatus.Text = "";
                    this.Title            = desNm + " History";
                }
                else
                {
                    this.Title = "BOM View and Upload";
                }
            } catch (Exception ex) {
                divResult.Controls.Add(new LiteralControl(DynControls.renderLiteralControlErrorString(ex, html)));
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Add controls to pnlInput; attributes for these controls are taken from the database, so that this can
            //be a truly generic solution
            if (m_useDB)
            {
                DynControls.GenerateControlsFromDatabase(DBK.AppKeys.CUSTOM_PN, pnlInput);
                pnlInput.Controls.Add(DynControls.html_button("btnSubmit", "SUBMIT", "inputButton", true, form: "frmCustomPN"));
            }
            else
            {
                pnlInput.Controls.Add(DynControls.html_label("lbl_1", "Enter Board Name:", "fldlabel", "txt_1"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_1", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_1", "Error Message goes here; so on for other elements.", "errorlabel", "", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_1", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_2", "Enter Family Number:", "fldlabel", "txt_2"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_2", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_2", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_2", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_3", "Enter Release Revision:", "fldlabel", "txt_3"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_3", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_3", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_3", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_4", "Do you need a PCB Number?", "fldlabel", "cbo_4"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_4", "cboInput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_4", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_4", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_5", "Enter Number of SHIELD Part Numbers", "fldlabel", "txt_5"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_5", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_5", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_5", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_6", "Enter Number of SROM/NVRAM Part Numbers", "fldlabel", "txt_6"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_6", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_6", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_6", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_7", "Enter Number of BT FW Part Numbers", "fldlabel", "txt_7"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_7", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_7", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_7", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_8", "Enter Number of WORK INSTRUCTION Part Numbers", "fldlabel", "txt_8"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_8", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_8", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_8", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_9", "Is this a Bring-Up (BU) Board?", "fldlabel", "cbo_9"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_9", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_9", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_9", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_10", "Do you need a Part Number for a SOCKET (SKT) BU Board?", "fldlabel", "cbo_10"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_10", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_10", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_10", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_11", "Do you need a Part Number for a SOLDER (SOL) BU Board?", "fldlabel", "cbo_11"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_11", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_11", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_11", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //check for any url encoded parameters
            string foundIDData = "";

            if (Request.QueryString.HasKeys())
            {
                try
                {
                    CustomCode x        = new CustomCode();
                    string     targetID = Request.QueryString["ID"];
                    //The following is a bogus division that will go at the end of the displayed page so that the client can't obtain the ID
                    string htmlForID = "<div " +
                                       DynControls.encodeProperty("id", "x_" + targetID) +
                                       DynControls.encodeProperty("class", "getID") + " ></div>";
                    //Get the PN associated with the targetID
                    clsDB               myDB = new clsDB();
                    SqlCommand          cmd  = new SqlCommand();
                    List <SqlParameter> ps   = new List <SqlParameter>();
                    ps.Add(new SqlParameter("@pnID", Int64.Parse(targetID)));
                    string pageHeader = "";
                    using (myDB.OpenConnection())
                    {
                        using (SqlDataReader dR = (SqlDataReader)myDB.ExecuteSP(DBK.SP.spOTSGETPNINFO, ps, clsDB.SPExMode.READER, ref cmd))
                        {
                            if (dR != null && dR.HasRows)
                            {
                                dR.Read();
                                pageHeader = myDB.Fld2Str(dR[DBK.strPARTNUMBER]);
                            }
                        }
                    }

                    if (Request.QueryString["INV"] != null)
                    {
                        pageHeader  = DynControls.html_header_string(pageHeader + " Inventory", 1);
                        foundIDData = pageHeader + x.InvForPN(targetID) + htmlForID;
                    }
                    else if (Request.QueryString["INVH"] != null)
                    {
                        pageHeader  = DynControls.html_header_string(pageHeader + " Inventory History", 1);
                        foundIDData = pageHeader + x.MakePartNumberInventoryHistoryTable(Int64.Parse(targetID)) + htmlForID;
                    }
                    else
                    {
                        foundIDData = x.getHTMLForPartNumberID(targetID);
                    }
                    otsdivs.Controls.Add(new LiteralControl(foundIDData));
                    foreach (Control c in divMenuButtons.Controls)
                    {
                        divMenuButtons.Controls.Remove(c);
                    }
                    return;
                } catch (Exception ex)
                {
                    string x = ex.Message + ex.StackTrace;
                }
            }
            //Create three panels and add them to the existing div
            Panel divOTSNew = new Panel();

            divOTSNew.ID = "divOTSNew";
            divOTSNew.Style.Add(HtmlTextWriterStyle.Display, "none");
            otsdivs.Controls.Add(divOTSNew);

            //There are two panels in divOTSNew: divOTSNewIn and divOTSNewOut

            Panel divOTSNewIn = new Panel();

            divOTSNewIn.ID = "divOTSNewIn";
            //Get the input controls from the database for divOTSNewIn...
            DynControls.GenerateControlsFromDatabase(DBK.AppKeys.GET_NEWOTSPN, divOTSNewIn);
            //Add a Submit button
            divOTSNewIn.Controls.Add(DynControls.html_button("btnOTSNewIn", "SUBMIT", "inputButton",
                                                             true, AAAK.DISPLAYTYPES.BLOCK, "Create an OTS Part Number", "frmNewOTS"));
            //...and add a div for the ajax output
            Panel divOTSNewOut = new Panel();

            divOTSNewOut.ID = "divOTSNewOut";
            divOTSNewOut.Controls.Add(new LiteralControl("<p>Enter the information on the left, then press Submit to get your new OTS Part Number.</p>"));
            //Add these two sub panels
            divOTSNew.Controls.Add(divOTSNewIn);
            divOTSNew.Controls.Add(divOTSNewOut);
            //***** End divOTSNew

            //***** Start divOTSFind
            Panel divOTSFind = new Panel();

            divOTSFind.ID = "divOTSFind";
            divOTSFind.Style.Add(HtmlTextWriterStyle.Display, "none");
            //divOTSFind.Style.Add(HtmlTextWriterStyle.OverflowX, "auto");
            otsdivs.Controls.Add(divOTSFind);
            //Now: The html in this div is simple, but as the user make selections, the AJAX calls increase the
            //complexity of the children's html.
            //This div has 3 divs.
            ///divOTSFind Child Div 1:
            Panel divSearch = new Panel();

            divSearch.ID = "divSearch";

            DynControls.GenerateControlsFromDatabase(DBK.AppKeys.SEARCH_OTS, divSearch, null, "", -1, true);
            //Create the search button
            string btnSearchHtmlString = DynControls.html_button_string("btnLook", "SEARCH", "searchButton",
                                                                        true, AAAK.DISPLAYTYPES.BLOCK, form: "frmSearchOTS");

            divSearch.Controls.Add(new LiteralControl(btnSearchHtmlString));

            ///divOTSFind Child Div 2:
            ///The message div
            Panel divSearchMsg = new Panel();

            divSearchMsg.Style.Add(HtmlTextWriterStyle.Display, "block");
            divSearchMsg.ID = "divMessage";
            divSearchMsg.Controls.Add(new LiteralControl("<p " + DynControls.encodeProperty("id", "searchmsg") + ">" +
                                                         "Enter search criteria above to find Part Number Information.</p>"));
            ///divOTSFind Child Div 3:
            ///
            Panel divLook = new Panel();

            divLook.Style.Add(HtmlTextWriterStyle.Display, "block");
            divLook.Style.Add(HtmlTextWriterStyle.OverflowX, "auto");
            divLook.ID = "divLook";
            /// divLook's html will be determine when user presses SEARCH

            ///Add the three divs to divOTSFind
            divOTSFind.Controls.Add(divSearch);
            divOTSFind.Controls.Add(new LiteralControl("<div></div>"));
            divOTSFind.Controls.Add(divSearchMsg);
            divOTSFind.Controls.Add(divLook);

            Panel divOTSAdmin = new Panel();

            divOTSAdmin.ID = "divOTSAdmin";
            divOTSAdmin.Controls.Add(new LiteralControl("<p>Admin</p>"));
            divOTSAdmin.Style.Add(HtmlTextWriterStyle.Display, "none");
            otsdivs.Controls.Add(divOTSAdmin);
        }
示例#5
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            clsAssyBOM aB = null;

            try
            {
                string fn = System.IO.Path.GetFileName(filFileUpload.PostedFile.FileName);
                if (filFileUpload.PostedFile != null && filFileUpload.PostedFile.ContentLength > 0)
                {
                    clsFileUtil f = new clsFileUtil("");
                    f.MakeDirectory(Server.MapPath(AAAK.TEMPDATA) + "\\");
                    string fullServerFileName = Server.MapPath(AAAK.TEMPDATA) + "\\" + fn;
                    //Create the directory
                    filFileUpload.PostedFile.SaveAs(fullServerFileName);
                    string pName = txtProduct.Text;
                    string pRev  = txtProductRev.Text;
                    string bRev  = txtBOMRev.Text;

                    //create an AssyBOM object
                    try
                    {
                        aB = new clsAssyBOM(pName, "", pRev, 1, 1, int.Parse(bRev), "", fullServerFileName);
                    } catch (Exception ex2)
                    {
                        divMsg.Controls.Add(new LiteralControl("<p>Could not upload the BOM because of the following errors:</p>" +
                                                               aB.HTML_ErrorMsg));
                        return;
                    }

                    if (aB == null)
                    {
                        divMsg.Controls.Add(new LiteralControl("<p>Could not upload the BOM.  Please make sure you provided a valid upload BOM.</p>" +
                                                               "Assembly BOM Object was null"));
                        return;
                    }
                    else if (aB.HTML_ErrorMsg != "")
                    {
                        divMsg.Controls.Add(new LiteralControl("<p>Could not upload the BOM.  Please make sure you provided a valid upload BOM.</p>" +
                                                               "The error encountered was: " + aB.HTML_ErrorMsg));
                        return;
                    }

                    //Continue with upload if no errors happened during initialization
                    if (aB.UploadToDB())
                    {
                        divMsg.Controls.Add(new LiteralControl("<p>BOM Successfully Uploaded!  Next step is redirect so user can view uploaded BOM.</p>"));
                    }
                    else
                    {
                        string errorResult = aB.HTML_ErrorMsg;

                        string partAnalysisResult = aB.HTML_BadPartMessage;
                        if (partAnalysisResult != "")
                        {
                            divMsg.Controls.Add(new LiteralControl("<p>Could not upload the BOM because of the following part number errors:</p>" +
                                                                   partAnalysisResult));
                        }

                        if (errorResult != "")
                        {
                            divMsg.Controls.Add(new LiteralControl("<p>Could not upload the BOM because of the following errors:</p>" +
                                                                   errorResult));
                        }

                        if (errorResult != "" || partAnalysisResult != "")
                        {
                            divResult.Controls.Clear();
                            return;
                        }
                    }
                }
                else
                {
                    divMsg.Controls.Add(new LiteralControl("<p>" + fn + " is not a legal Upload BOM.  Please make sure you have selected a valid file."));
                }
            }

            catch (Exception ex)
            {
                string errMsg = ex.GetType().ToString() + ex.Message + ex.StackTrace;
                divMsg.Controls.Add(new LiteralControl("<p>" + errMsg.Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()) + "</p>"));
            }
        }
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            //HttpResponse resp = HttpContext.Current.Response;
            //Response.AddHeader("Content-Type", "text/event-stream");
            //Response.AddHeader("Cache-Control", "no-cache");
            //Response.AddHeader("Access-Control-Allow-Origin", "*");
            //Response.AddHeader("Connection", "keep-alive");


            clsFileUtil   f = new clsFileUtil("");
            string        fullServerFileName = "";
            SSERelay      resp         = new SSERelay(Response);
            List <string> lstFileNames = new List <string>();

            try
            {
                string fn = System.IO.Path.GetFileName(filFileUpload.PostedFile.FileName);
                string fd = Server.MapPath(AAAK.TEMPDATA) + "\\";
                fullServerFileName = fd + "\\" + fn;
                if (filFileUpload.PostedFile != null && filFileUpload.PostedFile.ContentLength > 0)
                {
                    f.MakeDirectory(fd + "\\");
                    //Save the uploaded file
                    filFileUpload.PostedFile.SaveAs(fullServerFileName);


                    //****If zip file, unzip and start loop here****//
                    if (fn.EndsWith(".zip"))
                    {
                    }
                    else
                    {
                        lstFileNames.Add(fn);
                    }

                    clsOTSUploader cOU = new clsOTSUploader();
                    for (int i = 0; i < lstFileNames.Count(); i++)
                    {
                        if (rdbOTSImport.Checked)
                        {
                            string processResult = cOU.ProcessFile(resp, fd, fn);
                        }
                        else
                        {
                            string processResult = cOU.ProcessFileForInventory(resp, fd, fn, 1, txtInvComment.Text.ToUpper());
                        }
                    }
                }
                else
                {
                    resp.send(fn + " is not a legal File.  Please make sure you have selected a valid file.");
                    resp.send("File not processed.");
                }

                //Put the stringbuilder in divMsg
                divResult.InnerHtml = resp.GetMessageBlock();
            }

            catch (Exception ex)
            {
                string errMsg = ex.GetType().ToString() + ex.Message + ex.StackTrace;
                resp.send("data: " + errMsg.Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()));
                //divMsg.Controls.Add(new LiteralControl("<p>" + errMsg.Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()) + "</p>"));
            } finally
            {
                try
                {
                    System.IO.FileInfo fl = new System.IO.FileInfo(fullServerFileName);
                    fl.Delete();
                }
                catch (Exception eM)
                {
                    string errM = eM.Message + eM.StackTrace;
                }
            }
        }
示例#7
0
        /// <summary>
        /// Updates invBulk with user information in input
        /// </summary>
        /// <param name="input">FORMAT:
        /// [comment]DELIM[invBulk.ID]DELIM[EXISTING QTY]DELIM[DELTA]DELIM[SubInv]DELIM[LocationID]DELIM[OwnerID]DELIM[VPNID]DELIM[TransactionType ID]......</param>
        /// <returns></returns>
        public string UpdatePartInventory(string input, string[] m_dlim)
        {
            StringBuilder sB = new StringBuilder();

            try
            {
                string[] arr = input.Split(m_dlim, StringSplitOptions.None);
                string   cmt = arr[0].ToUpper();
                lock (lockUpdateInvObj)
                {
                    for (int i = 1; i < arr.Length; i = i + 8)
                    {
                        clsDB               myDB        = new clsDB();
                        SqlCommand          cmd         = new SqlCommand();
                        List <SqlParameter> ps          = new List <SqlParameter>();
                        string              spName      = "";
                        string              ID          = arr[i];
                        string              Qty         = arr[i + 1];
                        string              Delta       = arr[i + 2];
                        string              SubInv      = arr[i + 3].ToUpper();
                        string              Loc         = arr[i + 4];
                        string              Owner       = arr[i + 5];
                        string              VPNID       = arr[i + 6];
                        string              TransTypeID = arr[i + 7];

                        int    oldQty       = 0;
                        int    oldLoc       = -1;
                        Int64  oldOwner     = -1;
                        string oldSubInv    = "";
                        int    oldKeySubInv = -1;
                        //Get the current subinv, location, qty, and owner for the given ID
                        ps.Add(new SqlParameter("@" + DBK.ID, Int64.Parse(ID)));
                        using (myDB.OpenConnection())
                        {
                            using (SqlDataReader dR = (SqlDataReader)myDB.ExecuteSP(DBK.SP.spINVGETINFOFORINVBULKID, ps, clsDB.SPExMode.READER, ref cmd))
                            {
                                if (dR != null && dR.HasRows)
                                {
                                    dR.Read();
                                    oldQty       = (int)dR[DBK.intQTY];
                                    oldLoc       = (int)dR[DBK.keyLOCATIONBULK];
                                    oldOwner     = (Int64)dR[DBK.keyOWNER];
                                    oldKeySubInv = (int)dR[DBK.keySUBINV];
                                    oldSubInv    = (string)dR[DBK.strSUBINV];
                                }
                            }
                        }

                        //Reset for next usage
                        ps.Clear();

                        if (Qty == "-1" && Int64.Parse(ID) > -1)
                        {
                            //User wants to remove this entry from invBulk
                            ps.Add(new SqlParameter("@" + DBK.keyBULKITEM, VPNID));
                            ps.Add(new SqlParameter("@" + DBK.keyCHANGEDBY, AAAK.CHANGEDBY));
                            ps.Add(new SqlParameter("@" + DBK.intDELTA, -oldQty));
                            ps.Add(new SqlParameter("@" + DBK.strCOMMENT, cmt));
                            ps.Add(new SqlParameter("@" + DBK.keyTRANSACTIONTYPE, 1));
                            ps.Add(new SqlParameter("@" + DBK.keyLOCATIONBULK, oldLoc));
                            ps.Add(new SqlParameter("@" + DBK.keyOWNER, oldOwner));
                            ps.Add(new SqlParameter("@" + DBK.keySUBINV, oldKeySubInv));
                            ps.Add(new SqlParameter("@" + DBK.ID, ID));
                            spName = DBK.SP.spINVREMOVEBULKINVENTRY;
                        }
                        else if (!clsUtil.IsInteger(Qty))
                        {
                            //Ignore this value, but alert user via email
                        }
                        else if (Qty != "" && Int64.Parse(Loc) > -1 && Int64.Parse(Owner) > -1)
                        {
                            //Update Qty based on Delta; note the client has already determined if there is a minus or not in front of delta, so
                            int newQty = int.Parse(Qty) + int.Parse(Delta);

                            //Only continue if there is a change in the data
                            if (oldLoc != int.Parse(Loc) || oldOwner != Int64.Parse(Owner) || oldQty != newQty || oldSubInv != SubInv)
                            {
                                //User wants to make a new/update an existing entry
                                ps.Add(new SqlParameter("@" + DBK.keyBULKITEM, VPNID));
                                ps.Add(new SqlParameter("@" + DBK.keyCHANGEDBY, AAAK.CHANGEDBY));
                                ps.Add(new SqlParameter("@" + DBK.intDELTA, Delta));
                                ps.Add(new SqlParameter("@" + DBK.strCOMMENT, cmt));
                                ps.Add(new SqlParameter("@" + DBK.keyTRANSACTIONTYPE, TransTypeID));
                                ps.Add(new SqlParameter("@" + DBK.keyLOCATIONBULK, Loc));
                                ps.Add(new SqlParameter("@" + DBK.keyOWNER, Owner));
                                ps.Add(new SqlParameter("@" + DBK.intQTY, newQty));
                                ps.Add(new SqlParameter("@" + DBK.ID, ID));
                                ps.Add(new SqlParameter("@" + DBK.strSUBINV, SubInv));
                                spName = DBK.SP.spINVUPSERTINVBULKENTRY;
                            }
                        }
                        if (spName != "")
                        {
                            using (myDB.OpenConnection())
                            {
                                myDB.ExecuteSP(spName, ps, clsDB.SPExMode.NONQUERY, ref cmd);
                                {
                                    if (myDB.ErrMsg != "")
                                    {
                                        sB.Append(myDB.ErrMsg);
                                    }
                                }
                            }
                        }
                    }
                }

                return(sB.ToString().Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()));
            }
            catch (Exception ex)
            {
                return((ex.Message + AAAK.vbCRLF + ex.StackTrace).Replace(AAAK.vbCRLF, DynControls.html_linebreak_string()));
            }
        }