コード例 #1
0
ファイル: Function.cs プロジェクト: ewin66/Management-System
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="alList">需打印函数</param>
        public void PrintDrugConsume(System.Collections.ArrayList alData)
        {
            if (IPrintConsume == null)
            {
                if (InitConsumePrintInterface() == -1)
                {
                    return;
                }
            }

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();

            Neusoft.FrameWork.Models.NeuObject        dept = ((Neusoft.HISFC.Models.Base.Employee)dataManager.Operator).Dept;
            Neusoft.HISFC.Models.Base.OperEnvironment oper = new Neusoft.HISFC.Models.Base.OperEnvironment();
            oper.ID   = dataManager.Operator.ID;
            oper.Name = dataManager.Operator.Name;

            SortStockDept sort = new SortStockDept();

            alData.Sort(sort);

            IPrintConsume.SetTitle(oper, dept);

            IPrintConsume.SetExecOrder(alData);

            IPrintConsume.Print();
        }
コード例 #2
0
        /// <summary>
        /// Noon的一个复本

        /// </summary>
        /// <returns></returns>
        public new Noon Clone()
        {
            Noon Noon = base.Clone() as Noon;

            Noon.oper = this.oper.Clone();

            return(Noon);
        }
コード例 #3
0
        public void SetTitle(Neusoft.HISFC.Models.Base.OperEnvironment oper, Neusoft.FrameWork.Models.NeuObject dept)
        {
            if (oper.OperTime == System.DateTime.MinValue)
            {
                Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
                oper.OperTime = dataManager.GetDateTimeFromSysDateTime();
            }

            this.lbTitl.Text = dept.Name + "领药单";

            this.lbPrintTime.Text = "打印时间:" + oper.OperTime.ToString();
        }
コード例 #4
0
        /// <summary>
        /// 保存申请
        /// </summary>
        /// <returns></returns>
        public virtual int SaveApply()
        {
            ArrayList alCheck = this.GetCheckData();

            if (alCheck.Count == 0)
            {
                return(0);
            }

            Neusoft.HISFC.BizLogic.Pharmacy.Item itemManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item();

            DateTime sysTime = itemManager.GetDateTimeFromSysDateTime();

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction t = new Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();

            itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            //暂时不处理药柜问题

            Neusoft.HISFC.Models.Base.OperEnvironment compoundOper = new Neusoft.HISFC.Models.Base.OperEnvironment();
            compoundOper.OperTime = sysTime;
            compoundOper.ID       = this.approveOper.ID;

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alCheck)
            {
                if (itemManager.UpdateCompoundApplyOut(info, compoundOper, true) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Language.Msg("更新配置确认信息发生错误") + itemManager.Err);
                    return(-1);
                }
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();

            MessageBox.Show(Language.Msg("保存成功"));

            this.ShowList();

            return(1);
        }
コード例 #5
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <returns></returns>
        protected int Init()
        {
            this.compoundOper = new Neusoft.HISFC.Models.Base.OperEnvironment();

            this.compoundOper.ID   = this.orderManager.Operator.ID;
            this.compoundOper.Name = this.orderManager.Operator.Name;
            this.compoundOper.Dept = ((Neusoft.HISFC.Models.Base.Employee) this.orderManager.Operator).Dept;

            DateTime sysTime = this.orderManager.GetDateTimeFromSysDateTime();

            dtBegin = sysTime.AddDays(-this.beforeDays);
            dtEnd   = sysTime.AddDays(this.afterDays);

            this.SetQueryTimeShow();

            this.InitDeptTree();

            this.InitPrintInterface();

            return(1);
        }
コード例 #6
0
        /// <summary>
        /// 取化疗医嘱时间
        /// </summary>
        /// <param name="strDate"></param>
        /// <param name="injectDate"></param>
        /// <returns></returns>
        private List <Neusoft.HISFC.Models.Base.OperEnvironment> GetOrderDate(string strDate, DateTime injectDate)
        {
            //{7E8FD8F7-AB9D-47ce-A245-37F8BE2D023D} 异常处理 增加界面提示信息
            try
            {
                strDate = strDate.ToLower();//所有字母都转小写

                List <Neusoft.HISFC.Models.Base.OperEnvironment> listDate = new List <Neusoft.HISFC.Models.Base.OperEnvironment>();
                if (strDate.IndexOf('-') > 0)
                {
                    //例如: d1-d8,那么用-分隔后就是一个有两个元素的数组,0为开始日期,1为结束日期
                    //要求这个字符串必须连续,不能这样d1,d2,d3-d5,这种格式处理不了
                    string[] temp  = strDate.Split(new char[] { '-' });
                    int      begin = int.Parse(temp[0].Replace("d", "").Trim()) - 1; //从当前日期开始啊,所以减一
                    int      end   = int.Parse(temp[1].Replace("d", "").Trim()) - 1; //既然开始日期减一了,那结束日期也必须啊

                    Neusoft.HISFC.Models.Base.OperEnvironment obj = null;
                    for (int i = begin; i <= end; i++)
                    {
                        obj          = new Neusoft.HISFC.Models.Base.OperEnvironment();
                        obj.OperTime = injectDate.AddDays(i);
                        obj.ID       = "d" + Convert.ToString(i + 1) + "(" + obj.OperTime.ToShortDateString() + ")";
                        listDate.Add(obj);
                    }
                }
                else if (strDate.IndexOf(',') > 0)
                {
                    //例如: d1,d2,d4,d8,那么用,分隔后就是一个数组
                    string[] temp = strDate.Split(new char[] { ',' });
                    int[]    days = new int[temp.Length];

                    for (int i = 0; i < temp.Length; i++)
                    {
                        if (temp[i] != "")
                        {
                            days[i] = int.Parse(temp[i].Replace("d", "").Trim()) - 1; //从当前日期开始啊,所以所有的值都需要减一
                        }
                    }

                    Neusoft.HISFC.Models.Base.OperEnvironment obj = null;
                    for (int i = 0; i < days.Length; i++)
                    {
                        obj          = new Neusoft.HISFC.Models.Base.OperEnvironment();
                        obj.OperTime = injectDate.AddDays(days[i]);
                        obj.ID       = "d" + Convert.ToString(days[i] + 1) + "(" + obj.OperTime.ToShortDateString() + ")";
                        listDate.Add(obj);
                    }
                }
                else
                {
                    MessageBox.Show("输入信息格式不正确,请参照蓝色提示信息输入正确信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    return(null);
                }

                return(listDate);
            }
            catch (Exception ex)
            {
                MessageBox.Show("输入信息格式不正确,请参照蓝色提示信息输入正确信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return(null);
            }
        }
コード例 #7
0
        protected override int OnSave(object sender, object neuObject)
        {
            if (this.Valid() == false)
            {
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            Neusoft.HISFC.BizProcess.Integrate.Pharmacy phaProcess = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
            this.itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            DateTime sysTime = this.itemManager.GetDateTimeFromSysDateTime();

            //操作环境信息
            Neusoft.HISFC.Models.Base.OperEnvironment operEnvironment = new Neusoft.HISFC.Models.Base.OperEnvironment();
            operEnvironment.OperTime = sysTime;
            operEnvironment.ID       = this.itemManager.Operator.ID;
            operEnvironment.Name     = this.itemManager.Operator.Name;
            //当前库存科室
            Neusoft.FrameWork.Models.NeuObject stockDept = ((Neusoft.HISFC.Models.Base.Employee) this.itemManager.Operator).Dept;
            //出库单号
            string outListNO = phaProcess.GetInOutListNO(stockDept.ID, false);
            //入库批次号
            string groupNO = this.itemManager.GetNewGroupNO();

            if (groupNO == null)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("获取新协定处方批次号发生错误 " + this.itemManager.Err);
                return(-1);
            }

            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("协定处方包装库存处理...");
            Application.DoEvents();

            for (int i = 0; i < this.fpPackageList_Sheet1.Rows.Count; i++)
            {
                //1. 获取当前进行包装处理的协定处方
                Neusoft.HISFC.Models.Pharmacy.Item selectNostrum = this.fpPackageList_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Pharmacy.Item;
                //计划数量
                decimal planQty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpPackageList_Sheet1.Cells[i, (int)ColPackageList.ColPlanQty].Text);

                Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在对 " + selectNostrum.Name + "  进行库存处理");
                Application.DoEvents();
                //2. 获取协定处方构成明细
                List <Neusoft.HISFC.Models.Pharmacy.Nostrum> detailNostrumList = this.fpPackageList_Sheet1.Cells[i, (int)ColPackageList.ColDetail].Tag as List <Neusoft.HISFC.Models.Pharmacy.Nostrum>;
                if (detailNostrumList == null)
                {
                    detailNostrumList = this.itemManager.QueryNostrumDetail(selectNostrum.ID);
                }
                //3. 根据协定处方构成明细,对明细药品进行出库处理
                foreach (Neusoft.HISFC.Models.Pharmacy.Nostrum info in detailNostrumList)
                {
                    #region 处方明细出库

                    //3.1 对明细药品逐条进行出库处理
                    Neusoft.HISFC.Models.Pharmacy.Item detailItem = this.itemManager.GetItem(info.Item.ID);
                    if (detailItem == null)
                    {
                        Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("处理处方明细出库,根据药品编码获取药品名称发生错误 " + this.itemManager.Err);
                        return(-1);
                    }

                    //info.Qty 即协定处方维护内的数量即为生产1单位成品所需的数量,此处直接相乘即所需明细的最小单位库存量
                    decimal outQty = planQty * info.Qty;

                    if (this.itemManager.NostrumPackageOutput(detailItem, outQty, stockDept, operEnvironment, outListNO) == -1)
                    {
                        Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("处理处方明细出库,进行出库操作发生错误 " + this.itemManager.Err);
                        return(-1);
                    }

                    #endregion
                }
                //4. 对协定处方进行入库处理

                #region 处方入库处理

                Neusoft.HISFC.Models.Pharmacy.Input input = new Neusoft.HISFC.Models.Pharmacy.Input();

                decimal inQty = planQty * selectNostrum.PackQty;

                #region 实体赋值

                input.Class2Type = "0310";
                input.SystemType = Neusoft.HISFC.Models.Base.EnumIMAInTypeService.GetNameFromEnum(Neusoft.HISFC.Models.Base.EnumIMAInType.ProduceInput); //系统类型=出库申请类型;				//"R1" 制剂管理类型
                input.PrivType   = input.SystemType;                                                                                                     //制剂管理类型
                input.InListNO   = outListNO;

                input.Item = selectNostrum;

                input.StockDept = stockDept;
                input.Company   = stockDept;
                input.Producer  = stockDept;

                input.TargetDept = stockDept;
                input.GroupNO    = Neusoft.FrameWork.Function.NConvert.ToDecimal(groupNO);

                input.BatchNO = this.fpPackageList_Sheet1.Cells[i, (int)ColPackageList.ColBatchNO].Text;
                if (string.IsNullOrEmpty(input.BatchNO) == true)
                {
                    input.BatchNO = "1";
                }
                input.ValidTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.fpPackageList_Sheet1.Cells[i, (int)ColPackageList.ColValidDate].Text);
                if (input.ValidTime < sysTime)
                {
                    input.ValidTime = sysTime.AddYears(10);
                }

                input.Quantity           = inQty;
                input.Operation.ApplyQty = inQty;
                input.Operation.ExamQty  = inQty;

                input.Operation.ApplyOper = operEnvironment;

                input.State = "2";
                input.Operation.ExamOper    = operEnvironment;
                input.Operation.ApproveOper = operEnvironment;

                #endregion

                #region 购入价计算

                ArrayList alOutputList = this.itemManager.QueryOutputInfo(stockDept.ID, outListNO, "A");
                if (alOutputList != null)
                {
                    input.PurchaseCost = 0;
                    foreach (Neusoft.HISFC.Models.Pharmacy.Output outputTemp in alOutputList)
                    {
                        input.PurchaseCost += outputTemp.PurchaseCost;
                    }

                    input.PriceCollection.PurchasePrice = Math.Round(input.PurchaseCost / (input.Quantity / input.Item.PackQty), 4);
                }

                #endregion

                if (this.itemManager.Input(input, "1") == -1)
                {
                    Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("处理处方成品入库,进行入库操作发生错误 " + this.itemManager.Err);
                    return(-1);
                }

                #endregion
            }

            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();

            Neusoft.FrameWork.Management.PublicTrans.Commit();

            MessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Clear();

            return(1);
        }
コード例 #8
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources   = new System.ComponentModel.ComponentResourceManager(typeof(frmNoticeManager));
     Neusoft.HISFC.Models.Base.Notice          notice1          = new Neusoft.HISFC.Models.Base.Notice();
     Neusoft.FrameWork.Models.NeuObject        neuObject1       = new Neusoft.FrameWork.Models.NeuObject();
     Neusoft.FrameWork.Models.NeuObject        neuObject2       = new Neusoft.FrameWork.Models.NeuObject();
     Neusoft.FrameWork.Models.NeuObject        neuObject3       = new Neusoft.FrameWork.Models.NeuObject();
     Neusoft.HISFC.Models.Base.OperEnvironment operEnvironment1 = new Neusoft.HISFC.Models.Base.OperEnvironment();
     Neusoft.FrameWork.Models.NeuObject        neuObject4       = new Neusoft.FrameWork.Models.NeuObject();
     Neusoft.HISFC.Models.Base.Operator        _operator1       = new Neusoft.HISFC.Models.Base.Operator();
     this.toolBar1       = new System.Windows.Forms.ToolBar();
     this.tbbDate        = new System.Windows.Forms.ToolBarButton();
     this.tbQuery        = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
     this.tbAdd          = new System.Windows.Forms.ToolBarButton();
     this.tbDel          = new System.Windows.Forms.ToolBarButton();
     this.tbSave         = new System.Windows.Forms.ToolBarButton();
     this.tbPrint        = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
     this.tbExit         = new System.Windows.Forms.ToolBarButton();
     this.imageList1     = new System.Windows.Forms.ImageList(this.components);
     this.treeView1      = new System.Windows.Forms.TreeView();
     this.imageList2     = new System.Windows.Forms.ImageList(this.components);
     this.splitter1      = new System.Windows.Forms.Splitter();
     this.ucNotice1      = new Manager.Notice.ucNotice();
     this.SuspendLayout();
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 368);
     this.statusBar1.Size     = new System.Drawing.Size(634, 24);
     //
     // toolBar1
     //
     this.toolBar1.Appearance  = System.Windows.Forms.ToolBarAppearance.Flat;
     this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.tbbDate,
         this.tbQuery,
         this.toolBarButton1,
         this.tbAdd,
         this.tbDel,
         this.tbSave,
         this.tbPrint,
         this.toolBarButton2,
         this.tbExit
     });
     this.toolBar1.DropDownArrows = true;
     this.toolBar1.ImageList      = this.imageList1;
     this.toolBar1.Location       = new System.Drawing.Point(0, 0);
     this.toolBar1.Name           = "toolBar1";
     this.toolBar1.ShowToolTips   = true;
     this.toolBar1.Size           = new System.Drawing.Size(634, 45);
     this.toolBar1.TabIndex       = 1;
     //
     // tbbDate
     //
     this.tbbDate.ImageIndex = 2;
     this.tbbDate.Name       = "tbbDate";
     this.tbbDate.Text       = "时间";
     //
     // tbQuery
     //
     this.tbQuery.ImageIndex = 0;
     this.tbQuery.Name       = "tbQuery";
     this.tbQuery.Text       = "查询";
     //
     // toolBarButton1
     //
     this.toolBarButton1.Name  = "toolBarButton1";
     this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbAdd
     //
     this.tbAdd.ImageIndex = 5;
     this.tbAdd.Name       = "tbAdd";
     this.tbAdd.Text       = "增加";
     //
     // tbDel
     //
     this.tbDel.ImageIndex = 3;
     this.tbDel.Name       = "tbDel";
     this.tbDel.Text       = "删除";
     //
     // tbSave
     //
     this.tbSave.ImageIndex = 7;
     this.tbSave.Name       = "tbSave";
     this.tbSave.Text       = "保存";
     //
     // tbPrint
     //
     this.tbPrint.ImageIndex = 6;
     this.tbPrint.Name       = "tbPrint";
     this.tbPrint.Text       = "打印";
     //
     // toolBarButton2
     //
     this.toolBarButton2.Name  = "toolBarButton2";
     this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbExit
     //
     this.tbExit.ImageIndex = 4;
     this.tbExit.Name       = "tbExit";
     this.tbExit.Text       = "退出";
     //
     // imageList1
     //
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     this.imageList1.Images.SetKeyName(0, "");
     this.imageList1.Images.SetKeyName(1, "");
     this.imageList1.Images.SetKeyName(2, "");
     this.imageList1.Images.SetKeyName(3, "");
     this.imageList1.Images.SetKeyName(4, "");
     this.imageList1.Images.SetKeyName(5, "");
     this.imageList1.Images.SetKeyName(6, "");
     this.imageList1.Images.SetKeyName(7, "");
     //
     // treeView1
     //
     this.treeView1.Dock               = System.Windows.Forms.DockStyle.Left;
     this.treeView1.ImageIndex         = 0;
     this.treeView1.ImageList          = this.imageList2;
     this.treeView1.Location           = new System.Drawing.Point(0, 45);
     this.treeView1.Name               = "treeView1";
     this.treeView1.SelectedImageIndex = 0;
     this.treeView1.Size               = new System.Drawing.Size(156, 323);
     this.treeView1.TabIndex           = 2;
     //
     // imageList2
     //
     this.imageList2.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
     this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
     this.imageList2.Images.SetKeyName(0, "");
     this.imageList2.Images.SetKeyName(1, "");
     this.imageList2.Images.SetKeyName(2, "");
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(156, 45);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(3, 323);
     this.splitter1.TabIndex = 3;
     this.splitter1.TabStop  = false;
     //
     // ucNotice1
     //
     this.ucNotice1.BackColor = System.Drawing.SystemColors.Control;
     this.ucNotice1.Dock      = System.Windows.Forms.DockStyle.Fill;
     this.ucNotice1.Location  = new System.Drawing.Point(159, 45);
     this.ucNotice1.Name      = "ucNotice1";
     neuObject1.ID            = "AAAA";
     neuObject1.Memo          = "";
     neuObject1.Name          = "";
     notice1.Dept             = neuObject1;
     notice1.ExtFlag          = "";
     neuObject2.ID            = "AAAA";
     neuObject2.Memo          = "";
     neuObject2.Name          = "";
     notice1.Group            = neuObject2;
     notice1.ID            = "";
     notice1.Memo          = "";
     notice1.Name          = "";
     notice1.NoticeDate    = new System.DateTime(((long)(0)));
     neuObject3.ID         = "";
     neuObject3.Memo       = "";
     neuObject3.Name       = "";
     notice1.NoticeDept    = neuObject3;
     notice1.NoticeInfo    = "";
     notice1.NoticeTitle   = "";
     neuObject4.ID         = "";
     neuObject4.Memo       = "";
     neuObject4.Name       = "";
     operEnvironment1.Dept = neuObject4;
     operEnvironment1.ID   = "";
     operEnvironment1.Memo = "";
     operEnvironment1.Name = "";
     _operator1.ID         = "";
     _operator1.Memo       = "";
     _operator1.Name       = "";
     //operEnvironment1.Oper = _operator1;
     operEnvironment1.OperTime = new System.DateTime(((long)(0)));
     notice1.OperEnvironment   = operEnvironment1;
     this.ucNotice1.Notice     = notice1;
     this.ucNotice1.Size       = new System.Drawing.Size(475, 323);
     this.ucNotice1.TabIndex   = 4;
     //
     // frmNoticeManager
     //
     this.ClientSize = new System.Drawing.Size(634, 392);
     this.Controls.Add(this.ucNotice1);
     this.Controls.Add(this.splitter1);
     this.Controls.Add(this.treeView1);
     this.Controls.Add(this.toolBar1);
     this.KeyPreview    = true;
     this.Name          = "frmNoticeManager";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "信息发布";
     this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
     this.Controls.SetChildIndex(this.toolBar1, 0);
     this.Controls.SetChildIndex(this.statusBar1, 0);
     this.Controls.SetChildIndex(this.treeView1, 0);
     this.Controls.SetChildIndex(this.splitter1, 0);
     this.Controls.SetChildIndex(this.ucNotice1, 0);
     this.ResumeLayout(false);
     this.PerformLayout();
 }