private void ShowDetails() { CreamBell_DMS_WebApps.App_Code.Global obj = new App_Code.Global(); string query = "ACX_USP_OpenSaleOrder"; List <string> ilist = new List <string>(); List <string> item = new List <string>(); DataTable dt = new DataTable(); ilist.Add("@Site_Code"); item.Add(Session["SiteCode"].ToString()); ilist.Add("@DATAAREAID"); item.Add(Session["DATAAREAID"].ToString()); ilist.Add("@StartDate"); item.Add(txtFromDate.Text); ilist.Add("@EndDate"); item.Add(txtToDate.Text); dt = obj.GetData_New(query, CommandType.StoredProcedure, ilist, item); if (dt.Rows.Count > 0) { gvDetails.DataSource = dt; gvDetails.DataBind(); LblMessage.Text = "Total Records : " + dt.Rows.Count.ToString(); Session["OpenSO"] = dt; } else { gvDetails.DataSource = dt; gvDetails.DataBind(); LblMessage.Text = string.Empty; } }
private void ShowCurrentStock() { if (lstState.SelectedValue == string.Empty) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Validation", "alert('Please select atleast one state before show!');", true); return; } else if (lstSiteId.SelectedValue == string.Empty) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Validation", "alert('Please select atleast one distributor before show!');", true); return; } else if (ddlWarehouse.SelectedValue == string.Empty) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Validation", "alert('Please select atleast one Warehouse before show!');", true); return; } CreamBell_DMS_WebApps.App_Code.Global obj = new App_Code.Global(); DataTable dt = new DataTable(); List <string> ilist = new List <string>(); List <string> item = new List <string>(); string WareHouse; WareHouse = ""; string siteid = ""; foreach (System.Web.UI.WebControls.ListItem litem in ddlWarehouse.Items) { if (litem.Selected) { if (WareHouse.Length == 0) { WareHouse = litem.Value.ToString(); } else { WareHouse += "," + litem.Value.ToString(); } } } foreach (System.Web.UI.WebControls.ListItem litem in lstSiteId.Items) { if (litem.Selected) { if (siteid.Length == 0) { siteid = litem.Value.ToString(); } else { siteid += "," + litem.Value.ToString(); } } } string query = "ACX_CurrentStock"; ilist.Add("@Site_Code"); item.Add(siteid.ToString()); ilist.Add("@TransLocation"); item.Add(WareHouse);//item.Add("59144MW");// ilist.Add("@Dataareaid"); item.Add(Session["DATAAREAID"].ToString()); if (ddlBuunit.SelectedIndex >= 1) { ilist.Add("@BUCODE"); item.Add(ddlBuunit.SelectedValue.ToString()); } else { ilist.Add("@BUCODE"); item.Add(""); } dt = obj.GetData_New(query, CommandType.StoredProcedure, ilist, item); if (dt.Rows.Count > 0) { //object sumLtr,SumQty,SumQtyLtr; //sumLtr = dt.Compute("Sum(LTR)", ""); //SumQty = dt.Compute("Sum(Qty)", ""); //SumQtyLtr = dt.Compute("Sum(QTYLtr)", ""); //dt.Rows.Add("TOTAL", "", "", "0", sumLtr, "0", SumQty, SumQtyLtr, "0", "", "", ""); gridCurrentStcok.DataSource = dt; gridCurrentStcok.DataBind(); LblMessage.Text = "Total Records : " + dt.Rows.Count.ToString(); Session["CurrentStock"] = dt; } else { gridCurrentStcok.DataSource = dt; gridCurrentStcok.DataBind(); LblMessage.Text = string.Empty; } }