Ejemplo n.º 1
0
        private LeaveTrackerDetails getLeaveDetails(string date)
        {
            MainBusiness mainBusinessObject = new MainBusiness();

            var result = new Vl.LeaveTracker.Models.LeaveTrackerDetails();
            if (date == null)
                date = DateTime.Now.ToString();
            var value = Convert.ToDateTime(date).ToShortDateString();
            var currentdate = Convert.ToDateTime(value);
            var startdateToPass = mainBusinessObject.GetStartDateForGivenCurrentDate(currentdate);
            var endddateToPass = mainBusinessObject.GetEndDateForGivenCurrentDate(currentdate);
            result = mainBusinessObject.GetLeaveTrackerDetailsForGivenDateRange(startdateToPass, endddateToPass);

            return result;
        }
Ejemplo n.º 2
0
 private int InsertLeaves(string leaveTypeID, string leaveFromDate, string leaveFromMonth, string leaveFromYear, string _employeeID, string _managerID)
 {
     MainBusiness mainBusinessObject = new MainBusiness();
     int leaveTid = Convert.ToInt32(leaveTypeID);
     int leaveFdate = Convert.ToInt32(leaveFromDate);
     string leaveFmonth = Convert.ToString(leaveFromMonth);
     int leaveFyear = Convert.ToInt32(leaveFromYear);
     int empid = Convert.ToInt32(_employeeID);
     int month = Convert.ToDateTime(leaveFdate + leaveFmonth + leaveFyear).Month;
     var user = new MainDetails();
     user.AppliedDate = DateTime.Now;
     user.EmpId = empid;
     user.LeaveFrom = new DateTime(leaveFyear, month, leaveFdate);
     user.LeaveTo = new DateTime(leaveFyear, month, leaveFdate);
     user.ManagerId = Convert.ToInt32(_managerID);
     user.LeaveTypeId = leaveTid;
     user.Reason = "Default";
     user.status = "pending";
     int leaveid = mainBusinessObject.InsertMainDetails(user);
     return leaveid;
 }
Ejemplo n.º 3
0
 private void DeleteLeave(string leaveID)
 {
     MainBusiness mainBusinessObject = new MainBusiness();
     int leaveIDtoDelete = Convert.ToInt32(leaveID);
     mainBusinessObject.DeleteMainDetails(leaveIDtoDelete);
 }