Example #1
0
 protected void QuoteSummCommand(Object sender, GridViewCommandEventArgs e)
 {
     // show all lines for the day in the detail grid
     if (e.CommandName == "ShowDetail")
     {
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = QuoteGridView.Rows[index];
         ShowQuotesDetail(CustNoTextBox.Text.ToString(), Server.HtmlDecode(row.Cells[0].Text).ToString(), null);
         ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.GetType(), "Find", "SetHeight();", true);
     }
 }
Example #2
0
 protected void ShowQuotesDetail(string CustNo, string QuoteNo, object QuoteDate)
 {
     if (QuoteNo == null)
     {
         ds = ecommQuotes.GetDateDetail(CustNo, string.Format("{0:MM/dd/yyyy}", QuoteDate));
         CurShowQuote.Value = "";
     }
     else
     {
         ds = ecommQuotes.GetQuoteDetail(CustNo, QuoteNo);
         CurShowQuote.Value = QuoteNo;
     }
     RefreshDetailGrid(ds.Tables[0]);
     ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.GetType(), "Find", "SetHeight();", true);
 }
Example #3
0
 protected void QuoteDaysCommand(Object sender, GridViewCommandEventArgs e)
 {
     ClearPageMessages();
     // get the day they asked for
     if (e.CommandName == "ShowDay")
     {
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = DateGridView.Rows[index];
         ShowQuotesSummary(CustNoTextBox.Text.ToString(), Server.HtmlDecode(row.Cells[0].Text));
         CurShowDate.Value = Server.HtmlDecode(row.Cells[0].Text);
         ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.GetType(), "Find", "SetHeight();", true);
     }
     // show all lines for the day in the detail grid
     if (e.CommandName == "ShowLines")
     {
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = DateGridView.Rows[index];
         ShowQuotesDetail(CustNoTextBox.Text.ToString(), null, Server.HtmlDecode(row.Cells[0].Text));
     }
 }
Example #4
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);
        }
    }
Example #5
0
 public void DetailRefresh_Click(object sender, EventArgs e)
 {
     RefreshDetailGrid((DataTable)Session[DetailTableName.Value]);
     ScriptManager.RegisterClientScriptBlock(CustNoTextBox, CustNoTextBox.GetType(), "Find", "SetHeight();", true);
 }