Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public int DeleteEmp(EmployeeDal emp)
        {
            string str = $"delete from TestEmpTable where EmpId={emp.EmpId}";

            return(int.Parse(_framework.PerformDb(1, str).ToString()));
        }
Esempio n. 3
0
        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()));
        }