Esempio n. 1
0
        // 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);
        }
Esempio n. 2
0
        public ActionResult LoadWorkTimeByWeek(DateTime beginTime, DateTime endTime)
        {
            WorkTimeLogic wtLogic = new WorkTimeLogic();
            var           data    = wtLogic.GetWorkTime(beginTime, endTime, UserContext.CurrentUser.UserId);

            return(Json(data));
        }
Esempio n. 3
0
        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 }));
        }
Esempio n. 4
0
        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 }));
        }
Esempio n. 5
0
        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 }));
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
        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 }));
        }
Esempio n. 8
0
        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 }));
        }
Esempio n. 9
0
        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 }));
        }
Esempio n. 10
0
        public ActionResult RecordStatistic()
        {
            EmployeeLogic elogic = new EmployeeLogic();

            ViewBag.Employees = elogic.GetAllEmployees(false);
            WorkTimeLogic wlogic = new WorkTimeLogic();

            ViewBag.WorkHours = wlogic.GetWorkHours();
            return(View());
        }