Example #1
0
        TreeNode NodeHeader1 = new TreeNode();                                     //树头部

        public FormInstrument_CategoryIndexManagement()
        {
            InitializeComponent();
            NodeHeader1.Text        = "医疗器械分类树";
            NodeHeader1.Name        = "topNode";
            NodeHeader1.ToolTipText = "请选择分类目录";
            NodeHeader1.Checked     = true;
            this.treeView1.Nodes.Add(NodeHeader1);
            #region 第二层,3个管理类别
            codeList1.Add(new Tuple <int, string>(1, "I级管理"));
            codeList1.Add(new Tuple <int, string>(2, "II级管理"));
            codeList1.Add(new Tuple <int, string>(3, "III级管理"));
            codeList1.Add(new Tuple <int, string>(4, "其他"));
            #endregion
            this.comboBox1.SelectedIndex = 0;

            #region 器械分类文件读入
            if (!File.Exists("InstCategories.bin"))
            {
                MessageBox.Show("医疗器械分类文件丢失,请联系管理员!"); return;
            }
            this._instCategory = SearialiserHelper <InstCategoryIdx.NewInstCategory> .DeSerializeFileToObj("InstCategories.bin");

            #endregion


            #region 组织分类树:loadCateData
            Action <List <NewCategory> > loadCateData = CreateTree;
            #endregion

            #region 控件Load事件,装载TreeView
            this.Load += (s, e) =>
            {
                loadCateData(_instCategory.ListCategory);
            };
            #endregion

            #region 单击节点事件
            this.treeView1.NodeMouseClick += (s, e) =>
            {
                this.toolStripButton2.Enabled = e.Node.Tag != null;
                if (e.Node.Tag == null)
                {
                    return;
                }
                var d = e.Node.Tag as NewCategory;
                if (d == null)
                {
                    return;
                }

                this.CurrentImptClass        = (NewCategory)e.Node.Tag;
                this.comboBox1.SelectedIndex = this.CurrentImptClass.Category - 1;
                this.fs.FStatus       = FormStatusEnum.Edit;
                this.CurrentImptClass = (NewCategory)e.Node.Tag;
                this.imptClassBindingSource.Clear();
                this.imptClassBindingSource.Add(this.CurrentImptClass);
            };
            #endregion

            #region 保存和关闭按钮
            this.button1.Click += (s, e) =>
            {
                var re = MessageBox.Show("确定需要保存吗?", "提示", MessageBoxButtons.OKCancel);
                if (re == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }

                if (!this.ValidateRequiredTextBox())
                {
                    return;
                }

                this.CurrentImptClass.Category = this.comboBox1.SelectedIndex + 1;
                if (this.fs.FStatus == FormStatusEnum.New)
                {
                    this._instCategory.ListCategory.Add(this.CurrentImptClass);
                }

                SearialiserHelper <NewInstCategory> .SerializeObjToFile(this._instCategory, "InstCategories.bin");

                MessageBox.Show("保存成功!");
                this.CurrentImptClass = new NewCategory
                {
                    Category = 1,
                };
                this.imptClassBindingSource.Clear();
                this.imptClassBindingSource.Add(this.CurrentImptClass);
                this.comboBox1.SelectedIndex = 0;
                loadCateData(_instCategory.ListCategory);
            };

            this.button2.Click += (s, e) =>
            {
                this.Close();
            };
            #endregion

            #region  除按钮
            this.toolStripButton2.Click += (s, e) =>
            {
                if (this.treeView1.SelectedNode == null)
                {
                    return;
                }
                if (((NewCategory)this.treeView1.SelectedNode.Tag) == null)
                {
                    return;
                }
                var re = MessageBox.Show("删除分类节点吗?", "提示", MessageBoxButtons.OKCancel);
                if (re == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }
                var selectedImpt = (NewCategory)this.treeView1.SelectedNode.Tag;
                this._instCategory.ListCategory.Remove(selectedImpt);

                SearialiserHelper <NewInstCategory> .SerializeObjToFile(this._instCategory, "Category.data");

                MessageBox.Show("删除成功!");
                loadCateData(_instCategory.ListCategory);
                this.CurrentImptClass = new NewCategory
                {
                    Category = 1
                };
                this.comboBox1.SelectedIndex = 0;
                this.imptClassBindingSource.Clear();
                this.imptClassBindingSource.Add(this.CurrentImptClass);
            };
            #endregion

            this.imptClassBindingSource.Add(this.CurrentImptClass);
        }
Example #2
0
        public FormInstrument_CategoryIndex(NewInstCategory instC)
        {
            InitializeComponent();

            #region 读入分类目录
            this._instCategory = instC;
            TreeNode NodeHeader = new TreeNode();
            NodeHeader.Text        = "医疗器械分类树";
            NodeHeader.Name        = "topNode";
            NodeHeader.ToolTipText = "请选择分类目录";
            this.treeView1.Nodes.Add(NodeHeader);

            List <Tuple <int, string> > codeList = new List <Tuple <int, string> >();//头部三个管理类别
            #region 第二层,3个管理类别
            codeList.Add(new Tuple <int, string>(1, "I级管理"));
            codeList.Add(new Tuple <int, string>(2, "II级管理"));
            codeList.Add(new Tuple <int, string>(3, "III级管理"));
            #endregion
            #endregion
            #region 组织分类树:loadCateData
            Action <List <NewCategory> > loadCateData = (data) =>
            {
                this.treeView1.Nodes[0].Nodes.Clear();
                foreach (var row in codeList)    //三个管理分类
                {
                    TreeNode tn = new TreeNode();
                    tn.Name = row.Item1 + "(" + row.Item2 + ")";
                    tn.Text = row.Item2;

                    tn.Tag = "管理分类:" + row.Item1;
                    var nextCodeList = data.Where(r => r.Category == row.Item1).Distinct(r => r.Code).ToList();

                    foreach (var j in nextCodeList)    //满足分类管理码的记录
                    {
                        TreeNode tnSecond = new TreeNode();
                        tnSecond.Text        = j.Idx + "(" + j.CodeName + ")";
                        tnSecond.Name        = j.Idx.ToString();
                        tnSecond.ToolTipText = "产品目录";

                        tnSecond.Tag = "产品目录序号:" + j.Code;
                        var ChildList = data.Where(r => r.Code == j.Code && r.Category == j.Category).ToList();
                        foreach (var ch in ChildList.Distinct(r => r.CIdx))
                        {
                            TreeNode tnch = new TreeNode();
                            tnch.Text        = ch.CIdx + ch.Level1Name;
                            tnch.Name        = ch.CIdx;
                            tnch.Tag         = "一级产品类别序号:" + ch.CIdx + "\r\n 旧版对照表:\r\n  " + ch.Comparison;
                            tnch.ToolTipText = "一级产品类别";
                            var lastList = ChildList.Where(r => r.CIdx == ch.CIdx).ToList();
                            foreach (var last in lastList)
                            {
                                TreeNode tnla = new TreeNode();
                                tnla.Text        = last.SubIdx + last.Level2Name;
                                tnla.Name        = last.SubIdx;
                                tnla.ToolTipText = "二级产品类别";
                                tnla.Tag         = last;
                                tnch.Nodes.Add(tnla);
                            }
                            tnSecond.Nodes.Add(tnch);
                        }
                        tn.Nodes.Add(tnSecond);
                    }

                    NodeHeader.Nodes.Add(tn);
                }

                this.treeView1.Nodes[0].ExpandAll();
                this.treeView1.ShowNodeToolTips = true;
            };
            #endregion

            #region 控件Load事件
            this.Load += (s, e) =>
            {
                loadCateData(instC.ListCategory);
            };
            #endregion

            #region 分类码搜索
            this.textBox1.TextChanged += (s, e) =>
            {
                if (this.textBox1.Text.Trim().Length <= 2)
                {
                    return;
                }
                var list = instC.ListCategory.Where(r => r.Comparison.Contains(this.textBox1.Text.Trim())).OrderBy(r => r.Code).ToList();
                loadCateData(list);
            };
            #endregion

            #region 分类码搜索
            this.textBox2.TextChanged += (s, e) =>
            {
                if (this.textBox2.Text.Trim().Length <= 2)
                {
                    return;
                }
                var list = instC.ListCategory.Where(r => r.StandardCode.StartsWith(this.textBox2.Text.Trim())).OrderBy(r => r.Code).ToList();
                loadCateData(list);
            };
            #endregion

            #region 分类树节点双击选择代码
            this.treeView1.NodeMouseDoubleClick += (s, e) =>
            {
                if (e.Button != System.Windows.Forms.MouseButtons.Left)
                {
                    return;
                }
                if (e.Node.Tag == null || !(e.Node.Tag is NewCategory))
                {
                    return;
                }
                var cnode = e.Node;
                var c     = (NewCategory)cnode.Tag;
                if (SelectInstrumentIndexCode == null)
                {
                    return;
                }
                InstrumentCateIndexArgs ev = new InstrumentCateIndexArgs
                {
                    InstrumentIndexCode = c.StandardCode,
                    Category            = c.Category,
                    Description         = c.Description
                };
                SelectInstrumentIndexCode(this, ev);
            };
            #endregion

            #region 分类树单击事件
            this.treeView1.NodeMouseClick += (s, e) =>
            {
                if (e.Node.Tag == null || !(e.Node.Tag is NewCategory))
                {
                    return;
                }
                var i = (NewCategory)e.Node.Tag;
                this.label2.Text  = "完整代码:" + i.StandardCode + "\r\n";
                this.label2.Text += "管理分类:" + i.CategoryType + "\r\n";
                this.label2.Text += "产品描述:\r\n    " + i.Description.Trim() + "\r\n";
                this.label2.Text += "预期用途:\r\n    " + i.Usage.Trim() + "\r\n";
                this.label2.Text += "品名举例:\r\n    " + i.Example.Trim() + "\r\n";
                this.label2.Text += "旧版对照表:\r\n    " + i.Comparison;
            };
            #endregion
        }
Example #3
0
        /// <summary>
        /// 初始化方法-需设定读写FSE、实体entity
        /// </summary>
        public FormInstrument()
        {
            InitializeComponent();

            this.Text = this.FSE == FormStatusEnum.New ? "新建医疗器械信息" : this.FSE == FormStatusEnum.Edit ? "编辑医疗器械信息" : "查看医疗器械信息";


            #region 验证文本框
            this.AddTextBoxToValidator(this);
            #endregion

            #region 绑定实体

            int _count = 0;
            if (this.entity == null)
            {
                this.entity         = InitEntity();
                _count              = PharmacyDatabaseService.GetDrugInfoCount(string.Empty);
                this.entity.DocCode = "SPDA" + _count.ToString().PadLeft(6, '0');
                this.entity.Code    = "SPBH" + _count.ToString().PadLeft(6, '0');
            }
            #endregion

            #region 生成注记码和产品编号
            this.textBox1.LostFocus += (sender, e) =>
            {
                entity.Pinyin           = this.textBox1.Text.Trim() == string.Empty ? string.Empty : CreateChineseSpell.CreatePY(this.textBox1.Text.Trim());
                this.textBox2.Text      = entity.Pinyin;
                this.entity.ProductName = this.textBox1.Text.Trim();
            };
            #endregion

            #region 绑定存储条件
            this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
            var storageList = this.PharmacyDatabaseService.AllDictionaryStorageTypes(out msg).Where(r => !r.Deleted).OrderBy(r => r.Name).ToList();
            this.comboBox1.DisplayMember = "Name";
            this.comboBox1.ValueMember   = "Name";
            this.comboBox1.DataSource    = storageList;
            if (storageList.Count() > 0)
            {
                this.comboBox1.SelectedIndex = 0;
            }
            #endregion

            #region 绑定审批流程
            this.comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
            var ApprovalProceedureList = this.PharmacyDatabaseService.GetApprovalFlowTypeByBusiness(out msg, Models.ApprovalType.DrugInfoApproval).OrderBy(r => r.Name).ToList();

            this.comboBox2.DisplayMember = "Name";
            this.comboBox2.ValueMember   = "Id";
            this.comboBox2.DataSource    = ApprovalProceedureList;
            if (ApprovalProceedureList.Count() > 0)
            {
                comboBox2.SelectedIndex = 0;
            }
            #endregion

            #region 绑定仓库和库位
            this.comboBox3.DropDownStyle = ComboBoxStyle.DropDownList;
            this.comboBox4.DropDownStyle = ComboBoxStyle.DropDownList;
            var warehouseList = this.PharmacyDatabaseService.AllWarehouses(out msg).Where(r => !r.Deleted && r.Enabled).OrderBy(r => r.Name).ToList();
            this.comboBox3.DisplayMember = "Name";
            this.comboBox3.ValueMember   = "Id";
            this.comboBox3.DataSource    = warehouseList;
            if (warehouseList.Count() > 0)
            {
                this.comboBox3.SelectedIndex = 0;
            }

            var warehousezoneList = this.PharmacyDatabaseService.AllWarehouseZones(out msg).Where(r => !r.Deleted && r.Enabled).OrderBy(r => r.Name).ToList();
            this.comboBox4.DisplayMember = "Name";
            this.comboBox4.ValueMember   = "Id";

            var wz = warehousezoneList.Where(r => r.WarehouseId == (Guid)this.comboBox3.SelectedValue).ToList();
            this.comboBox4.DataSource = wz;
            if (wz.Count() > 0)
            {
                this.comboBox4.SelectedIndex = 0;
            }

            this.comboBox3.SelectedIndexChanged += (sender, e) =>
            {
                wz = warehousezoneList.Where(r => r.WarehouseId == (Guid)this.comboBox3.SelectedValue).ToList();
                this.comboBox4.DataSource = wz;
                if (wz.Count() > 0)
                {
                    this.comboBox4.SelectedIndex = 0;
                }
            };

            #endregion

            #region 器械分类判定码
            FormInstrument_CategoryTable frm = null;

            Func <string, bool> CheckInstrumentTypeStr = (s) =>
            {
                if (s == string.Empty)
                {
                    return(true);
                }
                if (s.Length < 6 || s.Length > 7)
                {
                    return(false);
                }
                if (!s.Contains("-"))
                {
                    return(false);
                }
                if (s.Substring(s.Length - 3, 1) != "-")
                {
                    return(false);
                }
                if (s[0] != 'A' && s[0] != 'B')
                {
                    return(false);
                }
                if (s[1] != 'A' && s[1] != 'B')
                {
                    return(false);
                }
                if (int.Parse(s[s.Length - 1].ToString()) > 3 || int.Parse(s[s.Length - 1].ToString()) < 1)
                {
                    return(false);
                }
                if (int.Parse(s[s.Length - 2].ToString()) > 3 || int.Parse(s[s.Length - 2].ToString()) < 1)
                {
                    return(false);
                }
                return(true);
            };

            this.linkLabel1.Click += (sender, e) =>
            {
                string str = this.entity.StandardCode.Trim();

                if (!CheckInstrumentTypeStr(str))
                {
                    if (MessageBox.Show("分类码错误!需要清空,并且重新设定吗?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        return;
                    }
                    else
                    {
                        this.entity.StandardCode = string.Empty;
                    }
                }

                if (frm == null || frm.IsDisposed)
                {
                    frm = new FormInstrument_CategoryTable(str);
                    frm.SelectInstrumentType += (sender1, e1) =>
                    {
                        this.entity.StandardCode = e1.InstrumentTypeStr;//设定为经营范围
                        drugInfoBindingSource.ResetBindings(false);
                        this.label35.Text = InstTypeInference.InstTypeInfereces(e1.InstrumentTypeStr);
                    };
                }
                frm.Hide();
                frm.Show(this);
            };
            #endregion

            #region 器械分类目录选择代码
            this.linkLabel2.Click += (s, e) =>
            {
                FormInstrument_CategoryIndex frmCateIdx = new FormInstrument_CategoryIndex(this._instCategory);
                frmCateIdx.Show(this);
                frmCateIdx.SelectInstrumentIndexCode += (s1, ev) =>
                {
                    this.textBox11.Text          = ev.InstrumentIndexCode;
                    this.entity.StandardCode     = ev.InstrumentIndexCode;
                    label35.Text                 = ev.Description;
                    this.comboBox5.SelectedIndex = ev.Category - 1;
                };
            };
            #endregion

            #region 管理分类combo
            this.comboBox5.DropDownStyle = ComboBoxStyle.DropDownList;
            this.comboBox5.SelectedIndex = 0;
            #endregion

            #region 录入人
            this.label21.Text = BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Employee.Name;
            #endregion

            #region Form_Load事件

            this.Load += (sender, e) =>
            {
                #region 器械分类文件读入
                if (!File.Exists("InstCategories.bin"))
                {
                    MessageBox.Show("医疗器械分类文件丢失,请联系管理员!"); return;
                }
                this._instCategory = SearialiserHelper <InstCategoryIdx.NewInstCategory> .DeSerializeFileToObj("InstCategories.bin");

                this.drugInfoBindingSource.Add(entity);
                #endregion

                #region 初始化工具条按钮显示
                if (FSE == FormStatusEnum.New)
                {
                    this.toolStripButton3.Visible = false;
                }
                if (FSE == FormStatusEnum.Edit)
                {
                    this.toolStripButton1.Visible = false;
                    this.toolStripButton3.Visible = true;
                }
                if (FSE == FormStatusEnum.Read)
                {
                    this.toolStripButton1.Visible = false;
                    this.toolStripButton3.Visible = false;
                }
                #endregion

                #region 审核Combo
                if (this.entity.FlowID != null && this.entity.FlowID != Guid.Empty)
                {
                    var ApprovalFlow = this.PharmacyDatabaseService.GetApproveFlowsByFlowID(out msg, entity.FlowID);

                    var AllApprovalTypes = this.PharmacyDatabaseService.AllApprovalFlowTypes(out msg).ToList();
                    if (entity.IsApproval)//如果审批结束
                    {
                        AllApprovalTypes             = AllApprovalTypes.Where(r => r.ApprovalType == Models.ApprovalType.DrugInfoEditApproval).ToList();
                        this.comboBox2.DataSource    = null;
                        this.comboBox2.DisplayMember = "Name";
                        this.comboBox2.ValueMember   = "Id";
                        this.comboBox2.DataSource    = AllApprovalTypes;
                        this.comboBox2.SelectedIndex = 0;
                    }
                    else//如果审批未结束
                    {
                        this.comboBox2.DataSource    = null;
                        this.comboBox2.DisplayMember = "Name";
                        this.comboBox2.ValueMember   = "Id";
                        this.comboBox2.DataSource    = AllApprovalTypes;
                        this.comboBox2.Enabled       = false;
                        this.comboBox2.SelectedValue = ApprovalFlow.ApprovalFlowTypeId;
                    }
                }
                #endregion

                #region 实体数据
                if (!string.IsNullOrEmpty(this.entity.DrugStorageTypeCode))
                {
                    this.comboBox1.SelectedValue = this.entity.DrugStorageTypeCode;
                }
                if (this.entity.WareHouses != null && this.entity.WareHouses != Guid.Empty)
                {
                    this.comboBox3.SelectedValue = entity.WareHouses;
                }
                if (!string.IsNullOrEmpty(this.entity.WareHouseZones))
                {
                    this.comboBox4.SelectedValue = Guid.Parse(entity.WareHouseZones);
                }

                if (!string.IsNullOrEmpty(this.entity.DrugCategoryCode))
                {
                    this.comboBox5.SelectedItem = entity.DrugCategoryCode;
                }

                var imptClasse = this._instCategory.ListCategory.FirstOrDefault(r => r.StandardCode == entity.StandardCode);
                this.label35.Text = imptClasse == null ? string.Empty : imptClasse.Description;
                #endregion
            };
            #endregion

            #region 提交事件
            this.toolStripButton1.Click += (sender, e) =>
            {
                if (MessageBox.Show("确定需要提交该医疗器械信息吗?", "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }
                this.Validate();

                if (!this.ValidateRequiredTextBox())
                {
                    return;                                   //验证文本框
                }
                if (this.comboBox1.SelectedItem == null)
                {
                    MessageBox.Show("请选择存储方式!"); return;
                }
                this.entity.DrugStorageTypeCode = ((Models.DictionaryStorageType) this.comboBox1.SelectedItem).Name;

                this.entity.WareHouses = (Guid)this.comboBox3.SelectedValue;
                if (warehousezoneList.Count <= 0)
                {
                    MessageBox.Show("您所选择的仓库没有设定库位(货架),请选择其他仓库!");
                    return;
                }
                this.entity.WareHouseZones = this.comboBox4.SelectedValue.ToString();

                this.entity.DrugCategoryCode = this.comboBox5.SelectedItem.ToString();

                this.entity.FlowID = Guid.NewGuid();

                this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;//开始提交

                var b = this.PharmacyDatabaseService.AddDrugInfoApproveFlow(this.entity, (Guid)this.comboBox2.SelectedValue, BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "新增医疗器械:" + this.entity.ProductGeneralName);

                if (b == string.Empty)
                {
                    MessageBox.Show("新增医疗器械:" + this.entity.ProductGeneralName + "成功!");
                    this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "新增医疗器械:" + this.entity.ProductGeneralName);

                    this.drugInfoBindingSource.Clear();
                    this.entity = default(Models.DrugInfo);
                    this.entity = InitEntity();
                    this.drugInfoBindingSource.Add(this.entity);
                    _count = PharmacyDatabaseService.GetDrugInfoCount(string.Empty);

                    this.entity.DocCode           = "SPDA" + _count.ToString().PadLeft(6, '0');
                    this.textBox3.Text            = this.entity.DocCode;
                    this.entity.Code              = "SPBH" + _count.ToString().PadLeft(6, '0');
                    this.textBox18.Text           = this.entity.Code;
                    this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;//结束提交
                }
                else
                {
                    MessageBox.Show("提交失败,请稍后重试!");
                    this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;//结束提交
                }
            };

            #endregion

            #region 保存编辑数据按钮
            this.toolStripButton3.Click += (sender, e) =>
            {
                if (this.FSE != FormStatusEnum.Edit)
                {
                    return;
                }
                if (MessageBox.Show("确定需要保存该医疗器械信息吗?", "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }
                this.Validate();

                if (!this.ValidateRequiredTextBox())
                {
                    return;                                   //验证文本框
                }
                if (this.comboBox1.SelectedItem == null)
                {
                    MessageBox.Show("请选择存储方式!"); return;
                }
                this.entity.DrugStorageTypeCode = ((Models.DictionaryStorageType) this.comboBox1.SelectedItem).Name;

                this.entity.WareHouses     = (Guid)this.comboBox3.SelectedValue;
                this.entity.WareHouseZones = this.comboBox4.SelectedValue.ToString();
                this.entity.PermitOutDate  = DateTime.Now.AddYears(50).Date;

                this.entity.DrugCategoryCode = this.comboBox5.SelectedItem.ToString();
                this.entity.Valid            = false;
                Guid typeid = (Guid)this.comboBox2.SelectedValue;
                if (entity.IsApproval || entity.ApprovalStatusValue == (int)Models.ApprovalStatus.Reject)
                {
                    entity.ApprovalStatus = Models.ApprovalStatus.Waitting;
                    entity.IsApproval     = false;
                    entity.FlowID         = Guid.NewGuid();

                    this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;//开始提交
                    msg = PharmacyDatabaseService.ModifyDrugInfoApproveFlow(entity, typeid, BugsBox.Pharmacy.AppClient.Common.AppClientContext.CurrentUser.Id, "审核后修改医疗器械信息:" + entity.ProductGeneralName);
                    if (string.IsNullOrEmpty(msg))
                    {
                        MessageBox.Show("提交成功!");
                        if (this.InstrumentInfoSubmit != null)
                        {
                            this.InstrumentInfoSubmit(this, true);
                        }
                        this.Dispose();
                    }
                    else
                    {
                        MessageBox.Show("提交失败,请稍后再试!");
                        this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;
                        return;
                    }
                }
                else
                {
                    entity.ApprovalStatus         = Models.ApprovalStatus.Waitting;
                    this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;//开始提交

                    msg = PharmacyDatabaseService.ModifyDrugInfoApproveFlow(entity, typeid, BugsBox.Pharmacy.AppClient.Common.AppClientContext.CurrentUser.Id, "审核前修改医疗器械信息" + entity.ProductGeneralName);
                    if (string.IsNullOrEmpty(msg))
                    {
                        MessageBox.Show("提交成功!");
                        if (this.InstrumentInfoSubmit != null)
                        {
                            this.InstrumentInfoSubmit(this, true);
                        }
                        this.Dispose();
                    }
                    else
                    {
                        MessageBox.Show("提交失败,请稍后再试!");
                        this.toolStripButton3.Enabled = !this.toolStripButton3.Enabled;
                        return;
                    }
                }
            };
            #endregion
        }
Example #4
0
        TreeNode NodeHeader = new TreeNode();                                     //树头部
        public FormGSPLicense(Guid guid, string legalPerson, string qualityCharger, string name, string address, string wareHouseAddress)
        {
            InitializeComponent();
            this._gspLiscenceId = guid;

            #region 读入分类目录数据文件
            this._instCategory = SearialiserHelper <InstCategoryIdx.NewInstCategory> .DeSerializeFileToObj("InstCategories.bin");

            NodeHeader.Text        = "医疗器械分类树";
            NodeHeader.Name        = "topNode";
            NodeHeader.ToolTipText = "请选择分类目录";
            NodeHeader.Checked     = true;
            this.treeView1.Nodes.Add(NodeHeader);

            #region 第二层,3个管理类别
            codeList.Add(new Tuple <int, string>(1, "I级管理"));
            codeList.Add(new Tuple <int, string>(2, "II级管理"));
            codeList.Add(new Tuple <int, string>(3, "III级管理"));
            #endregion

            #endregion

            #region 经营方式
            var bussinesstypes = this.PharmacyDatabaseService.AllBusinessTypes(out msg).OrderBy(r => r.Name).ToList();
            this.comboBoxBusinessTypeId.DisplayMember = "Name";
            this.comboBoxBusinessTypeId.ValueMember   = "Id";
            this.comboBoxBusinessTypeId.DataSource    = bussinesstypes;
            #endregion

            #region 初始化gsp对象和分类码列表
            if (this._gspLiscenceId != Guid.Empty)
            {
                this._gspLiscence = PharmacyDatabaseService.GetGSPLicense(out msg, this._gspLiscenceId);
                this._fs.FStatus  = FormStatusEnum.Edit;

                foreach (var i in this._instCategory.ListCategory)
                {
                    i.IsChecked = false;
                }

                foreach (var row in this._gspLiscence.GMSPLicenseBusinessScopes.OrderBy(r => r.BusinessScopeCode).Where(r => r.Deleted == false))
                {
                    this._instCategory.ListCategory.FirstOrDefault(r => r.StandardCode == row.BusinessScopeCode).IsChecked = true;
                }
            }
            else
            {
                this._gspLiscence = new GSPLicense
                {
                    Name             = "分类控制中心",
                    RegAddress       = address,
                    WarehouseAddress = wareHouseAddress,
                    LegalPerson      = legalPerson,
                    QualityHeader    = qualityCharger,
                    BusinessTypeId   = bussinesstypes.FirstOrDefault().Id,
                    Header           = legalPerson,
                    Code             = "无",
                    ChangeRecord     = DateTime.Now.Date.ToLongDateString(),
                    DocNumber        = "无",
                    IssuanceDate     = DateTime.Now.Date,
                    IssuanceOrg      = "无",
                    LicenseCode      = "无",
                    LicenseType      = LicenseType.GSP,
                    OutDate          = DateTime.Now.Date.AddYears(50),
                    StartDate        = DateTime.Now.Date,
                    StoreId          = BugsBox.Pharmacy.Config.PharmacyServiceConfig.Config.CurrentStore.Id,
                    Valid            = true,
                    UnitName         = name,
                    Id = Guid.NewGuid(),
                    GMSPLicenseBusinessScopes = new List <GMSPLicenseBusinessScope>()
                };
            }
            this.gSPLicenseBindingSource.Clear();
            this.gSPLicenseBindingSource.Add(this._gspLiscence);
            #endregion

            #region 分类树双击加入代码列表
            this.treeView1.NodeMouseClick += (s, e) =>
            {
            };
            #endregion
        }