public List<position> GetAllPosition() { List<position> pos = new List<position>(); try { DataTable data = positionDAL.GetAllPosition(); foreach (DataRow r in data.Rows) { position p = new position(); p.PositionNumber = r.ItemArray[0].ToString(); p.PositionName = r.ItemArray[1].ToString(); p.Salary = r.ItemArray[2].ToString(); pos.Add(p); } return pos; } catch (Exception e) { throw e; } }
public List<position> GetListPosition() { List<position> cv = new List<position>(); try { DataTable d = infoEmployeDAL.GetListPosition(); foreach (DataRow r in d.Rows) { position c = new position(); c.PositionNumber = r.ItemArray[0].ToString(); c.PositionName = r.ItemArray[1].ToString(); c.Salary = r.ItemArray[2].ToString(); c.ControlID = r.ItemArray[3].ToString(); cv.Add(c); } } catch (Exception e) { throw e; } return cv; }
public position GetOnePosition(string PositionID) { position pos = new position(); try { DataTable d = EmployeeDAL.GetPosition(PositionID); if (d.Rows.Count > 0) { pos.PositionName = d.Rows[0].ItemArray[1].ToString(); pos.PositionNumber = d.Rows[0].ItemArray[0].ToString(); pos.Salary = d.Rows[0].ItemArray[2].ToString(); pos.ControlID= d.Rows[0].ItemArray[3].ToString(); } return pos; } catch(Exception e) { throw e; } }