public JsonResult StudentJoin(EmployeeJoining student) { string msg = string.Empty; var users = SiteUser.Users; if (users.Where(x => x.UserName == student.UserName).Count() > 0) { msg = "Exists"; } else { int deptId = Lists4CV.Department.Where(x => x.Name == "Administration").Select(x => x.Id).First(); int statusId = Lists4CV.Status.Where(x => x.Name == "Apprentice").Select(x => x.Id).First(); student.Date = DateTime.Now.Date; student.Role = "Joining"; student.Retry = 0; student.DepartmentId = deptId; student.StatusId = statusId; Employee emp = new Employee(); msg = emp.Join(student); } return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult EmployeeJoin(EmployeeJoining employee) { employee.Date = DateTime.Now.Date; employee.Role = "Joining"; employee.Retry = 0; Employee emp = new Employee(); string msg = emp.Join(employee); return(Json(msg, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here var model = EmployeeJoining.GetById(id); TryUpdateModel(model); model.SaveOrUpDate(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here var model = new EmployeeJoining(); TryUpdateModel(model); model.CreatedAt = DateTime.Now; model.CreatedBy = SessionItems.CurrentUser.UserID; model.Insert(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: EmployeeJoining/Edit/5 public ActionResult Edit(int id) { return(View(EmployeeJoining.GetById(id))); }
// GET: EmployeeJoining public ActionResult Index() { return(View(EmployeeJoining.GetAll())); }