protected void DDLZone_SelectedIndexChanged(object sender, EventArgs e) { try { if (DDLZone.SelectedIndex > 0) { SqlParameter[] arrParam = new SqlParameter[2]; arrParam[0] = new SqlParameter("@Action", "SELECT_ByZoneID"); arrParam[1] = new SqlParameter("@ZoneID", DDLZone.SelectedValue); DSRecords = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_Bin_AreaMaster_CRUD", arrParam); DTRecords = DSRecords.Tables[0]; if (DTRecords.Rows.Count > 0) { DDLArea.DataSource = DTRecords; DDLArea.DataTextField = "AreaTitle"; DDLArea.DataValueField = "ID"; DDLArea.DataBind(); DDLArea.Items.Insert(0, new ListItem("SELECT", "0")); } } else { ShowMessage("Select Godown First!", MessageType.Error); } GenerateBinLocation(); } catch (Exception ex) { ShowMessage(ex.Message, MessageType.Error); } }
private void DdlAreaDataBind() { string company = DdlCompany.SelectedValue; DDLArea.DataSource = DBHelper.createGridView(string.Format("select area_id,area from jp_wh_area where state='1' and company_id='{0}'", company)); DDLArea.DataValueField = "area_id"; DDLArea.DataTextField = "area"; DDLArea.DataBind(); }
private void LlenarForm() { bdCon objconexion = new bdCon(); objconexion.objSqlconn.Open(); SqlCommand cmd = new SqlCommand("select Nombre,Apellidos,Telefono from Empleados where Matricula='" + MatAct + "'", objconexion.objSqlconn); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); cmd.ExecuteNonQuery(); if (dt.Rows.Count != 0) { txtNombre.Text = dt.Rows[0][0].ToString(); txtApellidos.Text = dt.Rows[0][1].ToString(); txtTel.Text = dt.Rows[0][2].ToString(); } SqlCommand cmd4 = new SqlCommand("select Contra from Usuarios where Matricula='" + MatAct + "'", objconexion.objSqlconn); SqlDataAdapter sda4 = new SqlDataAdapter(cmd4); DataTable dt4 = new DataTable(); sda4.Fill(dt4); cmd4.ExecuteNonQuery(); if (dt.Rows.Count != 0) { txtContra.Text = dt4.Rows[0][0].ToString(); txtMatricula.Text = MatAct; } DataTable dtAreas = new DataTable(); dtAreas = objconexion.GetDataTable("EXEC llamarAreas"); DDLArea.DataSource = dtAreas; DDLArea.DataValueField = "idArea"; DDLArea.DataTextField = "Area"; DDLArea.DataBind(); DataTable puestos = new DataTable(); puestos = objconexion.GetDataTable("EXEC llamarPuestos"); DDLPuesto.DataSource = puestos; DDLPuesto.DataValueField = "idPuesto"; DDLPuesto.DataTextField = "puesto"; DDLPuesto.DataBind(); objconexion.objSqlconn.Close(); }
private void LlenarForm() { bdCon objconexion = new bdCon(); DataTable dtAreas = new DataTable(); dtAreas = objconexion.GetDataTable("EXEC llamarAreas"); DDLArea.DataSource = dtAreas; DDLArea.DataValueField = "idArea"; DDLArea.DataTextField = "Area"; DDLArea.DataBind(); DataTable puestos = new DataTable(); puestos = objconexion.GetDataTable("EXEC llamarPuestos"); DDLPuesto.DataSource = puestos; DDLPuesto.DataValueField = "idPuesto"; DDLPuesto.DataTextField = "puesto"; DDLPuesto.DataBind(); }