public ActionResult LeavesonPosition(PositionVM model) { IStructuredetailRepository objstructureRepository = new StructuredetailRepository(); IEmployeeRepository obj = new EmployeeRepository(); var check = obj.Getleave().Where(x => x.PositionId == model.PositionId).FirstOrDefault(); var deplist = objstructureRepository.Getdep().ToList(); if (check == null) { var add = obj.Addleavepos(model.PositionId, model.CasualLeave, model.SickLeave); obj.Addleave(add); obj.Save(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; TempData["SuccessMessage11"] = "Leaves Assigned to Position Sucessfully"; } else { obj.Updateleave(model.PositionId, model.CasualLeave, model.SickLeave); obj.Save(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; TempData["SuccessMessage11"] = "Leaves Updated Sucessfully"; } return(View()); }
public ActionResult Promotions() { IStructuredetailRepository repo = new StructuredetailRepository(); var deplist = repo.Getdep().ToList(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdep1list = list; return(View()); }
public ActionResult LeavesonPosition() { IStructuredetailRepository objstructureRepository = new StructuredetailRepository(); var deplist = objstructureRepository.Getdep().ToList(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; return(View()); }
public ActionResult Position(PositionVM obj, FormCollection form) { IStructuredetailRepository objstructureRepository = new StructuredetailRepository(); var deplist = objstructureRepository.Getdep().ToList(); var depname = form["txtname"]; var check = objstructureRepository.validation(depname).FirstOrDefault(); var check1 = objstructureRepository.validation1(obj.Position).FirstOrDefault(); var check3 = objstructureRepository.validation2(obj.JobLevel).FirstOrDefault(); if (check != null && check1 != null && check3 != null || check3 == null && check1 != null) { SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; var levellist = new SelectList(new[] { new { ID = "1", Name = "1" }, new { ID = "2", Name = "2" }, new { ID = "3", Name = "3" }, new { ID = "4", Name = "4" }, new { ID = "5", Name = "5" } }, "Name", "Name", "1" ); ViewBag.getlevellist = levellist; TempData["ErrorMessage9"] = "Position " + obj.Position + " Already Exists"; } else { SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; var levellist = new SelectList(new[] { new { ID = "1", Name = "Low" }, new { ID = "2", Name = "Medium" }, new { ID = "3", Name = "High" } }, "Name", "Name", "1" ); ViewBag.getlevellist = levellist; var add = objstructureRepository.Addpos(Convert.ToInt32(obj.DepartmentId), obj.JobLevel, obj.Position, Convert.ToDecimal(obj.BasicPay), Convert.ToDecimal(obj.IncomeTax), obj.Experience); objstructureRepository.Add(add); objstructureRepository.Save(); TempData["SuccessMessage9"] = "Position Created Sucessfully"; return(RedirectToAction("ViewPosition", "Admin")); } return(View()); }
public ActionResult Position() { IStructuredetailRepository objstructureRepository = new StructuredetailRepository(); var deplist = objstructureRepository.Getdep().ToList(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdeplist = list; var levellist = new SelectList(new[] { new { ID = "1", Name = "1" }, new { ID = "2", Name = "2" }, new { ID = "3", Name = "3" }, new { ID = "4", Name = "4" }, new { ID = "5", Name = "5" } }, "Name", "Name", "1" ); ViewBag.getlevellist = levellist; return(View()); }
public ActionResult CreateVacancy() { IStructuredetailRepository objstructureRepository = new StructuredetailRepository(); var deplist = objstructureRepository.Getdep().ToList(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdep1list = list; var levellist = new SelectList(new[] { new { ID = "1", Name = "1" }, new { ID = "2", Name = "2" }, new { ID = "3", Name = "3" }, new { ID = "4", Name = "4" }, new { ID = "5", Name = "5" } }, "Name", "Name", "1" ); ViewBag.getlevellist = levellist; var city = new SelectList(new[] { new { ID = "1", Name = "Karachi" }, new { ID = "2", Name = "Lahore" }, new { ID = "3", Name = "Islamabad" } }, "Name", "Name", "1" ); ViewBag.getcitylist = city; return(View()); }
public ActionResult CreateVacancy(VacancyVM model, HttpPostedFileBase postedFile1, FormCollection form) { IStructuredetailRepository repo = new StructuredetailRepository(); var city = new SelectList(new[] { new { ID = "1", Name = "Karachi" }, new { ID = "2", Name = "Lahore" }, new { ID = "3", Name = "Islamabad" } }, "Name", "Name", "1" ); ViewBag.getcitylist = city; var deplist = repo.Getdep().ToList(); SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName"); ViewBag.getdep1list = list; var levellist = new SelectList(new[] { new { ID = "1", Name = "1" }, new { ID = "2", Name = "2" }, new { ID = "3", Name = "3" }, new { ID = "4", Name = "4" }, new { ID = "5", Name = "5" } }, "Name", "Name", "1" ); ViewBag.getlevellist = levellist; if (postedFile1 == null) { ModelState.AddModelError("CustomError", "Please select Test"); } else if (!(postedFile1.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || postedFile1.ContentType == "application/pdf")) { ModelState.AddModelError("CustomError", "Only .docx and .pdf file allowed"); return(View()); } else if (postedFile1 != null) { string fileName1 = Guid.NewGuid() + Path.GetExtension(postedFile1.FileName); postedFile1.SaveAs(Path.Combine(Server.MapPath("~/TestPaper"), fileName1)); var AddVacant = repo.Addvac(model.VacancyName, model.CityName, model.PositionId, model.DepartmentId, model.RequiredQualification, model.JobLevel, model.MarksCriteria, fileName1); repo.Addvacant(AddVacant); repo.Save(); TempData["SuccessMessage11"] = "Vacancy Created"; } return(View()); }