public string UpdateBatch(Batch batch, int userId) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var emp = empLogic.GetEmployeeDetailsById(userId); var batchObject = GetBatchById(batch.BatchId); if (emp.UserId == userId && emp.BatchId == batch.BatchId) { return("Exiest"); } else if (batch.BatchCapacity > batch.AssignedEmployees && emp.BatchId == null) { batch.AssignedEmployees = batch.AssignedEmployees + 1; db.Entry(batch).State = EntityState.Modified; db.SaveChanges(); emp.NominationStatus = "Pending"; emp.BatchId = batch.BatchId; EmployeeDaLayer.EmployeeDbContext empDb = new EmployeeDaLayer.EmployeeDbContext(); empDb.Entry(emp).State = EntityState.Modified; empDb.SaveChanges(); return("Success"); } else { return("Failed"); } }
public ActionResult ApproveOrRejectEmployee(int id, int signal) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var employee = empLogic.GetEmployeeDetailsById(id); if (signal == 1) { string status = "Approved"; bool delete = false; if (employee != null) { bool value = empLogic.EditEmployeeDetails(employee, status, delete); } return(RedirectToAction("EmployeeRequest", "Admin")); } else { string status = "Rejected"; bool delete = true; if (employee != null) { bool value = empLogic.EditEmployeeDetails(employee, status, delete); } return(RedirectToAction("EmployeeRequest", "Admin")); } }
public IEnumerable <Batch> GetPendingEmployeeNomination() { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var employee = empLogic.GetEmployeeDetails(); var listofBatchId = new List <int?>(); foreach (var item in employee) { if (item.NominationStatus == "Pending") { listofBatchId.Add(item.BatchId); } } var batch = db.Batches.Where(s => s.AssignFacultyStatus == "yes").ToList(); var finalResult = new List <Batch>(); foreach (var item in batch) { foreach (var id in listofBatchId) { finalResult.Add(db.Batches.Where(s => s.BatchId == id).FirstOrDefault()); } } return(finalResult); }
public ActionResult EmployeeRequest() { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var empList = empLogic.GetEmployeeStatus(); if (empList.Count() > 0) { return(View(empList)); } else { TempData["status"] = "false"; return(View()); } }
//Reset Password public ActionResult ResetPassword(string password) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); Employee empModel = (Employee)TempData["module"]; var status = empLogic.GetPasswordReset(password, empModel); if (status) { TempData["msg"] = "success"; } else { TempData["msg"] = "failed"; } return(RedirectToAction("Login", "Faculty")); }
public ActionResult VerifyDetails([Bind(Include = "UserId,SecurityQuestion,SecurityQueAnswer")] Employee empModel) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var status = empLogic.VerifyPasswordRecoveryDetails(empModel); if (status != null) { TempData["status"] = "true"; TempData["module"] = status; return(View()); } else { TempData["status"] = "false"; return(View()); } }
public ActionResult FindUserId([Bind(Include = "SecurityQuestion,SecurityQueAnswer,Contact,Email")] Employee empModel) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); var userId = empLogic.GetFacultyId(empModel); if (userId.ToString().Length == 6) { TempData["status"] = "success"; TempData["UserId"] = userId; return(View()); } else { TempData["status"] = "failed"; return(View()); } }
public ActionResult ApproveOrRejectNomination(int id, int signal) { EmployeeBlLayer.EmployeeLogic empLogic = new EmployeeBlLayer.EmployeeLogic(); if (signal == 1) { string nominationStatus = "Accepted"; int? batchId = id; if (batchId != null) { bool value = empLogic.UpdateEmployee(batchId, nominationStatus); } return(RedirectToAction("BatchNomination", "Admin")); } else { string nominationStatus = "Rejected"; int? batchId = null; bool value = empLogic.UpdateEmployee(batchId, nominationStatus); TempData["Msg"] = "Request Rejected"; return(RedirectToAction("BatchNomination", "Admin")); } }