public bool updateEmp(EmpEntity.Employee e) { ed = new EmpDalLayer(); ed.updateEmp(e); return(true); //throw new NotImplementedException(); }
public List <EmpEntity.Employee> getEmp(string Name) { List <EmpEntity.Employee> eList = new List <EmpEntity.Employee>(); eDataContext = new EmpDalDataContext(); var e = eDataContext.getEmp(Name); foreach (var item in e) { EmpEntity.Employee e1 = new EmpEntity.Employee(); e1.EmpId = Convert.ToInt32(item.EmpId); e1.FirstName = item.FirstName; e1.MiddleName = item.MiddleName; e1.LastName = item.LastName; e1.Addreee = item.Address; e1.Department = item.Department; e1.City = item.City; e1.EmailId = item.EmailId; e1.Leaves = Convert.ToInt32(item.Leaves); e1.Picture = item.Picture; e1.Position = item.Position; e1.Salary = Convert.ToDecimal(item.Salary); e1.State = item.State; e1.ZipCode = item.ZipCode; e1.PhoneNumber = item.PhoneNumber; eList.Add(e1); } return(eList); // throw new NotImplementedException(); }
public Employee getEmpOnId(int id) { eDataContext = new EmpDalDataContext(); var q = eDataContext.getEmpOnId(id); EmpEntity.Employee e1 = new EmpEntity.Employee(); foreach (var item in q) { e1.EmpId = Convert.ToInt32(item.EmpId); e1.FirstName = item.FirstName; e1.MiddleName = item.MiddleName; e1.LastName = item.LastName; e1.Addreee = item.Address; e1.City = item.City; e1.EmailId = item.EmailId; e1.Leaves = Convert.ToInt32(item.Leaves); e1.Picture = item.Picture; e1.Position = item.Position; e1.Salary = Convert.ToDecimal(item.Salary); e1.State = item.State; e1.ZipCode = item.ZipCode; e1.PhoneNumber = item.PhoneNumber; e1.Department = item.Department; } return(e1); }
public Employee getEmpOnId(int id) { eDataContext = new EmpDalDataContext(); var q =eDataContext.getEmpOnId(id); EmpEntity.Employee e1 = new EmpEntity.Employee(); foreach (var item in q) { e1.EmpId=Convert.ToInt32(item.EmpId); e1.FirstName=item.FirstName; e1.MiddleName=item.MiddleName; e1.LastName=item.LastName; e1.Addreee=item.Address; e1.City=item.City; e1.EmailId=item.EmailId; e1.Leaves=Convert.ToInt32(item.Leaves); e1.Picture=item.Picture; e1.Position=item.Position; e1.Salary=Convert.ToDecimal(item.Salary); e1.State=item.State; e1.ZipCode=item.ZipCode; e1.PhoneNumber = item.PhoneNumber; e1.Department = item.Department; } return e1; }
public List<EmpEntity.Employee> getEmp(string Name) { List<EmpEntity.Employee> eList = new List<EmpEntity.Employee>(); eDataContext = new EmpDalDataContext(); var e= eDataContext.getEmp(Name); foreach (var item in e) { EmpEntity.Employee e1 = new EmpEntity.Employee(); e1.EmpId=Convert.ToInt32(item.EmpId); e1.FirstName=item.FirstName; e1.MiddleName=item.MiddleName; e1.LastName=item.LastName; e1.Addreee=item.Address; e1.Department = item.Department; e1.City=item.City; e1.EmailId=item.EmailId; e1.Leaves=Convert.ToInt32(item.Leaves); e1.Picture=item.Picture; e1.Position=item.Position; e1.Salary=Convert.ToDecimal(item.Salary); e1.State=item.State; e1.ZipCode=item.ZipCode; e1.PhoneNumber = item.PhoneNumber; eList.Add(e1); } return eList; // throw new NotImplementedException(); }
public bool updateEmp(EmpEntity.Employee e) { eDataContext = new EmpDalDataContext(); eDataContext.UpdateEmp(e.EmpId, e.FirstName, e.MiddleName, e.LastName, e.Addreee, e.City, e.ZipCode, e.State, e.PhoneNumber, e.EmailId, e.Department, e.Picture, e.Salary, e.Leaves, e.Position); eDataContext.SubmitChanges(); return(true); //throw new NotImplementedException(); }
public EmpEntity.Employee getEmpOName(string emp) { es = new EmpDalDataContext(); //var eea = es.getEmpOnName(emp); //EmpEntity.Employee e1 = new EmpEntity.Employee(); //foreach (var item in eea) //{ // e1.FirstName = item.FirstName; // e1.MiddleName = item.MiddleName; // e1.LastName = item.LastName; // e1.Addreee = item.Address; // e1.City = item.City; // e1.EmailId = item.EmailId; // e1.EmpId = Convert.ToInt32(item.EmpId); // e1.Leaves = Convert.ToInt32(item.Leaves); // e1.Picture = item.Picture; // e1.Position = item.Position; // e1.Salary = Convert.ToDecimal(item.Salary); // e1.State = item.State; // e1.ZipCode = item.ZipCode; // e1.PhoneNumber = item.PhoneNumber; //} //return e1; var eea = (from userChallenge in es.EmpDetails where userChallenge.FirstName == emp select userChallenge).FirstOrDefault(); EmpEntity.Employee e1 = new EmpEntity.Employee(); if (eea != null) { if (eea.EmpId != 0) { e1.FirstName = eea.FirstName; e1.MiddleName = eea.MiddleName; e1.LastName = eea.LastName; e1.Addreee = eea.Address; e1.City = eea.City; e1.EmailId = eea.EmailId; e1.EmpId = Convert.ToInt32(eea.EmpId); e1.Leaves = Convert.ToInt32(eea.Leaves); e1.Picture = eea.Picture; e1.Position = eea.Position; e1.Salary = Convert.ToDecimal(eea.Salary); e1.State = eea.State; e1.ZipCode = eea.ZipCode; e1.PhoneNumber = eea.PhoneNumber; e1.Department = eea.Department; } } return(e1); }
public EmpEntity.Employee getEmpOName(string emp) { es = new EmpDalDataContext(); //var eea = es.getEmpOnName(emp); //EmpEntity.Employee e1 = new EmpEntity.Employee(); //foreach (var item in eea) //{ // e1.FirstName = item.FirstName; // e1.MiddleName = item.MiddleName; // e1.LastName = item.LastName; // e1.Addreee = item.Address; // e1.City = item.City; // e1.EmailId = item.EmailId; // e1.EmpId = Convert.ToInt32(item.EmpId); // e1.Leaves = Convert.ToInt32(item.Leaves); // e1.Picture = item.Picture; // e1.Position = item.Position; // e1.Salary = Convert.ToDecimal(item.Salary); // e1.State = item.State; // e1.ZipCode = item.ZipCode; // e1.PhoneNumber = item.PhoneNumber; //} //return e1; var eea = (from userChallenge in es.EmpDetails where userChallenge.FirstName == emp select userChallenge).FirstOrDefault(); EmpEntity.Employee e1 = new EmpEntity.Employee(); if (eea!=null) { if (eea.EmpId != 0) { e1.FirstName = eea.FirstName; e1.MiddleName = eea.MiddleName; e1.LastName = eea.LastName; e1.Addreee = eea.Address; e1.City = eea.City; e1.EmailId = eea.EmailId; e1.EmpId = Convert.ToInt32(eea.EmpId); e1.Leaves = Convert.ToInt32(eea.Leaves); e1.Picture = eea.Picture; e1.Position = eea.Position; e1.Salary = Convert.ToDecimal(eea.Salary); e1.State = eea.State; e1.ZipCode = eea.ZipCode; e1.PhoneNumber = eea.PhoneNumber; e1.Department = eea.Department; } } return e1; }
public bool insertNewEmployee(EmpEntity.Employee e) { ed = new EmpDalLayer(); ed.insertNewEmployee(e); return(true); }