private void BindOpenGrid() { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); DataSet ds = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); string sDate = string.Empty; sDate = txtDate.Text.Trim(); ds = bl.GetStockOpeningItems(sDate); EditableGrid.DataSource = ds; EditableGrid.DataBind(); }
private void BindGrid() { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); DataSet ds = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); string sDate = string.Empty; sDate = txtDate.Text.Trim(); string Branch = drpBranchAdd.SelectedValue; ds = bl.GetStockItem(sDate, Branch); if (ds == null || ds.Tables[0].Rows.Count == 0) { err.Visible = true; err.Text = "No Physical Stock stored for the Date"; } else { err.Visible = false; var checkIfExists = bl.GetClosingStock(txtDate.Text, Branch); if (checkIfExists == null || (checkIfExists != null && checkIfExists.Tables[0].Rows.Count == 0)) { err.Visible = true; err.Text = "No Physical Stock stored for the Date"; } else { err.Visible = true; err.Text = "Physical stock values are stored for the Date"; } } EditableGrid.DataSource = ds; EditableGrid.DataBind(); }
// Refresh the UI private void UpdateDataView() { grid.DataSource = GetData(); grid.DataBind(); }