public ActionResult RemoveProfile(int id) { string error = ""; //SetViewBag(); // ViewBag values set for all dropdowns in the Employee update EmployeeViewBO employeeBO = bl.EditEmployee(id, out error); //Gets all details for a particular Employee to edit //employeeBO.EmployeePaymentList = bl.GetEmployeePaymentList(employeeBO); //Gets payment list for a particular Employee if (bl.RemoveProfile(id, out error) == true) //Successfully removed Profile { return(Json(new { success = true, errorMsg = error }, JsonRequestBehavior.AllowGet)); } else //Failed to remove the Profile { return(Json(new { success = false, errorMsg = error }, JsonRequestBehavior.AllowGet)); } //return View("CreateEditEmployee", employeeBO); }
public ActionResult ListPayment() { var employeePaymentViewBO = new EmployeeViewBO(); employeePaymentViewBO.EmployeePaymentList = bl.GetEmployeePaymentList(employeePaymentViewBO); //Gets Payment List for a particular Employee return(PartialView("_EmployeePaymentList", employeePaymentViewBO.EmployeePaymentList)); //Partially returns "_EmployeePaymentList" }
public ActionResult EditEmployee(int id) { string error = ""; ViewBag.CurrentTab = "Employee"; //Sets the "Resource Details" tab as active SetViewBag(); // ViewBag values set for all dropdowns in the Employee update EmployeeViewBO employeeBO = bl.EditEmployee(id, out error); //Gets all fields values for a selected Employee if (employeeBO != null) //When the selected Employee is exist { employeeBO.ResourceSubMenuBO = new ResourceSubMenuBO(); //Sets the values for "ResourceSubMenuBO" models employeeBO.ResourceSubMenuBO.FName = employeeBO.FirstName; employeeBO.ResourceSubMenuBO.LName = employeeBO.LastName; employeeBO.ResourceSubMenuBO.EmployeeID = employeeBO.EmployeeID; employeeBO.EmployeePaymentBO = new EmployeePaymentBO(); //Gets the Employee Payment models values employeeBO.EmployeePaymentList = bl.GetEmployeePaymentList(employeeBO); //Gets the Payment List for a particular Employee employeeBO.WorkingPatternDetailsBO = new Employee_WorkingPatternDetailsBO(); //Gets the Employee WorkingPattern models values employeeBO.EmployeeWorkingPatternList = bl.GetEmployeeWorkingPatternList(employeeBO); //Gets the WorkingPattern List for a particular Employee if (employeeBO.ProfilePhoto == null) //When the profile is not uploaded { return(View("CreateEditEmployee", employeeBO)); } employeeBO.PhotoString = "data: image / png; base64," + Convert.ToBase64String(employeeBO.ProfilePhoto); //Profile is uploaded then Binary Image converts to string for viewing purpose } else //When the selected Employee is not exist { TempData["Error"] = error; return(RedirectToAction("Index")); //Returns to the Index page } return(View("CreateEditEmployee", employeeBO)); }
public ActionResult CreateWorkingPattern() { var empView = new EmployeeViewBO(); empView.WorkingPatternDetailsBO = new Employee_WorkingPatternDetailsBO(); empView.EmployeeWorkingPatternList = bl.GetEmployeeWorkingPatternList(empView); //Gets List of Working Pattern for a particular Employee return(PartialView("_CreateEditWorkingPattern", empView.WorkingPatternDetailsBO)); //Partially returns "_CreateEditWorkingPattern" }
public ActionResult CreatePayment() { var empView = new EmployeeViewBO(); empView.EmployeePaymentBO = new EmployeePaymentBO(); empView.EmployeePaymentList = bl.GetEmployeePaymentList(empView); //Gets List of Payment for a particular Employee SetViewBag(); //ViewBag values set for all dropdowns in the Employee creation or update return(PartialView("_CreateEditPayment", empView.EmployeePaymentBO)); //Partially returns "_CreateEditPayment" }
public ActionResult EditWorkingPattern(int id) { string error; var empView = new EmployeeViewBO(); empView.WorkingPatternDetailsBO = bl.EditEmployeeWorkingPattern(id, out error); //Gets details for edit the Working Pattern empView.EmployeeWorkingPatternList = bl.GetEmployeeWorkingPatternList(empView); //Gets Working Pattern List for a particular Employee SetViewBag(); //ViewBag values set for all dropdowns in the Employee creation or update return(PartialView("_CreateEditWorkingPattern", empView.WorkingPatternDetailsBO)); //Partially returns "_CreateEditWorkingPattern" }
public ActionResult EditPayment(int id) { string error; var empView = new EmployeeViewBO(); empView.EmployeePaymentBO = bl.EditEmployeePayment(id, out error); //Gets details for Edit Payment empView.EmployeePaymentList = bl.GetEmployeePaymentList(empView); //Gets PaymentList for a particular Employee SetViewBag(); //ViewBag values set for all dropdowns in the Employee creation or update return(PartialView("_CreateEditPayment", empView.EmployeePaymentBO)); //Partially returns "_CreateEditPayment" }
public ActionResult CreateEmployee() { SetViewBag(); //ViewBag values set for all dropdowns in the Employee creation var employee = new EmployeeViewBO(); employee.WorkingPatternDetailsBO = new Employee_WorkingPatternDetailsBO(); employee.AddressViewModel = new AddressViewModel(); employee.AddressViewModel.CountryID = addressBl.GetDefaultCountry(); //Sets the default country for Country's dropdown return(View("CreateEditEmployee", employee)); }
public ActionResult CreateEmployee(EmployeeViewBO employeeBO, HttpPostedFileBase UploadFile) { string error = ""; SetViewBag(); // ViewBag values set for all dropdowns in the Employee creation if (ModelState.IsValid) { if (employeeBO.EmployeeID == 0) //Creates a new Employee { if (bl.SaveEmployee(employeeBO, out error, UploadFile) == true) //Successfully saved { TempData["Success"] = error; return(RedirectToAction("Index")); //Returns to the Index page } else //Failed to save Employee { TempData["Error"] = error; } } else //Updates a particular Employee { if (bl.UpdateEmployee(employeeBO, out error, UploadFile) == true) //Successfully updated { TempData["Success"] = error; //return RedirectToAction("Index"); //Returns to the Index page } else //Failed to Employee update { TempData["Error"] = error; } employeeBO.ResourceSubMenuBO = new ResourceSubMenuBO(); //Sets the values for "ResourceSubMenuBO" models employeeBO.ResourceSubMenuBO.FName = employeeBO.FirstName; employeeBO.ResourceSubMenuBO.LName = employeeBO.LastName; employeeBO.ResourceSubMenuBO.EmployeeID = employeeBO.EmployeeID; employeeBO.EmployeePaymentList = bl.GetEmployeePaymentList(employeeBO); //Gets the EmployeePayment list for a particular Employee employeeBO.EmployeeWorkingPatternList = bl.GetEmployeeWorkingPatternList(employeeBO); //Gets the EmployeeWorkingPattern list for a particular Employee employeeBO.PhotoFileType = bl.GetPhotoFileTypeVal(employeeBO); employeeBO.ProfilePhoto = bl.GetImageFromDataBase(employeeBO.EmployeeID, out error); if (employeeBO.ProfilePhoto == null) //When the profile is not uploaded { return(View("CreateEditEmployee", employeeBO)); } employeeBO.PhotoString = "data: image / png; base64," + Convert.ToBase64String(employeeBO.ProfilePhoto); //Profile is uploaded then Binary Image converts to string for viewing purpose } } return(View("CreateEditEmployee", employeeBO)); }
public ActionResult SkillsIndex(int id) { string error; ViewBag.CurrentTab = "Skill"; //Sets the "Skills" tab as active SetSkillsViewBag(); EmployeeViewBO employeeBO = bl.EditEmployee(id, out error); //Gets the EmployeeID for update the Skills var employeeSkillViewBO = new EmployeeSkillViewBO(); employeeSkillViewBO.EmployeeID = employeeBO.EmployeeID; //Gets EmployeeID employeeSkillViewBO.ResourceSubMenuBO = new ResourceSubMenuBO(); //Sets the values for "ResourceSubMenuBO" models employeeSkillViewBO.ResourceSubMenuBO.FName = employeeBO.FirstName; employeeSkillViewBO.ResourceSubMenuBO.LName = employeeBO.LastName; employeeSkillViewBO.ResourceSubMenuBO.EmployeeID = employeeBO.EmployeeID; employeeSkillViewBO.SkillCategoryList = bl.GetSkillCategoryList(id); //Gets the list of Skills for a particular Employee return(View(employeeSkillViewBO)); }
/// <summary> /// Displays an Index page for "Resource Experience" /// </summary> /// <param name="id: EmployeeID"></param> /// <returns></returns> public ActionResult ExperienceIndex(int id) { string error; ViewBag.CurrentTab = "Experience"; //Sets the "Experience" tab as active SetExperienceViewBag(); EmployeeViewBO employeeBO = bl.EditEmployee(id, out error); //Gets the EmployeeID for update the Experience for a particular Employee var employeeExperienceViewBO = new EmployeeExperienceViewBO(); employeeExperienceViewBO.EmployeeID = employeeBO.EmployeeID; //Gets EmployeeID employeeExperienceViewBO.EmployeeExperienceViewModels = new EmployeeExperienceViewModels(); employeeExperienceViewBO.EmployeeExperienceViewModels.ResourceID = employeeBO.EmployeeID; //Sets the EmployeeID to update the "Experience" employeeExperienceViewBO.EmployeeExpereienceList = bl.GetExperienceList(employeeExperienceViewBO.EmployeeExperienceViewModels); //Gets List of all Experience for a particular Employee employeeExperienceViewBO.ResourceSubMenuBO = new ResourceSubMenuBO(); //Sets the values for "ResourceSubMenuBO" models employeeExperienceViewBO.ResourceSubMenuBO.FName = employeeBO.FirstName; employeeExperienceViewBO.ResourceSubMenuBO.LName = employeeBO.LastName; employeeExperienceViewBO.ResourceSubMenuBO.EmployeeID = employeeBO.EmployeeID; return(View(employeeExperienceViewBO)); }