예제 #1
0
        public ActionResult GetMyApplyJson()
        {
            List <JsTreeData> treeList = new List <JsTreeData>();

            //添加一个未分类和全部客户的组别
            var        condition = "";
            JsTreeData addNode   = new JsTreeData("add:", "我发起的", "");

            treeList.Add(addNode);
            var dict_status = EnumHelper.GetMemberKeyValue <ApplyStatus>();

            foreach (string key in dict_status.Keys)
            {
                ApplyStatus status = (ApplyStatus)dict_status[key];

                condition = string.Format("Editor='{0}' AND Status={1}", CurrentUser.ID, (int)status);
                var count = BLLFactory <Apply> .Instance.GetRecordCount(condition);

                var id      = string.Format("add:{0}", (int)status);
                var name    = string.Format("{0}({1})", key, count);
                var subNode = new JsTreeData(id, name, "");
                addNode.children.Add(subNode);
            }

            var dict = BLLFactory <DictData> .Instance.FindByDictType("表单类型");

            JsTreeData todoNode = new JsTreeData("todo:", "我的待办", "");

            treeList.Add(todoNode);
            foreach (var info in dict)
            {
                var applyIdString = BLLFactory <ApplyUser> .Instance.GetApplyIdByUser(CurrentUser.ID);

                condition = string.Format("Category='{0}' AND ID IN ({1})", info.Value, applyIdString);
                var count = BLLFactory <Apply> .Instance.GetRecordCount(condition);

                var id      = string.Format("todo:{0}", info.Value);
                var name    = string.Format("{0}({1})", info.Name, count);
                var subNode = new JsTreeData(id, name, "");
                todoNode.children.Add(subNode);
            }

            JsTreeData doneNode = new JsTreeData("done:", "我的已办", "");

            treeList.Add(doneNode);
            foreach (var info in dict)
            {
                var applyIdString = BLLFactory <ApplyUser> .Instance.GetApplyIdDone(CurrentUser.ID);

                condition = string.Format("Category='{0}' AND ID IN ({1})", info.Value, applyIdString);
                var count = BLLFactory <Apply> .Instance.GetRecordCount(condition);

                var id      = string.Format("done:{0}", info.Value);
                var name    = string.Format("{0}({1})", info.Name, count);
                var subNode = new JsTreeData(id, name, "");
                doneNode.children.Add(subNode);
            }

            return(ToJsonContent(treeList));
        }
        public async Task <ApiRequestResult> DeveliverOrder([FromRoute] Guid id, ApplyStatus status)
        {
            var entity = await _orderReturnApplyRepository.GetAsync(id);

            entity.Status = status;
            await _orderReturnApplyRepository.UpdateAsync(entity);

            return(ApiRequestResult.Success("审核成功"));
        }
예제 #3
0
 public Apply(User user, Vacancy vacancy, int userId, int vacancyId)
 {
     Id        = currentId++;
     CreatedDt = DateTime.Now;
     User      = user;
     UserId    = userId;
     Vacancy   = vacancy;
     VacancyId = vacancyId;
     Status    = ApplyStatus.NotOperated;
 }
예제 #4
0
 public static string GetStatus(ApplyStatus status)
 {
     switch (status)
     {
         case ApplyStatus.Submitted:
             return "已申请";
         case ApplyStatus.Approved:
             return "批准";
         default:
             return "无效";
     }
 }
예제 #5
0
        /// <summary>
        /// 获取用户所在的群组信息
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="auditStatus">通过/未通过</param>
        /// <returns></returns>
        public static List <BizGroupInfo> GetUserGroupList(long userID, ApplyStatus status)
        {
            var lstGroupUser = BizGroupUser.LoadGroupUser(userID);

            if (lstGroupUser == null)
            {
                return(new List <BizGroupInfo>());
            }

            var groupUsers = lstGroupUser.Where(user => user.IsPass == (int)status);

            var lstGroupInfo = BizGroupInfo.LoadByGroupIDList(groupUsers.Select(model => model.GroupInfoID).ToList());

            return(lstGroupInfo);
        }
예제 #6
0
        //map to 状态
        private List <ApplyStatus> getModelList(SqlDataReader reader)
        {
            List <ApplyStatus> applyStatus = new List <ApplyStatus>();

            while (reader.Read())
            {
                ApplyStatus status = new ApplyStatus();
                status.PatientID    = GetReaderToString(reader["Patient_Usr_ID"]);
                status.ItemName     = GetReaderToString(reader["ItemName"]);
                status.ReviewStatus = GetReaderToString(reader["ReviewStatus"]);
                status.SubmitDate   = GetReaderToDateTimeString(reader["SubmitDate"]);
                applyStatus.Add(status);
            }
            return(applyStatus);
        }
예제 #7
0
        public ActionResult GetAllApplyJson()
        {
            List <JsTreeData> treeList = new List <JsTreeData>();
            JsTreeData        topNode  = new JsTreeData("1=1", "所有申请单", "");

            treeList.Add(topNode);

            var dict = BLLFactory <DictData> .Instance.FindByDictType("表单类型");

            var dict_status = EnumHelper.GetMemberKeyValue <ApplyStatus>();
            var condition   = "";

            //表单类型
            foreach (var info in dict)
            {
                condition = string.Format("Category='{0}'", info.Value);
                var count = BLLFactory <Apply> .Instance.GetRecordCount(condition);

                var id      = condition;
                var name    = string.Format("{0}({1})", info.Name, count);
                var subNode = new JsTreeData(id, name, "");
                topNode.children.Add(subNode);

                //表单状态
                foreach (string key in dict_status.Keys)
                {
                    ApplyStatus status = (ApplyStatus)dict_status[key];

                    var subCondition = string.Format("{0} AND Status={1}", condition, (int)status);
                    count = BLLFactory <Apply> .Instance.GetRecordCount(subCondition);

                    id   = subCondition;
                    name = string.Format("{0}({1})", key, count);
                    var statusNode = new JsTreeData(id, name, "");
                    subNode.children.Add(statusNode);
                }
            }

            return(ToJsonContent(treeList));
        }
예제 #8
0
        public IEnumerable<Apply> GetApplyByTimeRange(string user, DateTime date, int range, ApplyStatus status)
        {
            List<Apply> applies = new List<Apply>();

            Database db = DatabaseFactory.CreateDatabase();

            string sqlCommand = "SELECT [ID],[UserId],[ApplyDate],[TimeRange],"
                                + "[ApplyStatus],[DateCreated]"
                                + "FROM [Kpw_Applies] WHERE [ApplyDate]=@Date AND [TimeRange]=@TimeRange AND [ApplyStatus]=@ApplyStatus AND [UserId]=@UserId";

            DbCommand dbCommand = db.GetSqlStringCommand(sqlCommand);

            db.AddInParameter(dbCommand, "Date", DbType.DateTime, date);
            db.AddInParameter(dbCommand, "TimeRange", DbType.Int32, range);
            db.AddInParameter(dbCommand, "ApplyStatus", DbType.Int32, status);
            db.AddInParameter(dbCommand, "UserId", DbType.String, user);

            // DataSet that will hold the returned results
            using (IDataReader reader = db.ExecuteReader(dbCommand))
            {
                while (reader.Read())
                {
                    applies.Add(new Apply
                    {
                        ID = reader.GetInt32(0),
                        UserId = reader.GetString(1),
                        ApplyDate = reader.GetDateTime(2),
                        TimeRange = reader.GetInt32(3),
                        ApplyStatus = (ApplyStatus)reader.GetInt32(4),
                        CreatedDate = reader.GetDateTime(5)
                    });
                }
            }

            return applies;
        }