public EmployeeSkillsDTO GetOneEmployeeSkills(int Id) { EmployeeSkill Record = _unitOfWork.EmployeeSkillRepository.Get(x => x.Id == Id).FirstOrDefault(); EmployeeSkillsDTO ReturnRecord = ResponseFormatters.EmployeeSkillResponseFormatter.EmplyeeSkillDbToDTO(Record); return(ReturnRecord); }
public static List <EmployeeSkillsDTO> EmplyoeeSkillDbListToDTOList(List <EmployeeSkill> ModelData) { List <EmployeeSkillsDTO> ReturnRecord = new List <EmployeeSkillsDTO>(); foreach (EmployeeSkill Row in ModelData) { EmployeeSkillsDTO Record = new EmployeeSkillsDTO { Id = Row.Id, EmpCode = Row.EmpCode, EmpSkillId = Row.EmpSkillId, EmpSkillPoint = Row.EmpSkillPoint, EmpSkillStatus = Row.EmpSkillStatus, Employee = new EmployeeDTO { EmpCode = Row.Employee.EmpCode, EmpName = Row.Employee.EmpName, }, Skill = new SkillDTO { SkillId = Row.Skill.SkillId, SkillName = Row.Skill.SkillName } }; ReturnRecord.Add(Record); } return(ReturnRecord); }
public void AddEmployeeSkills(EmployeeSkillsDTO Record) { EmployeeSkill ReturnRecord = EmployeeSkillRequestFormatter.EmployeeSkillDTOToDb(Record); ReturnRecord.EmpSkillStatus = true; _unitOfWork.EmployeeSkillRepository.Create(ReturnRecord); }
public void UpdateEmployeeSkill(EmployeeSkillsDTO Record) { EmployeeSkill ReturnRecord = EmployeeSkillRequestFormatter.EmployeeSkillDTOToDb(Record); ReturnRecord.EmpCode = Record.EmpId; ReturnRecord.EmpSkillStatus = true; _unitOfWork.EmployeeSkillRepository.Update(ReturnRecord); }
public ActionResult Add(int Id) { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Id); EmployeeSkillsDTO Record = new EmployeeSkillsDTO(); Record.SkillSelectlist = _EmployeeSkillService.GetSkillSelectList(); Record.EmpId = Id; return(View("../Employee/Skill/Add", Record)); }
public static EmployeeSkill EmployeeSkillDTOToDb(EmployeeSkillsDTO ModelData) { EmployeeSkill Record = new EmployeeSkill { Id = ModelData.Id, EmpCode = ModelData.EmpCode, EmpSkillId = ModelData.EmpSkillId, EmpSkillPoint = ModelData.EmpSkillPoint, EmpSkillStatus = ModelData.EmpSkillStatus }; return(Record); }
public ActionResult Update(int id) { EmployeeSkillsDTO Record = new EmployeeSkillsDTO(); Record = _EmployeeSkillService.GetOneEmployeeSkills(id); Record.EmpId = Record.EmpCode; Record.SkillSelectlist = _EmployeeSkillService.GetSkillSelectList(); ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Record.EmpId); return(View("../Employee/Skill/Update", Record)); }
public ActionResult Delete(int id) { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); EmployeeSkillsDTO Record = new EmployeeSkillsDTO(); try { Record.EmpId = _EmployeeSkillService.GetEmpCode(id); _EmployeeSkillService.Delete(id); Session["Success"] = "Successfully Deleted Employee Skill"; } catch (Exception Exception) { ViewBag.Error = Exception.Message; } return(RedirectToAction("Index", "Skill", new { id = Record.EmpId })); }
public ActionResult Update(EmployeeSkillsDTO Record) { Record.SkillSelectlist = _EmployeeSkillService.GetSkillSelectList(); try { if (ModelState.IsValid) { _EmployeeSkillService.UpdateEmployeeSkill(Record); Session["Success"] = "Successfully Updated Employee Skill"; return(RedirectToAction("Index", "Skill", new { id = Record.EmpId })); } else { ViewBag.Error = "Form Error"; } } catch (Exception Exception) { ViewBag.Error = Exception.Message; } return(View("../Employee/Skill/Update", Record)); }
public static EmployeeSkillsDTO EmplyeeSkillDbToDTO(EmployeeSkill ModelData) { EmployeeSkillsDTO Record = new EmployeeSkillsDTO { Id = ModelData.Id, EmpCode = ModelData.EmpCode, EmpSkillId = ModelData.EmpSkillId, EmpSkillPoint = ModelData.EmpSkillPoint, EmpSkillStatus = ModelData.EmpSkillStatus, Employee = new EmployeeDTO { EmpCode = ModelData.Employee.EmpCode, EmpName = ModelData.Employee.EmpName, }, Skill = new SkillDTO { SkillId = ModelData.Skill.SkillId, SkillName = ModelData.Skill.SkillName } }; return(Record); }