protected void Button2_Click(object sender, EventArgs e) { try { int id = Int32.Parse((DropDownList4.SelectedValue).ToString()); Emp lst = new EmpAccess().Getemp(id); TextBox1.Text = lst.name; TextBox2.Text = lst.father_name; TextBox3.Text = lst.mother_name; TextBox4.Text = lst.dob; TextBox5.Text = lst.Gender; TextBox6.Text = lst.nationality; TextBox7.Text = lst.maritual_status; TextBox8.Text = lst.Religion; TextBox9.Text = lst.mobile; TextBox10.Text = lst.email; TextBox11.Text = lst.home_phone; TextBox12.Text = lst.present_address; TextBox13.Text = lst.parmanent_address; TextBox15.Text = lst.Gross_Salary.ToString(); DropDownList1.SelectedValue = lst.deptid.ToString(); DropDownList2.SelectedValue = lst.degid.ToString(); DropDownList3.SelectedValue = lst.secid.ToString(); DropDownList5.SelectedValue = lst.Divid.ToString(); HiddenField1.Value = id.ToString(); Button3.Visible = true; } catch (Exception ex) { Label2.Text = ex.Message; } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { //er.deptid = int.Parse(txtolddept.Text); //er.secid = int.Parse(txtoldsec.Text); sp_display employee = new EmpAccess().GetempData(Int32.Parse(DRPemp.SelectedValue.ToString())); if (employee.Id > 0) { txtolddept.Text = employee.Department.ToString(); txtoldsec.Text = employee.section.ToString(); //txtoldsec.Text = employee.secid.ToString(); } }