Ejemplo n.º 1
0
 protected void ClearItemData(bool NewItem)
 {
     // if NewItem is true, we are clearing after an item is entered
     SSGridView.DataBind();
     DetailUpdatePanel.Update();
     ItemDescLabel.Text  = "";
     Wgt100Label.Text    = "";
     QtyUOMLabel.Text    = "";
     StdCostLabel.Text   = "";
     UPCLabel.Text       = "";
     WebLabel.Text       = "";
     CategoryLabel.Text  = "";
     NetWghtLabel.Text   = "";
     SuperEqLabel.Text   = "";
     ListLabel.Text      = "";
     HarmCodeLabel.Text  = "";
     PackGroupLabel.Text = "";
     PlatingLabel.Text   = "";
     GrossWghtLabel.Text = "";
     PriceUMLabel.Text   = "";
     CFVLabel.Text       = "";
     PPILabel.Text       = "";
     ParentLabel.Text    = "";
     StockLabel.Text     = "";
     CostUMLabel.Text    = "";
     CatVelLabel.Text    = "";
     PkgVelLabel.Text    = "";
     CreatedLabel.Text   = "";
     HeaderUpdatePanel.Update();
     CategorySpecLabel.Text = "";
     MessageUpdatePanel.Update();
     HeadImageUpdatePanel.Visible = false;
     BodyImageUpdatePanel.Visible = false;
 }
Ejemplo n.º 2
0
 protected void ClearGrids()
 {
     DateGridView.DataBind();
     QuoteGridView.DataBind();
     FilterShowingLabel.Text = "";
     HeaderUpdatePanel.Update();
     DetailGridView.DataBind();
     QuoteDetailUpdatePanel.Update();
     //UpdateButton.Visible = false;
     //UpdateUpdatePanel.Update();
 }
Ejemplo n.º 3
0
    /// <summary>
    /// Function to load the customer details
    /// </summary>
    public void WorkCustomerNumber(object sender, EventArgs e)
    {
        try
        {
            ClearPageMessages();
            string strCustNo = CustNoTextBox.Text;
            int    strCnt    = 0;
            //if ((strCustNo != "") && (strCustNo.Contains("%") == true))
            //{
            //    //strCustNo.Replace("'", "''");
            //    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(CustNoTextBox, CustNoTextBox.GetType(), "Customer", "LoadCustomerLookup('" + Server.UrlEncode(PFC.SOE.Securitylayer.Cryptor.Encrypt(strCustNo)) + "');", true);
            //    else
            //        ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.GetType(), "Customer", "alert('Maximum row exceeds for this search.please enter additional data.');", true);
            //}
            bool textIsNumeric = true;
            try
            {
                int.Parse(strCustNo);
            }
            catch
            {
                textIsNumeric = false;
            }

            if ((strCustNo != "") && !textIsNumeric)
            {
                ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.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(strCustNo);
                    if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count != 0)
                    {
                        if (dsCustomer.Tables[0].Columns.Contains("ErrorMessage"))
                        {
                            ScriptManager.RegisterClientScriptBlock(CustNoTextBox, typeof(TextBox), "invalid", "alert('" + dsCustomer.Tables[0].Rows[0]["ErrorMessage"].ToString() + "');", true);
                            ECommQuoteRecallScriptManager.SetFocus("CustNoTextBox");
                            return;
                        }
                        else
                        {
                            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")
                                {
                                    ScriptManager.RegisterClientScriptBlock(CustNoTextBox, typeof(TextBox), "invalid", "alert('" + creditStatus + "');", true);
                                    ECommQuoteRecallScriptManager.SetFocus("CustNoTextBox");
                                    return;
                                }
                            }
                            else
                            {
                                //ISBillToCustomer = true;
                                ScriptManager.RegisterClientScriptBlock(CustNoTextBox, typeof(TextBox), "invalid", "alert('Bill To Only Customer could not process order');document.getElementById('" + CustNoTextBox.ClientID + "').value='';document.getElementById('" + CustNoTextBox.ClientID + "').focus();document.getElementById('" + CustNoTextBox.ClientID + "').select();", true);
                                ECommQuoteRecallScriptManager.SetFocus("CustNoTextBox");
                                return;
                            }
                            Session[HeaderTableName.Value] = null;
                            CustNameLabel.Text             = dsCustomer.Tables[2].Rows[0]["Name"].ToString();
                            HeaderUpdatePanel.Update();
                            GetCustQuotes(CustNoTextBox.Text);
                        }
                    }
                    else
                    {
                        //hidCust.Value = "";
                        ScriptManager.RegisterClientScriptBlock(CustNoTextBox, typeof(TextBox), "invalid", "alert('Invalid Customer value (1)');document.getElementById('" + CustNoTextBox.ClientID + "').value='';document.getElementById('" + CustNoTextBox.ClientID + "').focus();document.getElementById('" + CustNoTextBox.ClientID + "').select();", true);
                    }
                    #endregion
                }
                else
                {
                    //ClearLabels();
                }
            }
        }
        catch (Exception e2)
        {
            ShowPageMessage("WorkCustomerNumber Error " + e2.ToString(), 2);
        }
    }
Ejemplo n.º 4
0
 protected void GetDocument(string InvoiceNo, string SONo)
 {
     try
     {
         OrderIDHidden.Value          = "";
         Session["CreditDetailTable"] = null;
         ClearPageMessages();
         // get the data.
         ds = SqlHelper.ExecuteDataset(connectionString, "pSOEGetCreditRGA",
                                       new SqlParameter("@PassedInvoice", InvoiceNo),
                                       new SqlParameter("@PassedOrder", SONo));
         if (ds.Tables.Count >= 1)
         {
             if (ds.Tables.Count == 1)
             {
                 // We only go one table back, something is wrong
                 dt = ds.Tables[0];
                 if (dt.Rows[0]["ErrorType"].ToString().Trim() + dt.Rows[0]["ErrorCode"].ToString() == "E0081")
                 {
                     ShowPageMessage("Document is on file but is the wrong type", 2);
                     CreditRGAScriptManager.SetFocus("InvoiceNoTextBox");
                     return;
                 }
                 if (dt.Rows[0]["ErrorType"].ToString().Trim() + dt.Rows[0]["ErrorCode"].ToString() == "E0001")
                 {
                     ShowPageMessage("Document not found. " + InvoiceNo + "," + SONo, 2);
                     CreditRGAScriptManager.SetFocus("InvoiceNoTextBox");
                     return;
                 }
                 if (dt.Rows.Count > 0)
                 {
                     ShowPageMessage("GetCreditRGA processing error. " + InvoiceNo + "," + SONo, 2);
                     return;
                 }
             }
             else
             {
                 dt = ds.Tables[1];
                 if (dt.Rows.Count == 0)
                 {
                     HeaderGridView.DataBind();
                     HeaderUpdatePanel.Update();
                     DetailGridView.DataBind();
                     DetailUpdatePanel.Update();
                     ShowPageMessage("Invoice/Order not found.", 2);
                     CreditRGAScriptManager.SetFocus("InvoiceNoTextBox");
                 }
                 else
                 {
                     DetailGridView.DataSource = dt;
                     DetailGridView.DataBind();
                     Session["CreditDetailTable"] = dt;
                     OrderIDHidden.Value          = ds.Tables[2].Rows[0]["FoundID"].ToString().Trim();
                     ShipLocHidden.Value          = ds.Tables[2].Rows[0]["ShipLoc"].ToString().Trim();
                     try
                     {
                         RGAReturnToDropDown.SelectedValue = ShipLocHidden.Value.ToString();
                     }
                     catch
                     {
                     }
                     ShowMakeButton();
                     DetailUpdatePanel.Update();
                     dt = ds.Tables[2];
                     HeaderGridView.DataSource = dt;
                     HeaderGridView.DataBind();
                     HeaderUpdatePanel.Update();
                 }
             }
         }
         ScriptManager.RegisterClientScriptBlock(InvoiceNoTextBox, InvoiceNoTextBox.GetType(), "SizeUpdate", "SetHeight();", true);
     }
     catch (Exception e2)
     {
         ShowPageMessage("GetCreditRGA Error " + e2.Message + ", " + e2.ToString(), 2);
     }
 }