public EmployeeDal[] GetEmployeeDetails() { List <EmployeeDal> list = new List <EmployeeDal>(); SqlDataReader reader = (SqlDataReader)_framework.PerformDb(0, "select * from TestEmpTable"); while (reader.Read()) { EmployeeDal item = new EmployeeDal { EmpId = int.Parse(reader[0].ToString()), EmpName = reader[1].ToString(), Dept = reader[2].ToString(), ScrumNo = int.Parse(reader[3].ToString()) }; list.Add(item); } reader.Close(); return(list.ToArray()); }
public int DeleteEmp(EmployeeDal emp) { string str = $"delete from TestEmpTable where EmpId={emp.EmpId}"; return(int.Parse(_framework.PerformDb(1, str).ToString())); }
public int AddEmployeeDetails(EmployeeDal emp) { string str = $"insert into TestEmpTable values({emp.EmpId},'{emp.EmpName}','{emp.Dept}',{emp.ScrumNo})"; return(int.Parse(_framework.PerformDb(1, str).ToString())); }