public ActionResult reject(int id) { leaves1 l = entities.leaves1.Find(id); Detail d = entities.Details.Find(id); l.status = "Rejected"; entities.SaveChanges(); return(View()); }
public ActionResult accept(int id) { leaves1 l = entities.leaves1.Find(id); Detail d = entities.Details.Find(l.empId); l.status = "Accepted"; d.available = d.available - l.leaves; entities.SaveChanges(); return(View()); }
public ActionResult request(int empId, string empName, string empType, string dept, string reason, int leaves, DateTime from, DateTime to) { leaves1 d = new leaves1(); ViewData["request"] = "true"; d.empId = empId; d.empName = empName; d.empType = empType; d.dept = dept; d.reason = reason; d.leaves = leaves; d.from = from; d.to = to; d.status = "pending"; entities.leaves1.Add(d); entities.SaveChanges(); return(View()); }