Exemplo n.º 1
0
        /// <summary>
        /// //打开详细流程记录, 审批流程表(上表)里的一条被选中后,把详细审批过程写入审批流程详细表(下表)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvApprovalList_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }

                string msg = string.Empty;
                Models.ApprovalFlow flow = _approveFlowList[e.RowIndex];

                if (this.dgvApprovalNodeList.Tag == null ||
                    flow.Id != (Guid)this.dgvApprovalNodeList.Tag)
                {
                    List <ApprovalDetailsModel> approveList = new List <ApprovalDetailsModel>();
                    approveList = PharmacyDatabaseService.GetApprovalDetails(out msg, flow.FlowId, flow.SubFlowId, new object[] {}).ToList();
                    this.dgvApprovalNodeList.AutoGenerateColumns = false;
                    this.dgvApprovalNodeList.DataSource          = approveList;
                    this.dgvApprovalNodeList.Tag = flow.Id;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 审批通过
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAccept_Click(object sender, EventArgs e)
 {
     if (this.dgvApprovalList.Rows.Count <= 0)
     {
         return;
     }
     try
     {
         btnAccept.Enabled = false;
         if (dgvApprovalList.CurrentRow != null)
         {
             int currRowIndex = dgvApprovalList.CurrentRow.Cells[0].RowIndex;
             Models.ApprovalFlow approveFlow = _approveFlowList[currRowIndex];
             string msg = string.Empty;
             msg = PharmacyDatabaseService.SetApproveAction(approveFlow, "APPROVE", AppClientContext.CurrentUser.Id, string.IsNullOrWhiteSpace(this.txtOperatorReason.Text) ? "无" : this.txtOperatorReason.Text);
             if (msg.Length > 0)
             {
                 MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 BindApprovalList();
                 BindApprovalNodeList(approveFlow);
                 this.txtOperatorReason.Text = string.Empty;
                 this.PharmacyDatabaseService.WriteLog(AppClientContext.CurrentUser.Id, "执行审批记录通过操作成功:(" + approveFlow.ChangeNote + ")");
             }
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     btnAccept.Enabled = true;
 }
Exemplo n.º 3
0
        private void BindApprovalNodeList(Models.ApprovalFlow approveFlow)
        {
            string msg = string.Empty;
            List <ApprovalDetailsModel> approveList = new List <ApprovalDetailsModel>();

            approveList = PharmacyDatabaseService.GetApprovalDetails(out msg, approveFlow.FlowId, approveFlow.SubFlowId, new object[] { }).ToList();
            this.dgvApprovalNodeList.AutoGenerateColumns = false;
            this.dgvApprovalNodeList.DataSource          = approveList;
            this.dgvApprovalNodeList.Tag = approveFlow.Id;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 打开详细的审批对象信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvApprovalList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            //加入详细画面
            //this.plDetailView.Container.Add(UserControl);
            if (dgvApprovalList.Columns[e.ColumnIndex].Name == "查看详细")
            {
                Models.ApprovalFlow flow = dgvApprovalList.Rows[e.RowIndex].DataBoundItem as Models.ApprovalFlow;
                if (flow != null)
                {
                    string           msg      = string.Empty;
                    ApprovalFlowType flowType = PharmacyDatabaseService.GetApprovalFlowType(out msg, flow.ApprovalFlowTypeId);
                    switch (flowType.ApprovalTypeValue)
                    {
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitEditApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitLockApproval:
                        ucSupplyUnit uc = new ucSupplyUnit(flow.FlowId);
                        uc.Name = "DetailView";
                        this.plDetailView.Controls.Add(uc);
                        break;

                    case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoEditApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoLockApproval:
                        ucGoodsInfo ucdi = new ucGoodsInfo();
                        ucdi.Name = "DetailView";
                        this.plDetailView.Controls.Add(ucdi);
                        break;

                    case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitEditApproval:
                    case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitLockApproval:
                        ucPurchaseUnit ucpu = new ucPurchaseUnit(flow.FlowId);
                        ucpu.Name = "DetailView";
                        this.plDetailView.Controls.Add(ucpu);
                        break;
                    }
                }

                //显示详细
                this.plDetailView.BringToFront();
                this.plDetailView.Visible = true;
            }
            else //打开详细流程记录, 审批流程表(上表)里的一条被选中后,把详细审批过程写入审批流程详细表(下表)
            {
                dgvApprovalList_RowEnter(sender, e);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 打开详细流程记录, 审批流程表(上表)里的一条被选中后,把详细审批过程写入审批流程详细表(下表)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvApprovalList_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                string msg = string.Empty;
                Models.ApprovalFlow flow = _approveFlowList[e.RowIndex];

                if (this.dgvApprovalNodeList.Tag == null ||
                    flow.Id != (Guid)this.dgvApprovalNodeList.Tag)
                {
                    List <ApprovalFlowRecord> approveList = new List <ApprovalFlowRecord>();
                    approveList = PharmacyDatabaseService.GetFinishApproveFlowsRecord(out msg, flow.FlowId, flow.SubFlowId).OrderBy(p => p.CreateTime).ToList();
                    this.dgvApprovalNodeList.AutoGenerateColumns = false;
                    this.dgvApprovalNodeList.DataSource          = approveList;
                    this.dgvApprovalNodeList.Tag = flow.Id;
                }
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 拒绝审批
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnReject_Click(object sender, EventArgs e)
 {
     if (this.dgvApprovalList.Rows.Count <= 0)
     {
         return;
     }
     if (MessageBox.Show("确定要拒绝该审批吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.OK)
     {
         return;
     }
     try
     {
         if (dgvApprovalList.CurrentRow != null)
         {
             int currRowIndex = dgvApprovalList.CurrentRow.Cells[0].RowIndex;
             Models.ApprovalFlow approveFlow = _approveFlowList[currRowIndex];
             string msg = string.Empty;
             msg = PharmacyDatabaseService.SetApproveAction(approveFlow, "REJECT", AppClientContext.CurrentUser.Id, string.IsNullOrWhiteSpace(this.txtOperatorReason.Text) ? "无" : this.txtOperatorReason.Text);
             if (msg.Length > 0)
             {
                 MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 BindApprovalList();
                 BindApprovalNodeList(approveFlow);
                 this.txtOperatorReason.Text = string.Empty;
                 this.PharmacyDatabaseService.WriteLog(AppClientContext.CurrentUser.Id, "执行审批记录拒绝操作成功");
             }
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// 打开详细的审批对象信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvApprovalList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }

                //加入详细画面
                if (dgvApprovalList.Columns[e.ColumnIndex].Name == "查看详细")
                {
                    if (dgvApprovalList.Rows[e.RowIndex].Cells[4].Value != null)
                    {
                        string msg = string.Empty;
                        Models.ApprovalFlow flow     = _approveFlowList[e.RowIndex];
                        ApprovalFlowType    flowType = PharmacyDatabaseService.GetApprovalFlowType(out msg, flow.ApprovalFlowTypeId);
                        switch (flowType.ApprovalTypeValue)
                        {
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitEditApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitLockApproval:
                            ucSupplyUnit uc = new ucSupplyUnit(flow.FlowId);
                            uc.Name = "DetailView";
                            this.plDetailView.Controls.Add(uc);
                            break;

                        case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoEditApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoLockApproval:
                            DrugInfo di = this.PharmacyDatabaseService.GetDrugInfoByFlowID(out msg, flow.FlowId);
                            if (di.BusinessScopeCode.Contains("医疗器械"))
                            {
                                BaseDataManage.FormInstrument frmInstrument = new BaseDataManage.FormInstrument
                                {
                                    entity = di,
                                };
                                Common.SetControls.SetControlReadonly(frmInstrument, true);
                                frmInstrument.FSE = FormStatusEnum.Read;
                                frmInstrument.ShowDialog();
                                return;
                            }
                            else
                            {
                                ucGoodsInfo ucdi = new ucGoodsInfo(di);
                                Common.SetControls.SetControlReadonly(ucdi, true);
                                ucdi.Name = "DetailView";
                                this.plDetailView.Controls.Add(ucdi);
                            }
                            break;

                        case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitEditApproval:
                        case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitLockApproval:
                            ucPurchaseUnit ucpu = new ucPurchaseUnit(flow.FlowId);
                            ucpu.Name = "DetailView";
                            this.plDetailView.Controls.Add(ucpu);
                            break;

                        case (int)BugsBox.Pharmacy.Models.ApprovalType.drugsUnqualityApproval:
                            Business.Models.drugsUnqualificationQuery dq = PharmacyDatabaseService.getDrugsUnqualificationQueryByFlowID(flow.FlowId, out msg);
                            ucDrugsUnqualification ucdu = new ucDrugsUnqualification(dq);
                            ucdu.initApprovalDetail(flow.FlowId);
                            ucdu.Name = "DetailView";
                            this.plDetailView.Controls.Add(ucdu);
                            break;

                        case (int)ApprovalType.drugsBreakageApproval:
                            DrugsBreakage  db   = PharmacyDatabaseService.GetDrugsBreakageByFlowID(flow.FlowId, out msg);
                            UcDrugBreakage ucdb = new UcDrugBreakage(db, flow);
                            ucdb.Name = "DetailView";
                            this.plDetailView.Controls.Add(ucdb);
                            break;

                        case (int)ApprovalType.VehicleApproval:
                            Vehicle v = this.PharmacyDatabaseService.GetVehicleByFlowID(flow.FlowId, out msg);
                            if (v == null)
                            {
                                return;
                            }
                            DataDictionary.FormVehicleEdit frm = new DataDictionary.FormVehicleEdit(v, true);
                            frm.ShowDialog();
                            return;

                        case (int)ApprovalType.DirectSalesApproval:
                            DirectSalesOrder dso  = this.PharmacyDatabaseService.GetDirectSalesOrderByFlowId(flow.FlowId, out msg);
                            UCDirectSales    UCDS = new UCDirectSales(dso);
                            UCDS.Name = "DetailView";
                            this.plDetailView.Controls.Add(UCDS);
                            break;
                        }
                    }

                    //显示详细
                    this.plDetailView.BringToFront();
                    this.plDetailView.Visible = true;
                }
                else //打开详细流程记录, 审批流程表(上表)里的一条被选中后,把详细审批过程写入审批流程详细表(下表)
                {
                    dgvApprovalList_RowEnter(sender, e);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }