public ActionResult UpdateExamResult(int PromotionRecordEmployeeID, decimal ExamResult) { Result result = new Result(); PromotionsRecordsEmployeesViewModel PromotionsRecordsEmployeesVM = new PromotionsRecordsEmployeesViewModel(); PromotionsRecordsEmployeesBLL pre = new PromotionsRecordsEmployeesBLL() { LoginIdentity = this.UserIdentity }; result = pre.UpdateExamResult(PromotionRecordEmployeeID, ExamResult); if (result.EnumMember == PromotionsRecordsValidationEnum.Done.ToString()) { PromotionsRecordsEmployeesBLL oo = (PromotionsRecordsEmployeesBLL)result.Entity; PromotionsRecordsEmployeesVM.PromotionRecordEmployeeID = oo.PromotionRecordEmployeeID; } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecausePromotionRecordStatusMustBePreferenced.ToString()) { throw new CustomException(@Resources.Globalization.ValidationPromotionRecordStatusMustBePreferencedOrInstalledText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecausePromotionDecisionMustBeShouldBePromotedByExam.ToString()) { throw new CustomException(@Resources.Globalization.ValidationPromotionDecisionMustBeShouldBePromotedByExamText.ToString()); } return(Json(new { PromotionRecordEmployeeID = PromotionsRecordsEmployeesVM.PromotionRecordEmployeeID, }, JsonRequestBehavior.AllowGet)); }
public ActionResult RemoveByPromotionRecordEmployeeID(PromotionsRecordsEmployeesViewModel PromotionRecordEmployeeVM) { PromotionsRecordsViewModel PromotionsRecordsVM = new PromotionsRecordsViewModel(); Result result = new Result(); PromotionsRecordsEmployeesBLL emp = new PromotionsRecordsEmployeesBLL() { PromotionRecordEmployeeID = PromotionRecordEmployeeVM.PromotionRecordEmployeeID, RemovingReason = PromotionRecordEmployeeVM.RemovingReason, RemovingBy = this.UserIdentity, LoginIdentity = this.UserIdentity }; result = emp.RemoveAndRedistributeJobs(); if (result.EnumMember == PromotionsRecordsValidationEnum.Done.ToString()) { PromotionsRecordsEmployeesBLL oo = (PromotionsRecordsEmployeesBLL)result.Entity; PromotionsRecordsVM.PromotionRecordID = oo.PromotionRecord.PromotionRecordID; //PromotionsRecordsVM.PromotionRecordNo = oo.PromotionRecordNo; //PromotionsRecordsVM.PromotionRecordDate = oo.PromotionRecordDate; PromotionsRecordsVM.PromotionRecordStatus = new PromotionsRecordsStatusViewModel() { PromotionRecordStatusID = oo.PromotionRecord.PromotionRecordStatus.PromotionRecordStatusID, PromotionRecordStatusName = oo.PromotionRecord.PromotionRecordStatus.PromotionRecordStatusName }; } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecausePromotionRecordStatusMustBeOpenOrPreferenced.ToString()) { throw new CustomException(@Resources.Globalization.ValidationPromotionRecordStatusMustBeOpenOrPreferencedText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecauseOfNoJobsVacanciesAvailable.ToString()) { throw new CustomException(@Resources.Globalization.ValidationNoJobsVacanciesAvailableText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecauseOfNoCandidatesEligible.ToString()) { throw new CustomException(@Resources.Globalization.ValidationNoCandidatesEligibleInPromotionRecordText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecauseOfSomeQualifitionPointsAreNull.ToString()) { throw new CustomException(@Resources.Globalization.ValidationSomeQualifitionPointsAreNullInPromotionRecordText.ToString()); } return(Json(new { PromotionRecordStatus = PromotionsRecordsVM.PromotionRecordStatus, PromotionRecordToolbarID = GetPromotionRecordToolbarID(PromotionsRecordsVM.PromotionRecordStatus.PromotionRecordStatusID) }, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdatePromotionRecordEmployeeIsDeserveExtraBonus(PromotionsRecordsEmployeesViewModel PromotionRecordEmployeeVM) { Result result = null; PromotionsRecordsEmployeesBLL PromotionRecordEmployeeBLL = new PromotionsRecordsEmployeesBLL().GetByPromotionRecordEmployeeID(PromotionRecordEmployeeVM.PromotionRecordEmployeeID); PromotionRecordEmployeeBLL.IsDeserveExtraBonus = PromotionRecordEmployeeVM.IsDeserveExtraBonus; PromotionRecordEmployeeBLL.LoginIdentity = this.UserIdentity; result = PromotionRecordEmployeeBLL.UpdateDeserveExtraBonus(); if (result.EnumMember == CareersHistoryValidationEnum.RejectedBecauseOfCareerDegreeOutOfRange.ToString()) { throw new CustomException(Resources.Globalization.ValidationOfCareerDegreeOutOfRangeText); } if (result.EnumMember == PromotionsRecordsEmployeesValidationEnum.Done.ToString()) { return(Json(HttpStatusCode.OK, JsonRequestBehavior.AllowGet)); } if (result.EnumMember == PromotionsRecordsEmployeesValidationEnum.RejectedBecauseOfIsDeserveExtraBonusNotSpecifiedValue.ToString()) { throw new CustomException(Resources.Globalization.ValidationOfIsDeserveExtraBonusNotSpecifiedValueText); } else if (result.EnumMember == PromotionsRecordsEmployeesValidationEnum.RejectedBecauseOfIsDeserveExtraBonusUpdateWithSameValue.ToString()) { // throw new CustomException(Resources.Globalization.ValidationOfIsDeserveExtraBonusUpdateWithSameValueText); return(Json(HttpStatusCode.OK, JsonRequestBehavior.AllowGet)); } else if (result.EnumMember == PromotionsRecordsEmployeesValidationEnum.RejectedBecauseOfApproved.ToString()) { throw new CustomException(Resources.Globalization.ValidationOfApprovedText); } else { return(Json(HttpStatusCode.ExpectationFailed, JsonRequestBehavior.AllowGet)); //return Json(new { result }, JsonRequestBehavior.AllowGet); } }
public ActionResult ShuffleJob(int PromotionRecordEmployeeID, string NewEmployeeCodeNo) { Result result = new Result(); PromotionsRecordsEmployeesViewModel PromotionsRecordsEmployeesVM = new PromotionsRecordsEmployeesViewModel(); PromotionsRecordsEmployeesBLL pre = new PromotionsRecordsEmployeesBLL() { LoginIdentity = this.UserIdentity }; result = pre.ShuffleJob(PromotionRecordEmployeeID, NewEmployeeCodeNo); if (result.EnumMember == PromotionsRecordsValidationEnum.Done.ToString()) { PromotionsRecordsEmployeesBLL oo = (PromotionsRecordsEmployeesBLL)result.Entity; PromotionsRecordsEmployeesVM.PromotionRecordEmployeeID = oo.PromotionRecordEmployeeID; } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecausePromotionRecordStatusMustBePreferencedOrInstalled.ToString()) { throw new CustomException(@Resources.Globalization.ValidationPromotionRecordStatusMustBePreferencedOrInstalledText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecauseOfNewEmployeeCodeNoNotExitsInPromotionRecordEmployeesOrNotPromoted.ToString()) { throw new CustomException(@Resources.Globalization.ValidationNewEmployeeCodeNoNotExitsInPromotionRecordEmployeesOrNotPromotedText.ToString()); } else if (result.EnumMember == PromotionsRecordsValidationEnum.RejectedBecauseOfOneOfEmployeeInRedistributeJobIsApproved.ToString()) { throw new CustomException(@Resources.Globalization.ValidationPromotionRecordOneOfEmployeeInRedistributeJobIsApprovedText.ToString()); } return(Json(new { PromotionRecordEmployeeID = PromotionsRecordsEmployeesVM.PromotionRecordEmployeeID, }, JsonRequestBehavior.AllowGet)); }