//bind first ddl----------------------------------------------------
public List<Dept_Desg_datatype> dept_Name()
{
List<Dept_Desg_datatype> rvm = new List<Dept_Desg_datatype>();
MySqlConnection con = master.GetConnection();
using (con)
{
MySqlCommand cmd = new MySqlCommand("select Dep_Name from department_table where Is_del='0' order by Dep_Name asc", con);
con.Open();
MySqlDataReader mysdr = cmd.ExecuteReader();
while (mysdr.Read())
{
Dept_Desg_datatype dd = new Dept_Desg_datatype();
dd.Dep_Name = mysdr["Dep_Name"].ToString();
rvm.Add(dd);
}
con.Close();
return rvm;
}
}
//bind second ddl------------------------------------
public IEnumerable<payroll_model_class> Emp_List()
{
List<payroll_model_class> emp = new List<payroll_model_class>();
// Dept_Desg_datatype dept = new Dept_Desg_datatype();
MySqlConnection con = master.GetConnection();
using (con)
{
MySqlCommand cmd = new MySqlCommand("SELECT Emp_Id from Employee_tbl where Is_del='0' and Emp_Department=@Dep and Emp_Degsignaton=@desig", con);
cmd.Parameters.AddWithValue("@Dep", IT);
cmd.Parameters.AddWithValue("@desig", Developer);
con.Open();
MySqlDataReader mysder = cmd.ExecuteReader();
while (mysder.Read())
{
Payroll_Model_Class PMC = new Payroll_Model_Class();
PMC.Emp_Id = mysder["Emp_Id"].ToString();
emp.Add(PMC);
}
con.Close();
return emp;
}