Exemplo n.º 1
0
 protected void ClearGrids()
 {
     DateGridView.DataBind();
     QuoteGridView.DataBind();
     FilterShowingLabel.Text = "";
     HeaderUpdatePanel.Update();
     DetailGridView.DataBind();
     QuoteDetailUpdatePanel.Update();
     //UpdateButton.Visible = false;
     //UpdateUpdatePanel.Update();
 }
Exemplo n.º 2
0
 protected void GetCustQuotes(string CustNo)
 {
     ClearGrids();
     ds = ecommQuotes.GetCustSummary(CustNo);
     if (ds.Tables.Count == 1)
     {
         // Fill the date grid, then the quotes for the first date
         dt = ds.Tables[0];
         if (dt.Rows.Count > 0)
         {
             DateGridView.DataSource = dt;
             DateGridView.DataBind();
             ShowQuotesSummary(CustNo, dt.Rows[0]["QuoteDate"]);
         }
         else
         {
             ShowPageMessage("No Quotes on file for Customer " + CustNo, 2);
         }
     }
     else
     {
         ShowPageMessage("Quote access problem (GetSummary). " + CustNo, 2);
     }
 }
Exemplo n.º 3
0
 protected void GetQuotes(string CustNo, string FilterField, string FilterValue, string GridToFill)
 {
     try
     {
         // get the quote data.
         string FreshQOH = "0";
         if (GridToFill == "Detail")
         {
             FreshQOH = "1";
         }
         ds = SqlHelper.ExecuteDataset(connectionString, "pSOEGetQuotes",
                                       new SqlParameter("@Organization", CustNo),
                                       new SqlParameter("@QuoteFilterField", FilterField),
                                       new SqlParameter("@QuoteFilterValue", FilterValue),
                                       new SqlParameter("@FreshQOH", FreshQOH));
         if (ds.Tables.Count >= 1)
         {
             dt = ds.Tables[1];
             if (dt.Rows.Count == 0)
             {
                 DateGridView.DataBind();
                 DetailGridView.DataBind();
                 QuoteGridView.DataBind();
                 FilterShowingLabel.Text = "";
             }
             else
             {
                 if (GridToFill == "Header")
                 {
                     DataTable dtDates = new DataTable();
                     dtDates.Columns.Add("QuoteDate", typeof(DateTime));
                     dtDates.Columns.Add("QuoteCount", typeof(int));
                     int     DateCtr   = 0;
                     string  Lastdate  = "";
                     string  Newdate   = "";
                     string  LastQuote = "";
                     string  NewQuote  = "";
                     DataRow daterow;
                     CustNameLabel.Text     = dt.Rows[0]["CustomerName"].ToString();
                     Session["MasterTable"] = dt;
                     Lastdate  = string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["QuotationDate"]);
                     DateToGet = string.Format("{0:MM/dd/yyyy}", dt.Rows[0]["QuotationDate"]);
                     foreach (DataRow drow in dt.Rows)
                     {
                         Newdate  = string.Format("{0:yyyy-MM-dd}", drow["QuotationDate"]);
                         NewQuote = drow["SessionID"].ToString();
                         if (Newdate != Lastdate)
                         {
                             daterow = dtDates.NewRow();
                             daterow["QuoteDate"]  = Lastdate;
                             daterow["QuoteCount"] = DateCtr;
                             dtDates.Rows.Add(daterow);
                             Lastdate = Newdate;
                             DateCtr  = 0;
                         }
                         if (NewQuote != LastQuote)
                         {
                             DateCtr++;
                             LastQuote = NewQuote;
                         }
                     }
                     daterow = dtDates.NewRow();
                     daterow["QuoteDate"]  = Newdate;
                     daterow["QuoteCount"] = DateCtr;
                     dtDates.Rows.Add(daterow);
                     DateGridView.DataSource = dtDates;
                     DateGridView.DataBind();
                     FillGridView(dt);
                     DetailGridView.DataBind();
                 }
                 if (GridToFill == "Detail")
                 {
                     DetailGridView.DataSource = dt;
                     DetailGridView.DataBind();
                 }
                 //QuoteUpdatePanel.Update();
                 //DataView dv = new DataView(dt, "SubItem = '" + ItemNo + "'", "", DataViewRowState.CurrentRows);
                 //AltAvailLabel.Text = String.Format("{0:#,##0}", dv[0]["AltQOH"]);
             }
         }
     }
     catch (Exception e2)
     {
         ErrorLabel.Text = e2.Message + ", " + e2.ToString();
     }
 }