public static void DoChangePermissionStatus(int id, String response) { LeavingPermission leavingPermission = ConnectionController.GetInstance().LeavingPermissions.Where(x => x.Id.Equals(id)).FirstOrDefault(); leavingPermission.ResponseStatus = response; ConnectionController.GetInstance().SaveChanges(); }
public static void DoRequestLeaving(String startTime, String endTime, String reason) { LeavingPermission leavingPermission = new LeavingPermission(); leavingPermission.EmployeeId = ActiveUserController.GetActiveEmployee().Id; leavingPermission.Reason = reason; leavingPermission.StartDate = Convert.ToDateTime(startTime); leavingPermission.EndDate = Convert.ToDateTime(endTime); leavingPermission.ResponseStatus = "Waiting"; ConnectionController.GetInstance().LeavingPermissions.Add(leavingPermission); ConnectionController.GetInstance().SaveChanges(); }