// GET: api/RecordApi?userId=[Guid]&beginTime=yyyy-MM-dd&endTime=yyyy-MM-dd public IEnumerable <WorkTimeModel> Get(Guid userId, DateTime beginTime, DateTime endTime) { WorkTimeLogic wtLogic = new WorkTimeLogic(); IEnumerable <WorkTimeModel> data = wtLogic.GetWorkTime(beginTime, endTime, userId); return(data); }
public ActionResult LoadWorkTimeByWeek(DateTime beginTime, DateTime endTime) { WorkTimeLogic wtLogic = new WorkTimeLogic(); var data = wtLogic.GetWorkTime(beginTime, endTime, UserContext.CurrentUser.UserId); return(Json(data)); }
public ActionResult WorkTimeApproved(Guid[] workTimeArray, bool?approved, bool?faultFlag, string faultReason) { WorkTimeLogic logic = new WorkTimeLogic(); var result = logic.WorkTimeApproved(workTimeArray, approved, UserContext.CurrentUser.UserId, faultFlag, faultReason); return(Json(new { Result = result })); }
public ActionResult DeleteRecord(Guid workTimeId) { WorkTimeLogic wtLogic = new WorkTimeLogic(); bool isApproved = false; var result = wtLogic.DeleteWorkTime(workTimeId, ref isApproved); return(Json(new { Result = result, IsApproved = isApproved })); }
public ActionResult InsertRecord(WorkTime workTime, WorkTimeSetting workTimeSetting) { workTime.EmployeeId = UserContext.CurrentUser.UserId; WorkTimeLogic wtLogic = new WorkTimeLogic(); var result = wtLogic.InsertWorkTime(workTime, workTimeSetting); return(Json(new { Result = result, Data = workTime })); }
public ActionResult LoadWorkTimeByMonth(int year, int month) { Guid employeeId = UserContext.CurrentUser.UserId; WorkTimeLogic wtLogic = new WorkTimeLogic(); var data = wtLogic.GetWorkTimeByMonth(employeeId, year, month); return(Json(data)); }
public ActionResult GetWorkTime(Guid?projectId, Guid?stageId, Guid?employeeId, DateTime?startTime, DateTime?endTime, int pageIndex, int pageSize) { WorkTimeLogic logic = new WorkTimeLogic(); int rowCount = 0; var result = logic.GetWorkTimes(projectId, stageId, employeeId, startTime, endTime, null, pageIndex, pageSize, out rowCount, true); return(Json(new { Result = result, RowCount = rowCount })); }
public ActionResult UpdateRecord(WorkTime workTime) { workTime.EmployeeId = UserContext.CurrentUser.UserId; WorkTimeLogic wtLogic = new WorkTimeLogic(); bool isApproved = false; var result = wtLogic.UpdateWorkTime(workTime, ref isApproved); return(Json(new { Result = result, Data = workTime, IsApproved = isApproved })); }
public ActionResult GetUnConfirmWorkTimes(Guid?projectId, Guid?stageId, Guid?employeeId, DateTime?beginTime, DateTime?endTime, string attendTypes, int pageIndex, int pageSize) { WorkTimeLogic logic = new WorkTimeLogic(); int rowCount; Guid? pmId = UserContext.CurrentUser.UserId; List <WorkTimeModel> data = logic.GetWorkTimes(projectId, stageId, employeeId, beginTime, endTime, attendTypes, pageIndex, pageSize, out rowCount, false, pmId); return(Json(new { Result = data, RowCount = rowCount })); }
public ActionResult RecordStatistic() { EmployeeLogic elogic = new EmployeeLogic(); ViewBag.Employees = elogic.GetAllEmployees(false); WorkTimeLogic wlogic = new WorkTimeLogic(); ViewBag.WorkHours = wlogic.GetWorkHours(); return(View()); }