private void BindDDLWarehouse() { SqlParameter[] arrParam = new SqlParameter[1]; arrParam[0] = new SqlParameter("@Action", "SELECT_ByDefault"); DSRecords = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_Godown_CRUD", arrParam); DTRecords = DSRecords.Tables[0]; DDLGodown.DataSource = DTRecords; DDLGodown.DataTextField = "Name"; DDLGodown.DataValueField = "ID"; DDLGodown.DataBind(); DDLGodown.Items.Insert(0, new ListItem("SELECT", "0")); }
protected void DDLRecItemEntry_SelectedIndexChanged(object sender, EventArgs e) { try { TBBarcode.Enabled = true; DDLItemName.Enabled = true; TBSearchCode.Enabled = true; LBAddAllItem.Enabled = true; string ss = "SELECT Supplier FROM Receive_Master WHERE ID='" + DDLRecItemEntry.SelectedValue + "'"; DataSet ds = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss); if (ds.Tables[0].Rows.Count > 0) { DDLSupplier.ClearSelection(); DDLSupplier.Items.FindByValue(ds.Tables[0].Rows[0][0].ToString()).Selected = true; } string ss2 = "SELECT ID FROM Godown WHERE NGOID='" + DDLBusinessLocation.SelectedValue + "' AND ComID='" + Session["ComID"] + "'"; DataSet ds2 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss2); if (ds2.Tables[0].Rows.Count > 0) { DDLGodown.ClearSelection(); DDLGodown.Items.FindByValue(ds2.Tables[0].Rows[0][0].ToString()).Selected = true; } string ss3 = "SELECT dbo.RawMaterial.ID,dbo.RawMaterial.Name FROM dbo.Receive_details INNER JOIN dbo.RawMaterial ON dbo.Receive_details.ItemID = dbo.RawMaterial.ID WHERE (dbo.Receive_details.rec_Id = '" + DDLRecItemEntry.SelectedValue + "')"; DataSet ds3 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss3); if (ds3.Tables[0].Rows.Count > 0) { DDLItemName.Items.Clear(); DDLItemName.DataSource = ds3.Tables[0]; DDLItemName.DataTextField = "Name"; DDLItemName.DataValueField = "ID"; DDLItemName.DataBind(); DDLItemName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Select-", "0")); } } catch (Exception ex) { ShowMessage(ex.Message, MessageType.Error); } }
private void bindGodown() { try { SqlParameter[] arrParam = new SqlParameter[1]; arrParam[0] = new SqlParameter("@Action", "SELECT_ByDefault"); DSRecords = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_Godown_CRUD", arrParam); if (DSRecords.Tables[0].Rows.Count > 0) { DDLGodown.DataSource = DSRecords.Tables[0]; DDLGodown.DataTextField = "Name"; DDLGodown.DataValueField = "ID"; DDLGodown.DataBind(); DDLGodown.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Select-", "0")); } } catch (Exception ex) { ShowMessage(ex.Message, MessageType.Error); } }
private void BindDDLGodown(string ComID) { try { SqlParameter[] arrparm = new SqlParameter[2]; arrparm[0] = new SqlParameter("@Action", "SELECT_ByComID"); arrparm[1] = new SqlParameter("@ComID", ComID); DataSet DSRecord = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_Godown_CRUD", arrparm); if (DSRecord.Tables[0].Rows.Count > 0) { DDLGodown.DataSource = DSRecord.Tables[0]; DDLGodown.DataTextField = "Name"; DDLGodown.DataValueField = "ID"; DDLGodown.DataBind(); DDLGodown.Items.Insert(0, new ListItem("Select", "0")); } } catch (Exception ex) { ShowMessage(ex.Message, MessageType.Error); } }
protected void CBAllowRIENumber_CheckedChanged(object sender, EventArgs e) { try { if (CBAllowRIENumber.Checked) { DDLRecItemEntry.ClearSelection(); DDLRecItemEntry.Dispose(); DDLRecItemEntry.Enabled = false; DDLGodown.ClearSelection(); DDLGodown.Enabled = true; DDLSupplier.ClearSelection(); DDLSupplier.Enabled = true; LBAddAllItem.Enabled = false; TBBarcode.Enabled = false; DDLItemName.Items.Clear(); DDLItemName.Enabled = false; TBSearchCode.Enabled = false; } else { DDLRecItemEntry.Enabled = true; DDLGodown.ClearSelection(); DDLGodown.Enabled = false; DDLSupplier.ClearSelection(); DDLSupplier.Enabled = false; LBAddAllItem.Enabled = false; TBBarcode.Enabled = false; DDLItemName.Items.Clear(); DDLItemName.Enabled = false; TBSearchCode.Enabled = false; } } catch (Exception ex) { ShowMessage(ex.Message, MessageType.Error); } }