public ApplyForLeaveViewModel GetEmployeeLeaveInfo(string IDNO) { DALLeave _leave = new DALLeave(); ApplyForLeaveViewModel temp = _leave.GetEmployeeLeaveInfo(IDNO); temp.IDNO = IDNO; temp.DateFiled = System.DateTime.Today.ToShortDateString(); temp.EmploymentStatus = temp.EmploymentStatus; temp.LeaveType = GetLeaveTypes(IDNO); temp.Manager = GetManagers(); return temp; }
public bool Apply(string IDNO, ApplyForLeaveViewModel model) { bool updatedLeaveCreditWithPay = true; bool apply = false; DALLeave _leave = new DALLeave(); //If leave type is VL/SL with Pay if(model.LessThisLeave != 0) { model.LessThisLeave = RoundLessThisLeave(model.LessThisLeave); updatedLeaveCreditWithPay = _leave.UpdateLeaveCreditWithPay(IDNO, model); } //Insert into dbo.Leave apply = _leave.Apply(IDNO, model); return (updatedLeaveCreditWithPay && apply); }
public IEnumerable<LeaveTypeModel> GetAllLeaveTypes() { DALLeave _leave = new DALLeave(); return _leave.GetAllLeaveTypes(); }
public bool DeleteLeave(int leaveID) { DALLeave _leave = new DALLeave(); return _leave.DeleteLeave(leaveID); }
public void Cancel(int LeaveID) { DALLeave _leave = new DALLeave(); return; }
public bool InsertDepartmentInfo() { DALLeave _leave = new DALLeave(); return _leave.InsertDepartmentInfo(); }
public IEnumerable<LeaveViewModel> GetPendingLeaves(string IDNO) { DALLeave _leave = new DALLeave(); return _leave.GetPendingLeaves(IDNO); }
public IEnumerable<LeaveViewModel> GetAllLeaves() { DALLeave _leave = new DALLeave(); var leaves = _leave.GetAllLeaves(); foreach(LeaveViewModel leave in leaves) { leave.Manager = _leave.GetManagerName(leave.LeaveID); } return leaves; }
public bool InsertLeaveCredit(LeaveCreditModel model) { DALLeave _leave = new DALLeave(); model.BeginningDate = CalculateBeginningDate(model.HireDate); model.CutOffDate = new DateTime(2016, 11, 30); model.CreditsAtCutOffInDays = Days360.CalculateDays360(model.BeginningDate, model.CutOffDate); model.CreditsAtCutOffInMonths = (float)model.CreditsAtCutOffInDays / 30f; float _creditsPerMonth = CalculateCreditsPerMonth(model.IDNO, model.LeaveType); model.LeaveCreditsPerMonth = _creditsPerMonth / 12f; model.UnusedLeavesDays = model.CreditsAtCutOffInMonths * model.LeaveCreditsPerMonth; model.UnusedLeavesHours = model.UnusedLeavesDays * 8f; model.LessLeaveAvailmentHours = 0; model.ConvertibleLeavesHours = model.UnusedLeavesHours - model.LessLeaveAvailmentHours; return _leave.InsertLeaveCredit(model); }
//public bool UpdateLeave() //{ //} public bool UpdateLeaveStatus(string IDNO, LeaveViewModel model) { DALLeave _leave = new DALLeave(); return _leave.UpdateLeaveStatus(IDNO, model); }
public IEnumerable<LeaveViewModel> Search(SearchViewModel model) { var minDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue; if(model.From < minDate) { model.From = minDate; } if (model.To < minDate) { model.To = minDate; } if (model.DateFiled < minDate) { model.DateFiled = minDate; } DALLeave _leave = new DALLeave(); return _leave.Search(model); }
public LeaveSummaryModel GetLeaveInfoSummary(int leaveID) { DALProfile _profile = new DALProfile(); DALLeave _leave = new DALLeave(); LeaveViewModel temp = _leave.GetLeaveInfo(leaveID); var profile = _profile.GetEmployeeProfile(temp.EmployeeIDNO); string name = profile.LastName + ", " + profile.FirstName + " " + profile.MiddleName; string manager = _leave.GetManagerName(leaveID); LeaveSummaryModel model = new LeaveSummaryModel(); model.EmployeeName = name; model.Manager = manager; model.Address = temp.Address; model.DateFiled = temp.DateFiled; model.DateOfLeaveFrom = temp.DateOfLeaveFrom; model.DateOfLeaveTo = temp.DateOfLeaveTo; model.DateResponded = temp.DateResponded; model.DurationInDays = temp.DurationInDays; model.DurationInHours = temp.DurationInHours; model.EmployeeIDNO = temp.EmployeeIDNO; model.EmploymentStatus = profile.EmploymentStatus; model.LeaveID = temp.LeaveID; model.LeaveStatus = temp.LeaveStatus; model.LeaveType = temp.LeaveType; model.Reason = temp.Reason; model.RemarksForEmployee = temp.RemarksForEmployee; model.RemarksForHR = temp.RemarksForHR; model.RespondedBy = temp.RespondedBy; return model; }
public LeaveViewModel GetLeaveInfo(int leaveID) { DALProfile _profile = new DALProfile(); DALLeave _leave = new DALLeave(); LeaveViewModel temp = _leave.GetLeaveInfo(leaveID); var profile = _profile.GetEmployeeProfile(temp.EmployeeIDNO); string name = profile.LastName + ", " + profile.FirstName + " " + profile.MiddleName; string manager = _leave.GetManagerName(leaveID); temp.EmployeeName = name; temp.Manager = manager; return temp; }
public int GetPendingLeavesCount(string IDNO) { DALLeave _leave = new DALLeave(); return _leave.GetPendingLeavesCount(IDNO); }
public IEnumerable<LeaveTypeModel> GetLeaveTypes(string IDNO) { DALLeave _leave = new DALLeave(); return _leave.GetLeaveTypes(IDNO); }
public List<string> GetIDNOs() { DALLeave _leave = new DALLeave(); return _leave.GetIDNOs(); }
public IEnumerable<ManagerModel> GetManagers() { DALLeave _leave = new DALLeave(); return _leave.GetManagers(); }
public bool InsertAdditionalInfo() { DALLeave _leave = new DALLeave(); return _leave.InsertAdditionalInfo(); }
public decimal GetLeaveCreditPreviousBalance(string IDNO, byte leaveType) { DALLeave _leave = new DALLeave(); return _leave.GetLeaveCreditPreviousBalance(IDNO, leaveType); }
public DateTime GetHireDate(string IDNO) { DALLeave _leave = new DALLeave(); return _leave.GetHireDate(IDNO).HireDate; }