//private void loadModels() //{ // //string sDataSource = Server.MapPath(ConfigurationSettings.AppSettings["DataSource"].ToString()); // BusinessLogic bl = new BusinessLogic(); // DataSet ds = new DataSet(); // ds = bl.ListAllModels(); // cmbProdAdd.DataTextField = "Model"; // cmbProdAdd.DataValueField = "Model"; // cmbProdAdd.DataSource = ds; // cmbProdAdd.DataBind(); //} private void BindGrid() { CreditLimitTotal = 0; OpenBalanceDRTotal = 0; DataSet ds = new DataSet(); string connStr = string.Empty; if (Request.Cookies["Company"] != null) { connStr = System.Configuration.ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } else { Response.Redirect("~/Login.aspx"); } BusinessLogic bl = new BusinessLogic(); DataSet dsSales = bl.ListProductHistory(connStr.Trim(), ""); if (dsSales != null) { if (dsSales.Tables[0].Rows.Count > 0) { GridCust.DataSource = dsSales; GridCust.DataBind(); } } }
private void BindGrid() { CreditLimitTotal = 0; OpenBalanceDRTotal = 0; DataSet ds = new DataSet(); string connection = string.Empty; if (Request.Cookies["Company"] != null) { connection = Request.Cookies["Company"].Value; } else { Response.Redirect("Login.aspx"); } ds = objBL.ListProducts(connection, "", ""); if (ds.Tables[0].Rows.Count > 0) { GridCust.DataSource = ds; GridCust.DataBind(); } }
private void BindGrid() { CreditLimitTotal = 0; OpenBalanceDRTotal = 0; DataSet ds = new DataSet(); string txtsearch = txtSearch.Text; string dropdown = ddCriteria.SelectedValue; ds = objBL.getCustomers(txtsearch, dropdown); if (ds.Tables[0].Rows.Count > 0) { GridCust.DataSource = ds; GridCust.DataBind(); var lblCredits = GridCust.FooterRow.FindControl("lblCredit") as Label; if (lblCredits != null) { lblCredits.Text = CreditLimitTotal.ToString(); } var lblBalance = GridCust.FooterRow.FindControl("lblOpenBal") as Label; if (lblBalance != null) { lblBalance.Text = OpenBalanceDRTotal.ToString(); } } }