protected void Page_Load(object sender, EventArgs e) { this.Master.Reset(); this.Master.RegisterStandardScript = true; ManualInductDAO load = new ManualInductDAO(); decimal I_chute_id = Int32.Parse(Request.QueryString["chuteID"]); decimal I_itemnumber = Int32.Parse(Request.QueryString["Itemnumber"]); string I_user = Request.QueryString["user"].ToString(); string I_chute_barcode = Request.QueryString["chutebarcode"].ToString(); string I_load = Request.QueryString["load"].ToString(); decimal areaid = Convert.ToDecimal(Request.QueryString["areaid"].ToString()); //HtmlGenericControl message; //message = (HtmlGenericControl)this.Master.FindControl("message"); //if (message == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); if (!IsPostBack) { StringBuilder sb = new StringBuilder(); sb.Append("Put to Chute: " + I_chute_id + "<br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); //sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>0: Exit</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: Cancel</td>"); //sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>9: Home</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "Please Enter the Chute barcode or Press: 0: Exit, 1: Cancel, 9: Home"; } if (IsPostBack) { //HtmlGenericControl PopupMessage; //PopupMessage = (HtmlGenericControl)this.Master.FindControl("PopupMessage"); //if (PopupMessage == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //Panel panel; //panel = (Panel)this.Master.FindControl("Panel1"); //if (panel == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); try { //TextBox barcode = (TextBox)this.Master.FindControl("barcode"); //if (barcode == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); if (this.Master.BarcodeValue == "1") { // you have entered cancel decimal I_req_id = 0; decimal manual_induct_req_id = load.cancel_lock(I_req_id, I_chute_id, I_itemnumber, I_user); if (manual_induct_req_id != 0) { //message.InnerText = "Cancel Request for Put to Chute Completed"; this.Master.MessageBoard = "Cancel Request for Put to Chute Completed"; this.Master.BarcodeValue = string.Empty; //Response.Redirect("ManualInductLoad.aspx"); } else { //PopupMessage.InnerText = "Error occurred while processing Put to Chute"; this.Master.ErrorMessage = "Error occurred while processing Put to Chute"; this.Master.DisplayMessage = true; //panel.Style.Add("display", "block"); } } else { // user scanned chute string I_scanned_barcode = this.Master.BarcodeValue; //barcode.Text; if (I_scanned_barcode == string.Empty || I_scanned_barcode == null) { this.Master.BarcodeValue = string.Empty; this.Master.ErrorMessage = "Invalid Chute Barcode. Try again"; this.Master.DisplayMessage = true; //panel.Style.Add("display", "block"); } else { // set the return value as 0 initially and if there is an error in stored proc then that will be returned else it will be success // changed this param to in out because there is no handling in datamanager.cs at the moment decimal I_return_val = 0; decimal put_to_chute_return_cd = load.put_to_chute(I_return_val, I_chute_id, I_chute_barcode, I_scanned_barcode, I_itemnumber, I_user); if (put_to_chute_return_cd == 0) { // success //message.InnerText = "Put to Chute is successfully completed"; this.Master.MessageBoard = "Put to Chute is successfully completed"; this.Master.BarcodeValue = string.Empty; //Response.Redirect("ManualInductLoad.aspx"); Response.Redirect("ManualInductSku.aspx?LoadID=" + I_load + "&userlogon=" + I_user + "&message=" + "T1" + "&areaid=" + areaid.ToString()); } else if (put_to_chute_return_cd == 2) { // time out //PopupMessage.InnerText = "Put to Chute is Time OUT"; this.Master.BarcodeValue = string.Empty; this.Master.ErrorMessage = "Put to Chute is Time OUT"; this.Master.DisplayMessage = true; //panel.Style.Add("display", "block"); // return to home page of manual induct //Response.Redirect("ManualInductLoad.aspx"); Response.Redirect("ManualInductSku.aspx?LoadID=" + I_load + "&userlogon=" + I_user + "&message=" + "T2" + "&areaid=" + areaid.ToString()); } else if (put_to_chute_return_cd == 1) { // redirect to same page to rescan chute barcode //PopupMessage.InnerText = "Invalid Chute Barcode. Try again"; this.Master.BarcodeValue = string.Empty; this.Master.ErrorMessage = "Invalid Chute Barcode. Try again"; this.Master.DisplayMessage = true; //panel.Style.Add("display", "block"); this.Master.BarcodeValue = string.Empty; //Response.Redirect("ManualInductLoad.aspx"); } } } } catch (Exception ex) { this.Master.ErrorMessage = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0))); this.Master.DisplayMessage = true; this.Master.BarcodeValue = string.Empty; /* * string errormsg = ex.Message.ToString(); * char[] separator = new char[] { ':' }; * string[] testarr = errormsg.Split(separator); * * decimal arraylength = testarr.Length; * * if (arraylength > 6) * { * //PopupMessage.InnerText = testarr[5].ToString(); * this.Master.ErrorMessage = testarr[5].ToString(); * this.Master.DisplayMessage = true; * } * else * { * //PopupMessage.InnerText = errormsg; * this.Master.ErrorMessage = errormsg; * this.Master.DisplayMessage = true; * } */ //panel.Style.Add("display", "block"); //Response.Redirect("ManualInductLoad.aspx"); } } // javascript to handle 0 and 9 //StringBuilder script = new StringBuilder(); //script.Append("function checkAndPost(){\n"); //script.Append("\t var barcode = document.getElementById('" + this.Master.BarcodeID + "');\n"); //script.Append("\t if (document.activeElement.id == barcode.id) {\n"); //script.Append("\t if (barcode.value == 1 ) {\n"); //script.Append("\t \t document.getElementById('" + this.Master.FormID + "').submit();\n"); //script.Append("\t \t return false;\n}\n\t"); //script.Append("\t \t if (barcode.value == " + // (int)HandheldInput.Home + " ){\n alert('Inside ' + barcode.value);"); //script.Append("\t \t \t document.getElementById('" + // this.Master.ParentID + "').value = '" + // (int)HandheldInput.Root + "';\n"); //script.Append("\t \t \t window.navigate('home.aspx');\n"); //script.Append("\t \t \t return false;\n"); //script.Append("\t \t } \n"); //script.Append("\t \t if (barcode.value == " + // (int)HandheldInput.SignOut + " && barcode.value.length > 0){\n"); //script.Append("\t \t \t window.navigate('home.aspx?Signout=1');\n"); //script.Append("\t \t \t return false;\n"); //script.Append("\t \t } \n"); //script.Append("\t \t \t document.getElementById('" + // this.Master.ParentID + "').value = barcode.value;\n"); //script.Append("\t \t \t document.getElementById('" + // this.Master.FormID + "').submit();\n"); //script.Append("\t } \n");//end if for activeElement //script.Append("} \n \n");//function end //ClientScript.RegisterClientScriptBlock(this.GetType(), // "PostBack", // script.ToString(), // true); }
protected void Page_Load(object sender, EventArgs e) { this.Master.Reset(); decimal areaid = decimal.Parse(Request.QueryString["areaid"]); string user_logon = User.Identity.Name; //when page load happens, call the oracle fn to get the load ids // load the following in the message pannel // 1. All, 2. lowest Loadid, 3. lowest - 1 load id 4. More // when more is pressed load 1. All, 2. lowest-2 Loadid, 3. lowest-3 load id 4. More ManualInductDAO load = new ManualInductDAO(); DataSet loadlist = load.Get_loadid(areaid); List <string> loadidlist = new List <string>(); DataTable loadtab = new DataTable(); loadtab = loadlist.Tables[0]; foreach (DataRow row in loadtab.Rows) { loadidlist.Add(row["load_id"].ToString()); } // counter for actual number of load ids in the arraylist Int32 arraylistcnt = loadidlist.Count(); //HtmlGenericControl message; //message = (HtmlGenericControl)this.Master.FindControl("message"); //if (message == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //HtmlGenericControl PopupMessage; //PopupMessage = (HtmlGenericControl)this.Master.FindControl("PopupMessage"); //if (PopupMessage == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); try { if (!IsPostBack) { //this.Master.MenuParentId = 1; load_cnt = 0; if (arraylistcnt != 0 && (load_cnt + 1) <= arraylistcnt - 1) { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>2: " + loadidlist[load_cnt] + "</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>3: " + loadidlist[load_cnt + 1] + "</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>4: More</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); } else if (arraylistcnt != 0 && (load_cnt + 1) > arraylistcnt - 1) { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>2: " + loadidlist[load_cnt] + "</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "Please Enter Load ID. Press the appropriate Key:\n" + "1: All, 2: " + loadidlist[load_cnt] + ", 4: More"; } else { //PopupMessage.InnerText = "No load Released for Manual Induction. Please try again Later"; this.Master.ErrorMessage = "No load Released for Manual Induction. Please try again Later"; this.Master.DisplayMessage = true; } //sb.Append() //HttpContext.Current.Items["MyKey"] = "Key1"; } if (IsPostBack) { //TextBox barcode = (TextBox)this.Master.FindControl("barcode"); //if (barcode == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); // user entered 1 if (this.Master.BarcodeValue == "1") { //message.InnerText = "The page was successfully posted for locating"; //this.Master.MessageBoard = "inside all"; Response.Redirect("ManualInductSku.aspx?LoadID=" + "All" + "&userlogon=" + user_logon + "&areaid=" + areaid.ToString()); } // user entered a given load id else if (this.Master.BarcodeValue == "2") { String load_status = load.validate_load(loadidlist[load_cnt]); if (load_status == "T") { Response.Redirect("ManualInductSku.aspx?LoadID=" + loadidlist[load_cnt] + "&userlogon=" + user_logon + "&areaid=" + areaid.ToString()); } } // user entered a given load id else if (this.Master.BarcodeValue == "3") { String load_status = load.validate_load(loadidlist[load_cnt + 1]); if (load_status == "T") { Response.Redirect("ManualInductSku.aspx?LoadID=" + loadidlist[load_cnt + 1] + "&userlogon=" + user_logon + "&areaid=" + areaid.ToString()); } } // user entered a 4 for more load ids else if (this.Master.BarcodeValue == "4") { load_cnt = load_cnt + 2; if (load_cnt > arraylistcnt - 1) { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>9: Home</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>0: Exit</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "No more load ids areleased for Manual Induct. Press the appropriate Key:\n" + "1: All, 9: Home, 0: Exit"; } else if ((load_cnt + 1) > arraylistcnt - 1) { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>2: " + loadidlist[load_cnt] + "</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "Please Enter Load ID. Press the appropriate Key:\n" + "1: All, 2: " + loadidlist[load_cnt]; } else if ((load_cnt + 1) == (arraylistcnt - 1)) { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>2: " + loadidlist[load_cnt] + "</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>3: " + loadidlist[load_cnt + 1] + "</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "Please Enter Load ID. Press the appropriate Key:\n" + "1: All, 2: " + loadidlist[load_cnt] + ", 3: " + loadidlist[load_cnt + 1]; } else { StringBuilder sb = new StringBuilder(); sb.Append("Please Enter Load ID. Press the appropriate Key: <br/>"); sb.Append("<div>"); sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>"); sb.Append("<tr>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>1: All</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>2: " + loadidlist[load_cnt] + "</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>3: " + loadidlist[load_cnt + 1] + "</td>"); sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>4: More</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</div>"); //message.InnerHtml = sb.ToString(); this.Master.MessageBoard = sb.ToString(); //message.InnerText = "Please Enter Load ID. Press the appropriate Key:\n" + "1: All, 2: " + loadidlist[load_cnt] + ", 3: " + loadidlist[load_cnt + 1] + ", 4: More"; } } else if (this.Master.BarcodeValue == "5" || this.Master.BarcodeValue == "6" || this.Master.BarcodeValue == "7" || this.Master.BarcodeValue == "8") { Response.Redirect("ManualInductLoad.aspx?&areaid=" + areaid.ToString()); } this.Master.BarcodeValue = string.Empty; } } catch (Exception ex) { this.Master.ErrorMessage = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0))); this.Master.DisplayMessage = true; this.Master.BarcodeValue = string.Empty; } //HtmlInputHidden hdn = (HtmlInputHidden)this.Master.FindControl("ParentMenuId"); //StringBuilder script = new StringBuilder(); //TextBox txtbox = (TextBox)this.Master.FindControl("barcode"); //if (txtbox == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //HtmlForm masterForm = (HtmlForm)this.Master.FindControl("form1"); //if (masterForm == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //script.Append("function checkAndPost(){\n"); //script.Append("\t var barcode = document.getElementById('" + txtbox.ClientID + "');\n"); //script.Append("\t if (window.event.keyCode == 13) {\n"); //script.Append("\t \t if (barcode.value == 1 || barcode.value == 2 || barcode.value == 3 || barcode.value == 4) {\n"); //script.Append("\t \t \t document.getElementById('" + masterForm.ClientID + "').submit();\n"); //script.Append("\t \t \t return false;\n}\n"); //script.Append("\t \t if (barcode.value == " + (int)HandheldInput.Home + " ){\n"); //script.Append("\t \t \t barcode.value = '';\n"); //script.Append("\t \t \t document.getElementById('" + hdn.ClientID + "').value = '" + (int)HandheldInput.Root + "';\n"); //script.Append("\t \t \t window.navigate('home.aspx');\n\t"); //script.Append("\t \t \t return false;\n}\n"); //script.Append("\t \t if (barcode.value == " + (int)HandheldInput.SignOut + " && barcode.value.length > 0){\n"); //script.Append("\t \t \t document.getElementById('" + hdn.ClientID + "').value = barcode.value;\n"); //script.Append("\t \t \t barcode.value = '';\n"); //script.Append("\t \t \t window.navigate('home.aspx');\n\t"); //script.Append("\t \t \t return false;\n}\n"); //script.Append("\t }\n"); //script.Append("}\n"); StringBuilder script = new StringBuilder(); script.Append("function checkAndPost(){\n"); script.Append("\t var barcode = document.getElementById('" + this.Master.BarcodeID + "');\n"); script.Append("\t if (document.activeElement.id == barcode.id) {\n"); script.Append("\t \t if (barcode.value == 1 || barcode.value == 2 || barcode.value == 3 || barcode.value == 4) {\n"); script.Append("\t \t \t document.getElementById('" + this.Master.FormID + "').submit();\n"); script.Append("\t \t \t return false;\n}\n"); script.Append("\t \t if (barcode.value == " + (int)HandheldInput.Home + " ){\n"); script.Append("\t \t \t barcode.value = '';\n"); script.Append("\t \t \t document.getElementById('" + this.Master.ParentID + "').value = '" + (int)HandheldInput.Root + "';\n"); script.Append("\t \t \t window.navigate('home.aspx');\n\t"); script.Append("\t \t \t return false;\n}\n"); script.Append("\t \t if (barcode.value == " + (int)HandheldInput.SignOut + " && barcode.value.length > 0){\n"); script.Append("\t \t \t document.getElementById('" + this.Master.ParentID + "').value = barcode.value;\n"); script.Append("\t \t \t barcode.value = '';\n"); script.Append("\t \t \t window.navigate('home.aspx?Signout=1');\n\t"); script.Append("\t \t \t return false;\n}\n"); script.Append("\t }\n"); script.Append("}\n"); ClientScript.RegisterClientScriptBlock(this.GetType(), "PostBack", script.ToString(), true); }
protected void Page_Load(object sender, EventArgs e) { this.Master.Reset(); this.Master.RegisterStandardScript = true; string Iuser = Request.QueryString["userlogon"].ToString(); //string Iuser = null; //receive the load id from the manualinductload page // give the message to enter the sku barcode // if the sku barcode is scanned then it autopostsback // but if they enter any other number then it needs to be handled ManualInductDAO load = new ManualInductDAO(); string I_load_id = Request.QueryString["LoadID"].ToString(); if (I_load_id == "All") { I_load_id = null; } decimal areaid = Convert.ToDecimal(Request.QueryString["areaid"].ToString()); string I_message = null; if (Request.QueryString["message"] != null) { I_message = Request.QueryString["message"].ToString(); } //string I_user; //HtmlGenericControl message; //message = (HtmlGenericControl)this.Master.FindControl("message"); //if (message == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //HtmlGenericControl PopupMessage; //PopupMessage = (HtmlGenericControl)this.Master.FindControl("PopupMessage"); //if (PopupMessage == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); if (!IsPostBack) { if (I_message == "T1") { this.Master.MessageBoard = "Put to Chute is completed successfully. Scan next SKU"; } else if (I_message == "T2") // message exists { this.Master.MessageBoard = "Put to Chute is Time OUT. Scan SKU"; } else { // on page load display this message this.Master.MessageBoard = "Scan SKU"; } //message.InnerText = "Please Enter the SKU barcode or Press: 0: Exit, 9: Home"; } if (IsPostBack) { // if the usr scans the sku barcode then validate the sku barcode and // then redirect to put to chute try { //TextBox skutxtbox = (TextBox)this.Master.FindControl("barcode"); //if (skutxtbox == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); string I_sku_barcode = this.Master.BarcodeValue; //skutxtbox.Text.ToString(); string sku_status = load.validate_sku(I_sku_barcode, I_load_id, areaid); if (sku_status == "T") { DataSet manual_induct_list = load.manual_induct(areaid, I_sku_barcode, Iuser, I_load_id); DataTable manualinducttab = new DataTable(); manualinducttab = manual_induct_list.Tables[0]; decimal I_chute_id = 0; decimal I_itemnumber = 0; string I_chute_barcode = null; foreach (DataRow row in manualinducttab.Rows) { I_chute_id = Int32.Parse(row["chute_id"].ToString()); I_itemnumber = Int32.Parse(row["itemnumber"].ToString()); I_chute_barcode = row["chute_barcode"].ToString(); } if (I_load_id == null) { I_load_id = "All"; } Response.Redirect("PutToChute.aspx?chuteID=" + I_chute_id + "&Itemnumber=" + I_itemnumber + "&user="******"&chutebarcode=" + I_chute_barcode + "&load=" + I_load_id + "&areaid=" + areaid.ToString()); } } catch (Exception ex) { this.Master.ErrorMessage = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0))); this.Master.DisplayMessage = true; this.Master.BarcodeValue = string.Empty; /* * string errormsg = ex.Message.ToString(); * char[] separator = new char[] { ':' }; * string[] testarr = errormsg.Split(separator); * * decimal arraylength = testarr.Length; * * if (arraylength > 6) * { * //PopupMessage.InnerText = testarr[5].ToString(); * this.Master.ErrorMessage = testarr[5].ToString(); * this.Master.DisplayMessage = true; * } * else * { * //PopupMessage.InnerText = errormsg; * this.Master.ErrorMessage = errormsg; * this.Master.DisplayMessage = true; * } */ //Panel panel; //panel = (Panel)this.Master.FindControl("Panel1"); //if (panel == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //panel.Style.Add("display", "block"); //Response.Redirect("ManualInductLoad.aspx"); } } // javascript to handle 0 and 9 //HtmlInputHidden hdn = (HtmlInputHidden)this.Master.FindControl("ParentMenuId"); //StringBuilder script = new StringBuilder(); //TextBox txtbox = (TextBox)this.Master.FindControl("barcode"); //if (txtbox == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //HtmlForm masterForm = (HtmlForm)this.Master.FindControl("form1"); //if (masterForm == null) // throw new Exception("Unknown error occurred. Please contact your system administrator."); //script.Append("function checkAndPost(){\n"); //script.Append("\t var barcode = document.getElementById('" + txtbox.ClientID + "');\n"); //script.Append("\t if (window.event.keyCode == 13) {\n"); //script.Append("\t if (barcode.value == 9){\n"); //script.Append("\t \t barcode.value = '';\n"); //script.Append("\t \t document.getElementById('" + hdn.ClientID + "').value = '-1';\n"); //script.Append("\t \t window.navigate('home.aspx');\n\t"); //script.Append("\t \t return false;\n}\n"); //script.Append("\t if (barcode.value == 0 && barcode.value.length > 0){\n"); //script.Append("\t \t document.getElementById('" + hdn.ClientID + "').value = barcode.value;\n"); //script.Append("\t \t barcode.value = '';\n"); //script.Append("\t \t window.navigate('home.aspx');\n\t"); //script.Append("\t \t return false;\n}\n"); //script.Append("\t }\n"); //script.Append("}\n"); //ClientScript.RegisterClientScriptBlock(this.GetType(), // "PostBack", // script.ToString(), // true); }