예제 #1
0
        public ActionResult CommApprove(String tsIdList, string comment)
        {
            var us = _usService.GetUserSettingList().Where(p => p.UserId == CommonHelper.CurrentUser).FirstOrDefault();

            if (!(us != null && us.TeamId != 0))
            {
                return(Json(new { success = false, message = "请先在个人设置中设置科室!" }, JsonRequestBehavior.AllowGet));
            }
            if (!string.IsNullOrEmpty(tsIdList))
            {
                var operateTime = DateTime.Now;
                var idList      = tsIdList.Split(',');
                foreach (var id in idList)
                {
                    var ts = _appService.GetTimesheetsByID(int.Parse(id));
                    ts.Status       = ApproveStatus.Approved;
                    ts.Approver     = Common.CommonHelper.CurrentUser;
                    ts.ApprovedTime = operateTime;
                    AddOrEdit(ts);
                    _alService.AddApproveLog(new ApproveLog.ApproveLog()
                    {
                        WorkflowInstanceID = ts.WorkflowInstanceID,
                        OperateTime        = operateTime,
                        Comment            = comment,
                        OperateType        = "审批通过",
                        CurrentOperator    = Common.CommonHelper.CurrentUser,
                        NextOperator       = "",
                        Creator            = Common.CommonHelper.CurrentUser
                    });
                }
                return(Json(new { success = true, message = "审批通过工时数据成功!" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { success = false, message = "需要审批通过的工时数据为空!" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        private ActionResult GetAllApproveLog(string timesheetIdList)
        {
            List <ApproveLogForComment> alfc = new List <ApproveLogForComment>();
            var tsIdList = timesheetIdList.Split(',');
            List <Timesheet.Timesheet> tsList = new List <Timesheet.Timesheet>();

            foreach (var tsId in tsIdList)
            {
                tsList.Add(_tsService.GetTimesheetsByID(int.Parse(tsId.Trim())));
            }
            string workflowInstanceID = string.Empty;
            var    list = _alService.GetApproveLogByWorkflowInstanceID(workflowInstanceID);

            return(View(list));
        }
예제 #3
0
 public ActionResult AddOrEdit(int id = 0)
 {
     SetProjectListToViewData();
     if (id == 0)
     {
         return(View(new Timesheet.Timesheet()
         {
             Status = ApproveStatus.Draft
         }));
     }
     else
     {
         return(View(_appService.GetTimesheetsByID(id)));
     }
 }