/// <summary>
        /// 画面显示时需要加载的审核数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormApprovalFlowCenter_Load(object sender, EventArgs e)
        {
            string msg = string.Empty;

            _approveFlowTypeList = PharmacyDatabaseService.AllApprovalFlowTypes(out msg).ToList();
            BindApprovalList();
        }
Example #2
0
        /// <summary>
        /// 初始化审批流程类型的listbox数据
        /// </summary>
        /// <param name="type"></param>
        private void initApprovalFlowTypeListBox(object type)
        {
            //审批流程类型初始化
            string resultMsg;
            var    list2 = PharmacyDatabaseService.AllApprovalFlowTypes(out resultMsg).OrderBy(r => r.Name).ToArray();

            if (type != null)
            {
                int iType = int.Parse(type.ToString());
                list2 = list2.Where(p => p.ApprovalTypeValue == iType).OrderBy(r => r.Name).ToArray();
            }
            this.lbApprovalFlowType.DisplayMember = "Name";
            this.lbApprovalFlowType.ValueMember   = "Id";
            this.lbApprovalFlowType.DataSource    = list2.ToList();
        }
        private void BindApprovalList()
        {
            btnCloseDetail_Click(null, null);
            this.dgvApprovalList.AutoGenerateColumns = false;
            //_approveFlowList.Clear();
            _approveFlowList = new List <Models.ApprovalFlow>();
            //未审核流程列表
            string msg = string.Empty;

            if (this.FlowID == Guid.Empty)
            {
                Guid currentUserID = AppClientContext.CurrentUser.Id;
                var  List          = PharmacyDatabaseService.GetApproveFlowsByUser(out msg, currentUserID).OrderByDescending(r => r.CreateTime).ToList();
                foreach (var approveFlow in List)
                {
                    if (_approveFlowTypeList.Exists(e => e.Id == approveFlow.ApprovalFlowTypeId))
                    {
                        _approveFlowList.Add(approveFlow);
                    }
                }
            }
            else //获取FlowID指定的审核流程并打开详细
            {
                var flow = PharmacyDatabaseService.GetApproveFlowsByFlowID(out msg, FlowID);
                if (flow == null)
                {
                    this.dgvApprovalList.DataSource = null;
                    MessageBox.Show("指定的审批流程不存在!");
                    this.Close();
                    return;
                }
                _approveFlowList.Add(flow);
            }
            this.dgvApprovalList.DataSource = _approveFlowList;

            //init
            ApprovalFlowType[] flowType      = PharmacyDatabaseService.AllApprovalFlowTypes(out msg);
            List <ListItem>    flowTypeItems = new List <ListItem>();

            foreach (var m in flowType)
            {
                flowTypeItems.Add(new ListItem(m.Id.ToString(), m.Name));
            }
            if (!_InitFieldValues.ContainsKey("事件"))
            {
                _InitFieldValues.Add("事件", flowTypeItems);
            }
        }
Example #4
0
        /// <summary>
        /// 绑定审核流程类型
        /// </summary>
        private void BindApproveFlow()
        {
            string msg = string.Empty;
            List <ApprovalFlowType> approveFlowList = PharmacyDatabaseService.AllApprovalFlowTypes(out msg).ToList();;

            if (approveFlowList == null)
            {
                throw new Exception(msg);
            }
            else
            {
                this.cmbApprovalType.DataSource    = approveFlowList;
                this.cmbApprovalType.DisplayMember = "Name";
                this.cmbApprovalType.ValueMember   = "Id";
            }
        }