protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OrderIDHidden.Value = ""; Session["CreditDetailTable"] = null; NameValueCollection coll = Request.QueryString; if (coll["InvoiceNo"] != null) { //get invoice //http://10.1.36.34/SOE/packingandplating.aspx?ItemNumber=00200-2400-021&ShipLoc=10&RequestedQty=5&AltQty=50&AvailableQty=33 InvoiceNoTextBox.Text = coll["InvoiceNo"].ToString(); GetDocument(coll["InvoiceNo"].ToString(), ""); } else { CreditRGAScriptManager.SetFocus("InvoiceNoTextBox"); } // Call the function to fill the search bar BindOrderTypes(); BindReasons(); RGAReturnToDropDown.DataSource = custDet.GetLocationDetails(); RGAReturnToDropDown.DataBind(); MakeCreditButt.Visible = false; MakeRGAButt.Visible = false; RGAReturnToLabel.Visible = false; RGAReturnToDropDown.Visible = false; } else { } }
/// <summary> /// Function to load the customer details /// </summary> public void LoadCustomerDetails() { txtCustNo.Text = hidCust.Value.Trim(); #region Code to fill the customer details in the controls // Call the webservice to get the customer address detail DataSet dsCustomer = service.GetCustomerDetails(txtCustNo.Text.Trim().Replace("'", "")); DataSet dsShipTo = service.GetShipToDetails(txtCustNo.Text); // Function to clear the value in the label ClearLabels(); if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count != 0) { Session["CustNo"] = hidCust.Value.Trim(); Session["CustomerDetail"] = dsCustomer.Tables[0]; FillCustomerAddress(dsCustomer.Tables[0]); // Code to bind the location details DataSet dsLocation = custDet.GetLocationDetails(); } else { hidCust.Value = txtCustNo.Text = ""; Session["CustNo"] = null; Session["CustomerDetail"] = null; Session["ShipDetails"] = null; return; } if (dsShipTo != null && dsShipTo.Tables[0].Rows.Count != 0) { Session["ShipDetails"] = dsShipTo.Tables[0]; // Call the function to fill the ship to details FillShipTo(dsShipTo.Tables[0]); } #endregion }
/// <summary>ear /// Function to load the customer details /// </summary> public void LoadCustomerDetails() { string strCustNo = custNumber = txtCustNo.Text; int strCnt = 0; if ((strCustNo != "") && (strCustNo.Contains("%") == true)) { if (isNumeric(strCustNo.Remove(strCustNo.Length - 1, 1), System.Globalization.NumberStyles.Integer) == false) { strCnt = Convert.ToInt32(cntCustName(strCustNo)); } else { strCnt = Convert.ToInt32(cntCustNo(strCustNo)); } int maxRowCount = custDet.GetSQLWarningRowCount(); if (strCnt < maxRowCount) { ScriptManager.RegisterClientScriptBlock(txtCustNo, txtCustNo.GetType(), "Customer", "LoadCustomerLookup('" + Server.UrlEncode(PFC.SOE.Securitylayer.Cryptor.Encrypt(strCustNo)) + "');", true); } else { ScriptManager.RegisterClientScriptBlock(txtCustNo, txtCustNo.GetType(), "Customer", "alert('Maximum row exceeds for this search.please enter additional data.');", true); } } else { if (strCustNo != "") { #region Code to fill the customer details in the controls // Call the webservice to get the customer address detail DataSet dsCustomer = orderEntry.GetCustomerDetails(txtCustNo.Text.Trim().Replace("'", "")); // Function to clear the value in the label ClearLabels(); if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count != 0) { string creditStatus = ""; if (dsCustomer.Tables[0].Rows[0]["CustCd"].ToString() != "BT" && dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString() != "") { creditStatus = orderEntry.GetCreditReview(dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString().ToString(), dsCustomer.Tables[2].Rows[0]["CreditInd"].ToString().Trim(), "0", "Order"); if (creditStatus.ToUpper() == "OK") { hidCust.Value = txtCustNo.Text; Session["CustomerNumber"] = hidCust.Value.Trim(); Session["CustomerDetail"] = dsCustomer; CustPriceCode = dsCustomer.Tables[0].Rows[0]["Customer Price Code"].ToString().Trim(); CustomerName = dsCustomer.Tables[0].Rows[0]["Name"].ToString().Trim(); FillCustomerAddress(dsCustomer); lblCusNum.Text = hidCust.Value.Trim(); lblCustNum.Text = hidCust.Value.Trim(); lblChainValue.Text = dsCustomer.Tables[0].Rows[0]["Chain Name"].ToString().Trim(); lblBillCustNo.Text = dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString().Trim(); lblShip_Name.Text = dsCustomer.Tables[0].Rows[0]["Name"].ToString().Trim(); lblSold_Name.Text = dsCustomer.Tables[0].Rows[0]["Name"].ToString().Trim(); lblSoDate.Text = DateTime.Now.ToShortDateString(); // Code to bind the location details DataSet dsLocation = custDet.GetLocationDetails(); CreditInd = dsCustomer.Tables[2].Rows[0]["CreditInd"].ToString().Trim(); InsertHeaderDetail(); lblTermDesc.Text = termDesc; SetTermColor(); ISBillToCustomer = false; // txtSONumber.ReadOnly = true; txtCustNo.ReadOnly = true; } else { ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('" + creditStatus + "');", true); return; } } else { ISBillToCustomer = true; ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('Bill To Only Customer could not process order');document.getElementById('" + txtCustNo.ClientID + "').value='';document.getElementById('" + txtCustNo.ClientID + "').focus();document.getElementById('" + txtCustNo.ClientID + "').select();", true); } } else { hidCust.Value = ""; ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('Invalid Customer value');document.getElementById('" + txtCustNo.ClientID + "').value='';document.getElementById('" + txtCustNo.ClientID + "').focus();document.getElementById('" + txtCustNo.ClientID + "').select();", true); } #endregion } else { ClearLabels(); } } }
/// <summary>ear /// Function to load the customer details /// </summary> public void LoadCustomerDetails() { string strCustNo = custNumber = txtCustNo.Text; int strCnt = 0; bool textIsNumeric = true; try { int.Parse(strCustNo); } catch { textIsNumeric = false; } if ((strCustNo != "") && !textIsNumeric) { ScriptManager.RegisterClientScriptBlock(txtCustNo, txtCustNo.GetType(), "Customer", "LoadCustomerLookup('" + Server.UrlEncode(PFC.SOE.Securitylayer.Cryptor.Encrypt(strCustNo)) + "');", true); } else { if (strCustNo != "") { #region Code to fill the customer details in the controls // Call the webservice to get the customer address detail DataSet dsCustomer = orderEntry.GetCustomerDetails(txtCustNo.Text.Trim().Replace("'", "")); // Function to clear the value in the label ClearLabels(); if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count != 0) { string creditStatus = ""; if (dsCustomer.Tables[0].Rows[0]["CustCd"].ToString() != "BT" && dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString() != "") { creditStatus = orderEntry.GetCreditReview(dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString().ToString(), dsCustomer.Tables[2].Rows[0]["CreditInd"].ToString().Trim(), "0", "Order"); if (creditStatus.ToUpper() == "OK") { hidCust.Value = txtCustNo.Text; Session["CustomerNumber"] = hidCust.Value.Trim(); Session["CustomerDetail"] = dsCustomer; CustPriceCode = dsCustomer.Tables[0].Rows[0]["Customer Price Code"].ToString().Trim(); CustomerName = dsCustomer.Tables[0].Rows[0]["Name"].ToString().Trim(); FillCustomerAddress(dsCustomer); lblCusNum.Text = hidCust.Value.Trim(); lblCustNum.Text = hidCust.Value.Trim(); lblChainValue.Text = dsCustomer.Tables[0].Rows[0]["Chain Name"].ToString().Trim(); lblBillCustNo.Text = dsCustomer.Tables[0].Rows[0]["fBillToNo"].ToString().Trim(); lblShip_Name.Text = dsCustomer.Tables[3].Rows[0]["Name"].ToString().Trim(); lblSold_Name.Text = dsCustomer.Tables[0].Rows[0]["Name"].ToString().Trim(); lblSoDate.Text = DateTime.Now.ToShortDateString(); // Code to bind the location details DataSet dsLocation = custDet.GetLocationDetails(); CreditInd = dsCustomer.Tables[2].Rows[0]["CreditInd"].ToString().Trim(); InsertHeaderDetail(); lblTermDesc.Text = termDesc; string script = "var popUp=window.open (\"CASReport.aspx?CustNo=" + Session["CustomerNumber"].ToString() + "\",\"Maximize\",'height=505,width=705,scrollbars=no,status=no,top='+((screen.height/2) - (460/2))+',left='+((screen.width/2) - (705/2))+',resizable=NO','');" + "popUp.focus();"; lblTermDesc.Attributes.Add("onclick", script); SetTermColor(); ISBillToCustomer = false; // txtSONumber.ReadOnly = true; txtCustNo.ReadOnly = true; } else { ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('" + creditStatus + "');", true); return; } } else { ISBillToCustomer = true; ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('Bill To Only Customer could not process order');document.getElementById('" + txtCustNo.ClientID + "').value='';document.getElementById('" + txtCustNo.ClientID + "').focus();document.getElementById('" + txtCustNo.ClientID + "').select();", true); } } else { hidCust.Value = ""; ScriptManager.RegisterClientScriptBlock(txtCustNo, typeof(TextBox), "invalid", "alert('Invalid Customer value');document.getElementById('" + txtCustNo.ClientID + "').value='';document.getElementById('" + txtCustNo.ClientID + "').focus();document.getElementById('" + txtCustNo.ClientID + "').select();", true); } #endregion } else { ClearLabels(); } } }