public ActionResult GetLenders(int EmployeeCarrerHistoryID, int PromotionPeriodID) { EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID); PromotionsPeriodsBLL PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID); return(Json(new { data = new LendersBLL().GetByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate) }, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(PromotionsPeriodsViewModel PromotionPeriodVM) { PromotionsPeriodsBLL PromotionPeriod = new PromotionsPeriodsBLL(); PromotionPeriod.Year = new MaturityYearsBalancesBLL() { MaturityYearID = PromotionPeriodVM.YearID }; PromotionPeriod.Period = new PeriodsBLL() { PeriodID = PromotionPeriodVM.PeriodID }; //QualificationsDegreesVM.QualificationDegreeName; PromotionPeriod.PromotionStartDate = PromotionPeriodVM.PromotionStartDate; PromotionPeriod.PromotionEndDate = PromotionPeriodVM.PromotionEndDate; PromotionPeriod.IsActive = PromotionPeriodVM.IsActive; PromotionPeriod.LoginIdentity = UserIdentity; Result result = PromotionPeriod.Add(); if (result.EnumMember == PromotionsPeriodsValidationEnum.Done.ToString()) { } else if (result.EnumMember == PromotionsPeriodsValidationEnum.RejectedBecauseOfPromotionStartDateIsGreaterThenPromotionEndDate.ToString()) { throw new CustomException(Resources.Globalization.ValidationPromotionStartDateIsGreaterThenPromotionEndDateText); } else if (result.EnumMember == PromotionsPeriodsValidationEnum.RejectedBecauseOfAlreadyOnePromotionPeriodIsActive.ToString()) { throw new CustomException(Resources.Globalization.ValidationAlreadyOnePromotionPeriodIsActiveText); } else if (result.EnumMember == PromotionsPeriodsValidationEnum.RejectedBecauseOfPromotionRecordExistWithThisPromotiosPeriodDates.ToString()) { throw new CustomException(Resources.Globalization.ValidationPromotionRecordExistWithThesePromotiosPeriodDatesText); } return(Json(new { PromotionPeriodID = PromotionPeriod.PromotionPeriodID }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetAbsence(int EmployeeCarrerHistoryID, int PromotionPeriodID) { EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID); PromotionsPeriodsBLL PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID); List <TimeAttendanceBLL> EmployeesEvaluationsBLLList = new EmployeesCodesBLL().GetAbsenceByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate); var data = EmployeesEvaluationsBLLList.Select(x => new { AbsenceDate = x.Date, }); return(Json(new { data = data }, JsonRequestBehavior.AllowGet)); }
public ActionResult Delete(PromotionsPeriodsViewModel PromotionPeriodVM) { PromotionsPeriodsBLL PromotionPeriod = new PromotionsPeriodsBLL(); PromotionPeriod.PromotionPeriodID = PromotionPeriodVM.PromotionPeriodID; PromotionPeriod.LoginIdentity = UserIdentity; Result result = PromotionPeriod.Remove(PromotionPeriod.PromotionPeriodID); if (result.EnumMember == PromotionsPeriodsValidationEnum.Done.ToString()) { } return(Json(new { PromotionPeriodID = PromotionPeriod.PromotionPeriodID }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetExceptionalVacations(int EmployeeCarrerHistoryID, int PromotionPeriodID) { EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID); PromotionsPeriodsBLL PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID); var data = new ExceptionalVacationsBLL().GetExceptionalVacationsByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new { VacationID = x.VacationID, VacationStartDate = x.VacationStartDate, VacationEndDate = x.VacationEndDate, VacationPeriod = x.VacationPeriod, }); return(Json(new { data = data }, JsonRequestBehavior.AllowGet)); //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet); }
public ActionResult GetStopWorks(int EmployeeCarrerHistoryID, int PromotionPeriodID) { EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID); PromotionsPeriodsBLL PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID); var data = new StopWorksBLL().GetByEmployeeCodeIDConvicted(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new { StopWorkID = x.StopWorkID, StopWorkStartDate = x.StopWorkStartDate, StopWorkPeriod = x.StopWorkPeriod, StopWorkEndDate = x.StopWorkEndDate, IsConvicted = x.IsConvicted }); return(Json(new { data = data }, JsonRequestBehavior.AllowGet)); //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet); }
public ActionResult GetScholarships(int EmployeeCarrerHistoryID, int PromotionPeriodID) { EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID); PromotionsPeriodsBLL PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID); var data = new BaseScholarshipsBLL().GetByEmployeeCodeIDNotPassed(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new { ScholarshipID = x.ScholarshipID, ScholarshipStartDate = x.ScholarshipStartDate, ScholarshipPeriod = x.ScholarshipPeriod, ScholarshipEndDate = x.ScholarshipEndDate, IsPassed = x.IsPassed }); return(Json(new { data = data }, JsonRequestBehavior.AllowGet)); //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet); }
public JsonResult GetPromotionsPeriods() { Session["PromotionRecordEmployees"] = null; var list = new PromotionsPeriodsBLL().GetPromotionsPeriods() .Select(x => new { PromotionPeriodID = x.PromotionPeriodID, Period = x.Period, Year = x.Year, PromotionStartDate = x.PromotionStartDate, PromotionEndDate = x.PromotionEndDate, IsActive = x.IsActive, CreatedBy = x.CreatedBy.Employee.EmployeeNameAr, CreatedDate = x.CreatedDate }); return(Json(new { data = list }, JsonRequestBehavior.AllowGet)); }
private PromotionsPeriodsViewModel GetByPromotionPeriodID(int id) { PromotionsPeriodsBLL PromotionPeriod = new PromotionsPeriodsBLL().GetByPromotionPeriodID(id); PromotionsPeriodsViewModel PromotionPeriodVM = new PromotionsPeriodsViewModel(); if (PromotionPeriod != null) { PromotionPeriodVM.PromotionPeriodID = PromotionPeriod.PromotionPeriodID; PromotionPeriodVM.YearID = PromotionPeriod.Year.MaturityYearID; PromotionPeriodVM.PeriodID = PromotionPeriod.Period.PeriodID; PromotionPeriodVM.MaturityYear = PromotionPeriod.Year.MaturityYear; PromotionPeriodVM.PeriodName = PromotionPeriod.Period.PeriodName; PromotionPeriodVM.PromotionStartDate = PromotionPeriod.PromotionStartDate; PromotionPeriodVM.PromotionEndDate = PromotionPeriod.PromotionEndDate; PromotionPeriodVM.IsActive = PromotionPeriod.IsActive.Value; } return(PromotionPeriodVM); }