Ejemplo n.º 1
0
        /// <summary>
        /// 获取月结记录
        /// </summary>
        private void QueryStoreInterval()
        {
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();

            if (this.OperDept.ID == "")
            {
                return;
            }

            DataSet ds = new DataSet();

            string exeInterval = string.Format(this.sqlInterval, this.OperDept.ID);

            if (dataManager.ExecQuery(exeInterval, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("获取月结记录发生错误"));
                return;
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                this.cmbMonthStoreInterval.Items.Clear();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string strInterval = NConvert.ToDateTime(dr[0]).ToString() + "--" + NConvert.ToDateTime(dr[1]).ToString();

                    this.cmbMonthStoreInterval.Items.Add(strInterval);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 汇总查询
        /// </summary>
        /// <returns></returns>
        protected int QueryTotal()
        {
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();

            if (this.OperDept.ID == "")
            {
                return(-1);
            }

            this.Clear();

            DataSet ds = new DataSet();

            this.lbDept.Text = "库存科室:" + this.OperDept.Name;
            this.lbDate.Text = "统计周期:" + this.BeginTime.ToString() + "至" + this.EndTime.ToString();

            string exeTotal = string.Format(this.sqlTotal, this.OperDept.ID, this.BeginTime.ToString(), this.EndTime.ToString());

            if (dataManager.ExecQuery(exeTotal, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("获取年结汇总记录发生错误"));
                return(-1);
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                this.fpHead.DataSource = ds;

                this.Sum();
            }

            return(1);
        }
Ejemplo n.º 3
0
        private void GetRecipeLabelItem(string drugDept, string drugCode, ref Neusoft.HISFC.Models.Pharmacy.Item item)
        {
            Neusoft.FrameWork.Management.DataBaseManger dataBaseMgr = new Neusoft.FrameWork.Management.DataBaseManger();
            string strSql = @"select t.trade_name,t.regular_name,t.formal_name,t.other_name,
       t.english_regular,t.english_other,t.english_name,t.caution,t.store_condition,t.base_dose,s.place_code,
	   t.custom_code
from   pha_com_baseinfo t,pha_com_stockinfo s
where  t.drug_code = s.drug_code
and    s.drug_dept_code = '{0}'
and    s.drug_code = '{1}'";

            strSql = string.Format(strSql, drugDept, drugCode);
            if (dataBaseMgr.ExecQuery(strSql) != -1)
            {
                if (dataBaseMgr.Reader.Read())
                {
                    item.Name = dataBaseMgr.Reader[0].ToString();
                    item.NameCollection.RegularName        = dataBaseMgr.Reader[1].ToString();
                    item.NameCollection.FormalName         = dataBaseMgr.Reader[2].ToString();
                    item.NameCollection.OtherName          = dataBaseMgr.Reader[3].ToString();
                    item.NameCollection.EnglishRegularName = dataBaseMgr.Reader[4].ToString();
                    item.NameCollection.EnglishOtherName   = dataBaseMgr.Reader[5].ToString();
                    item.NameCollection.EnglishName        = dataBaseMgr.Reader[6].ToString();
                    item.Product.Caution        = dataBaseMgr.Reader[7].ToString();
                    item.Product.StoreCondition = dataBaseMgr.Reader[8].ToString();
                    item.BaseDose = Neusoft.FrameWork.Function.NConvert.ToDecimal(dataBaseMgr.Reader[9].ToString());
                    item.User01   = dataBaseMgr.Reader[10].ToString();
                    item.NameCollection.UserCode = dataBaseMgr.Reader[11].ToString();
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void Init()
        {
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();

            Neusoft.FrameWork.Models.NeuObject class2Priv = new Neusoft.FrameWork.Models.NeuObject();
            class2Priv.ID   = "0320";
            class2Priv.Name = "出库";
            this.Class2Priv = class2Priv;       //出库

            //权限科室通过权限获取
            //this.DeptInfo = ((Neusoft.HISFC.Models.Base.Employee)dataManager.Operator).Dept;
            this.OperInfo = dataManager.Operator;

            Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager();
            Neusoft.HISFC.Models.Base.Department       dept             = managerIntegrate.GetDepartment(this.DeptInfo.ID);
            if (dept != null)
            {
                this.DeptInfo.Memo = dept.DeptType.ID.ToString();
            }

            this.isStockArk = this.ArkJudge(this.DeptInfo.ID);

            if (this.FilePath == "")
            {
                this.FilePath = @"\Setting\PhaOutSetting.xml";
            }

            if (this.SetPrivType(true) == -1)
            {
                return;
            }

            this.GetInterface();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 设置信息
        /// </summary>
        public void SetData(Neusoft.FrameWork.Models.NeuObject dept, Neusoft.FrameWork.Models.NeuObject item, int intervalDays)
        {
            Neusoft.FrameWork.Management.DataBaseManger databaseMgr = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = databaseMgr.GetDateTimeFromSysDateTime().Date;

            this.dtpEnd.Value   = sysTime;
            this.dtpEnd.Text    = sysTime.ToString();
            this.dtpBegin.Value = sysTime.AddDays(-intervalDays);
            this.dtpBegin.Text  = sysTime.AddDays(-intervalDays).ToString();

            if (dept != null && dept.ID != "")
            {
                this.Dept         = dept;
                this.cmbDept.Text = dept.Name;
                this.cmbDept.Tag  = dept.ID;
            }

            if (item != null && item.ID != "")
            {
                this.item         = item;
                this.cmbItem.Text = item.Name;
                this.cmbItem.Tag  = item.ID;
            }

            this.lbItemInfo.Text = string.Format("物品编码:{0} 规格:{1} 单位:{2}", item.Name, item.Memo, item.User01);

            this.Query();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 数据初始化
        /// </summary>
        protected void Init()
        {
            ArrayList al = new ArrayList();

            #region 银行

            Neusoft.HISFC.BizLogic.Manager.Constant constantManager = new Neusoft.HISFC.BizLogic.Manager.Constant();
            al = constantManager.GetList("BANK");
            if (al == null)
            {
                MessageBox.Show(Language.Msg("获取银行列表失败" + constantManager.Err));
                return;
            }
            bankHelper.ArrayObject = al;

            #endregion

            #region 人员

            Neusoft.HISFC.BizLogic.Manager.Person personManager = new Neusoft.HISFC.BizLogic.Manager.Person();
            al = personManager.GetEmployeeAll();
            if (al == null)
            {
                MessageBox.Show(Language.Msg("获取所有人员列表" + personManager.Err));
                return;
            }
            this.personHelper.ArrayObject = al;

            #endregion

            #region 供货单位

            Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant();
            this.alCompany = constant.QueryCompany("1");
            if (this.alCompany == null)
            {
                MessageBox.Show(constant.Err);
                return;
            }
            //{49390DE5-B54F-4b15-A012-208CDF288FF5}  可选择全部供货公司 增加银行列表选择功能
            Neusoft.HISFC.Models.Pharmacy.Company rootCompany = new Neusoft.HISFC.Models.Pharmacy.Company();
            rootCompany.ID   = "AAAA";
            rootCompany.Name = "全部供货公司";

            this.alCompany.Insert(0, rootCompany);

            this.companyHelper = new Neusoft.FrameWork.Public.ObjectHelper(this.alCompany);

            #endregion

            Neusoft.FrameWork.Management.DataBaseManger dataBaseManager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = dataBaseManager.GetDateTimeFromSysDateTime().Date.AddDays(1);
            this.dtBegin = sysTime.AddDays(-30);
            this.dtEnd   = sysTime;

            this.privOper = dataBaseManager.Operator;

            this.payFlag = "'0','1'";
        }
Ejemplo n.º 7
0
        private void fpStorage_EditChange(object sender, EditorNotifyEventArgs e)
        {
            Neusoft.FrameWork.Management.DataBaseManger data = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime date = this.basesetManager.GetDateTimeFromSysDateTime();

            this.fpStorage_Sheet1.Cells[e.Row, 14].Text = ((Neusoft.HISFC.Models.Base.Employee)data.Operator).ID;
            this.fpStorage_Sheet1.Cells[e.Row, 15].Text = date.ToString();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 直接退费
        /// </summary>
        public override int Save()
        {
            if (this.patientInfo == null || string.IsNullOrEmpty(patientInfo.ID))
            {
                MessageBox.Show("请输入患者住院号并回车确认!");
                this.ucQueryPatientInfo.Focus();
                return(-1);
            }

            List <FeeItemList> quitItem = this.GetConfirmDrugItem();

            if (quitItem.Count == 0)
            {
                MessageBox.Show("没有可退的费用!");
                return(-1);
            }
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = dataManager.GetDateTimeFromSysDateTime();

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            this.phamarcyIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            foreach (Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList info in quitItem)
            {
                //{26757C60-3E01-47a2-963F-93B0E26565A6}  更改了函数调用顺序
                //需要先取消申请,再进行退费
                if (info.PayType == Neusoft.HISFC.Models.Base.PayTypes.Balanced)
                {
                    //取消出库申请
                    if (this.phamarcyIntegrate.CancelApplyOut(info.Clone()) == -1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(Language.Msg("取消药品申请失败!") + this.phamarcyIntegrate.Err);
                        return(-1);
                    }
                }
                //退费操作
                if (this.feeIntegrate.QuitItem(this.patientInfo, info.Clone()) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Language.Msg("退费失败!") + this.feeIntegrate.Err);
                    return(-1);
                }

                //退库操作
                if (this.phamarcyIntegrate.OutputReturn(info, dataManager.Operator.ID, sysTime) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Language.Msg("退费时退库失败!") + this.phamarcyIntegrate.Err);
                    return(-1);
                }
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show(Language.Msg("退费成功!"));
            return(1);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 数据查询
        /// </summary>
        private void QueryData()
        {
            if (this.cmbMonthStoreInterval.Text == "")
            {
                return;
            }

            if (this.OperDept.ID == "")
            {
                return;
            }

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

            string strInterval = this.cmbMonthStoreInterval.Text;

            string strBegin = strInterval.Substring(0, strInterval.IndexOf("--"));
            string strEnd   = strInterval.Substring(strInterval.IndexOf("--") + 2);

            string exeDetail = string.Format(this.sqlTotal, this.OperDept.ID, strBegin, strEnd);

            DataSet ds = new DataSet();

            this.lbDept.Text = "库存科室:" + this.OperDept.Name;
            this.lbDate.Text = "统计区间:" + this.cmbMonthStoreInterval.Text;

            if (dataManager.ExecQuery(exeDetail, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("获取月结明细发生错误"));
                return;
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                this.fpDetail.Rows.Count = 0;

                this.fpHead.DataSource = ds;

                int iTotIndex = this.fpHead.Rows.Count;
                this.fpHead.Rows.Add(iTotIndex, 1);
                this.fpHead.Cells[iTotIndex, 0].Text = "合计:";
                if (iTotIndex == 0)
                {
                    for (int i = 1; i < this.fpHead.Columns.Count; i++)
                    {
                        this.fpHead.Cells[iTotIndex, i].Text = "0";
                    }
                }
                else
                {
                    for (int i = 1; i < this.fpHead.Columns.Count; i++)
                    {
                        this.fpHead.Cells[iTotIndex, i].Formula = "SUM(" + (char)(65 + i) + "1:" + (char)(65 + i) + iTotIndex.ToString() + ")";
                    }
                }
                this.fpHead.Rows[iTotIndex].Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 数据检索
        /// </summary>
        protected void QueryData()
        {
            if (!this.IsValid())
            {
                return;
            }

            this.neuSpread1.ActiveSheet = this.neuSpread1_Sheet1;
            if (this.neuSpread1.Sheets.Contains(this.neuSpread1_Sheet2))
            {
                this.neuSpread1.Sheets.Remove(this.neuSpread1_Sheet2);
            }


            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            string sqlIndex = this.GetSqlIndex();
            string sql      = "";

            dataManager.Sql.GetSql(sqlIndex, ref sql);
            sql = string.Format(sql, this.cmbData.Tag.ToString(), Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text).ToString(), Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text).ToString());
            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(sql, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("工作量查询出错 \n" + dataManager.Err));
                return;
            }

            this.neuSpread1_Sheet1.Rows.Count = 0;
            if (ds.Tables[0].Rows.Count > 0)
            {
                this.neuSpread1_Sheet1.DataSource = ds;
            }

            try
            {
                if (this.rbPerson.Checked)
                {
                    this.Sum(2, 3, 4, 5);
                }
                else
                {
                    if (this.rbTerminalShow.Checked)
                    {
                        this.Sum(1, 2, 3, 4);
                    }
                    else
                    {
                        this.Sum(2, 3, 4, 5);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 初始化
        /// </summary>
        protected void Init()
        {
            ArrayList al = new ArrayList();

            #region 银行信息

            Neusoft.HISFC.BizLogic.Manager.Constant constantManager = new Neusoft.HISFC.BizLogic.Manager.Constant();
            al = constantManager.GetList("BANK");
            if (al == null)
            {
                MessageBox.Show(Language.Msg("获取银行列表失败" + constantManager.Err));
                return;
            }
            bankHelper.ArrayObject = al;

            #endregion

            #region 人员

            Neusoft.HISFC.BizLogic.Manager.Person personManager = new Neusoft.HISFC.BizLogic.Manager.Person();
            al = personManager.GetEmployeeAll();
            if (al == null)
            {
                MessageBox.Show(Language.Msg("获取所有人员列表" + personManager.Err));
                return;
            }
            this.personHelper.ArrayObject = al;

            #endregion

            #region 供应商

            Neusoft.HISFC.BizLogic.Material.ComCompany companyManager = new Neusoft.HISFC.BizLogic.Material.ComCompany();

            this.alCompany = companyManager.QueryCompany("1", "A");

            if (this.alCompany == null)
            {
                MessageBox.Show(constantManager.Err);
                return;
            }

            #endregion

            #region 时间

            Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = databaseManager.GetDateTimeFromSysDateTime().Date.AddDays(1);
            this.dtBegin = sysTime.AddDays(-30);
            this.dtEnd   = sysTime;

            this.privOper = databaseManager.Operator;

            this.payFlag = "'0','1'";

            #endregion
        }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        public void Query()
        {
            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("ÕýÔÚ½øÐвéѯ...ÇëÉÔºò");
            Application.DoEvents();

            string exeSql = "";

            if (this.ckAll.Checked)                     //È«²¿Ò©Æ·
            {
                exeSql = this.sql1;
            }
            else
            {
                if (this.cmbDrug.Tag != null && this.cmbDrug.Tag.ToString() != "")
                {
                    exeSql = string.Format(this.sql2, this.cmbDrug.Tag.ToString());
                }
            }

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

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(exeSql, ref ds) == -1)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                MessageBox.Show(Language.Msg("Ö´ÐÐSqlÓï¾ä·¢Éú´íÎó" + dataManager.Err));
                return;
            }

            //if (ds != null && ds.Tables.Count > 0)
            //{
            //    foreach (System.Data.DataRow dr in ds.Tables[0].Rows)
            //    {
            //        if (ds.Tables[0].Columns.Contains("¿â´æ¿ÆÊÒ"))
            //            dr["¿â´æ¿ÆÊÒ"] = this.deptHelper.GetName(dr["¿â´æ¿ÆÊÒ"].ToString());
            //    }
            //}

            this.dv = new DataView(ds.Tables[0]);

            this.neuSpread1_Sheet1.DataSource = dv;

            this.SetFormat();

            if (this.neuSpread1.ActiveSheet != this.neuSpread1_Sheet1)
            {
                this.neuSpread1.ActiveSheet = this.neuSpread1_Sheet1;
            }

            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void InitDeptList()
        {
            try
            {
                Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
                this.ShowControlList(((Neusoft.HISFC.Models.Base.Employee)dataManager.Operator).Dept.ID);

                this.tvDeptTree1.IsShowPI = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("初始化配药台列表发生错误" + ex.Message);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 明细查询
        /// </summary>
        /// <param name="iRowIndex">索引行</param>
        /// <returns>成功返回1 失败返回-1</returns>
        protected int QueryDetail(int iRowIndex)
        {
            if (this.neuSpread1.ActiveSheet == this.fpDetail)
            {
                return(-1);
            }
            if (iRowIndex == this.fpHead.Rows.Count - 1)
            {
                return(-1);
            }

            if (this.OperDept.ID == "")
            {
                return(-1);
            }

            if (this.fpHead.Rows.Count <= 0)
            {
                return(-1);
            }

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

            DateTime dtBegin = NConvert.ToDateTime(this.fpHead.Cells[iRowIndex, 0].Text);
            DateTime dtEnd   = NConvert.ToDateTime(this.fpHead.Cells[iRowIndex, 1].Text);

            string exeDetail = string.Format(this.sqlDetail, this.OperDept.ID, dtBegin.ToString(), dtEnd.ToString());

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(exeDetail, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("获取月结明细发生错误"));
                return(-1);
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                this.fpDetail.DataSource = ds;

                this.neuSpread1.ActiveSheet = this.fpDetail;
            }

            return(1);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 初始化
        /// </summary>
        public int Init()
        {
            Neusoft.FrameWork.Management.DataBaseManger dataBaseManager = new Neusoft.FrameWork.Management.DataBaseManger();

            this.OperDept = ((Neusoft.HISFC.Models.Base.Employee)dataBaseManager.Operator).Dept;

            if (this.isOtherDrugDept)
            {
                Neusoft.HISFC.BizProcess.Integrate.Manager integrateManager = new Neusoft.HISFC.BizProcess.Integrate.Manager();
                System.Collections.ArrayList al = integrateManager.GetDepartment(Neusoft.HISFC.Models.Base.EnumDepartmentType.P);
                foreach (Neusoft.HISFC.Models.Base.Department tempDept in al)
                {
                    if (tempDept.ID == this.OperDept.ID)
                    {
                        al.Remove(tempDept);
                        break;
                    }
                }
                Neusoft.FrameWork.Models.NeuObject info = new Neusoft.FrameWork.Models.NeuObject();
                if (Neusoft.FrameWork.WinForms.Classes.Function.ChooseItem(al, ref info) == 0)
                {
                    return(-1);
                }
                else
                {
                    this.OperDept = info;
                }
            }

            this.OperInfo    = dataBaseManager.Operator;
            this.ApproveDept = ((Neusoft.HISFC.Models.Base.Employee)dataBaseManager.Operator).Dept;

            if (this.InitTerminal() == -1)
            {
                return(-1);
            }

            this.InitControlParm();

            return(1);
        }
Ejemplo n.º 16
0
        private void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            if (this.cmbMonthStoreInterval.Text == "")
            {
                return;
            }

            if (this.OperDept.ID == "")
            {
                return;
            }

            if (this.fpHead.Rows.Count <= 0)
            {
                return;
            }

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

            string strInterval = this.cmbMonthStoreInterval.Text;

            string strBegin = strInterval.Substring(0, strInterval.IndexOf("--"));
            string strEnd   = strInterval.Substring(strInterval.IndexOf("--") + 2);

            string exeDetail = string.Format(this.sqlDetail, this.OperDept.ID, strBegin, strEnd);

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(exeDetail, ref ds) == -1)
            {
                MessageBox.Show(Language.Msg("获取月结明细发生错误"));
                return;
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                this.fpDetail.DataSource = ds;

                this.neuSpread1.ActiveSheet = this.fpDetail;
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void Init()
        {
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = dataManager.GetDateTimeFromSysDateTime();

            if (this.rbOut.Checked)
            {
                this.dtpBegin.Value = sysTime.AddDays(-this.outIntervalDays);
            }
            if (this.rbIn.Checked)
            {
                this.dtpBegin.Value = sysTime.AddDays(-this.inIntervalDays);
            }
            if (this.rbStock.Checked)
            {
                this.dtpBegin.Value = sysTime.AddDays(-this.stockIntervalDays);
            }

            this.dtpEnd.Value = sysTime;

            #region 加载入出库/采购状态集

            this.hsInOutState = new System.Collections.Hashtable();
            this.hsInOutState.Add("0", "申请");
            this.hsInOutState.Add("1", "审批");
            this.hsInOutState.Add("2", "核准");

            this.hsStockState = new System.Collections.Hashtable();
            this.hsStockState.Add("0", "计划");
            this.hsStockState.Add("1", "采购");
            this.hsStockState.Add("2", "审核");
            this.hsStockState.Add("3", "入库");

            #endregion

            this.IsShowTypeCheck = false;

            this.Clear();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 获取床位日报信息
        /// </summary>
        /// <param name="deptCode">科室编码 如科室编码为空则统计全院床位日报信息</param>
        /// <returns></returns>
        protected int QueryHosDayReport()
        {
            this.lbDate.Text = "日期:" + this.BeginDate.ToString("yyyy-MM-dd") + " 至 " + this.EndDate.ToString("yyyy-MM-dd");
            this.lbDept.Text = "统计范围:全院";

            #region 床位明细 转入、转出

            string execDetailSql = @"select t.dept_code,t.stat_type,t.extend,count(*)
--select *
from met_cas_dayreport_detail t
where t.stat_date >= to_date('{0}','yyyy-mm-dd')
and   t.stat_date <= to_date('{1}','yyyy-mm-dd')
and   t.valid_state = '0'
group by t.dept_code,t.stat_type,t.extend
order by t.dept_code";

            execDetailSql = string.Format(execDetailSql, this.BeginDate.ToString("yyyy-MM-dd"), this.EndDate.ToString("yyyy-MM-dd"));

            DataSet ds = new DataSet();
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            if (dataManager.ExecQuery(execDetailSql, ref ds) == -1)
            {
                MessageBox.Show("床位日报查询发生错误" + dataManager.Err);
                return(-1);
            }

            this.neuSpread1_Sheet1.Rows.Count = 0;

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                #region 床位日报信息处理
                string privDept = "";
                int    rowIndex = -1;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (privDept != dr[0].ToString())
                    {
                        rowIndex++;

                        this.neuSpread1_Sheet1.Rows.Add(rowIndex, 1);
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColDeptCode].Text = dr[0].ToString();
                        this.neuSpread1_Sheet1.Cells[rowIndex, 0].Text = this.deptHelper.GetName(dr[0].ToString());

                        privDept = dr[0].ToString();
                    }

                    switch (dr[1].ToString())
                    {
                    case "K":           //接诊
                    case "C":           //召回
                        decimal originalNum = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColInNum].Text);
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColInNum].Text = (originalNum + NConvert.ToDecimal(dr[3])).ToString();
                        break;

                    case "O":           //出院
                        switch (dr[2].ToString())
                        {
                        case "1":
                            this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColOut1].Text = NConvert.ToDecimal(dr[3]).ToString();
                            break;

                        case "2":
                            this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColOut2].Text = NConvert.ToDecimal(dr[3]).ToString();
                            break;

                        case "3":
                            this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColOut3].Text = NConvert.ToDecimal(dr[3]).ToString();
                            break;

                        case "4":
                            this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColOut4].Text = NConvert.ToDecimal(dr[3]).ToString();
                            break;
                        }

                        decimal totNum = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTot].Text);
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTot].Text = (totNum + NConvert.ToDecimal(dr[3])).ToString();

                        break;

                    case "RI":          //转入
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTransferIn].Text = NConvert.ToDecimal(dr[3]).ToString();
                        break;

                    case "RO":          //转出
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTransferOut].Text = NConvert.ToDecimal(dr[3]).ToString();
                        break;

                    case "OF":          //无费退院
                        decimal totOFNum = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTot].Text);
                        this.neuSpread1_Sheet1.Cells[rowIndex, (int)ColumnEnum.ColTot].Text = (totOFNum + NConvert.ToDecimal(dr[3])).ToString();
                        break;
                    }
                }

                #endregion
            }

            #endregion

            #region 期初、期末人数

            string execTotSql = @"select s.dept_code,sum(s.in_normal + s.in_return),sum(s.out_normal + s.out_withdrawal),sum(s.in_transfer),
       sum(s.out_transfer),sum(s.bed_stand), (select t.beginning_num from met_cas_inpatientdayreport t 
             where  t.dept_code=s.dept_code and  t.date_stat=to_date('{0}','yyyy-mm-dd' )) as beginning_num,
       (select t.end_num from met_cas_inpatientdayreport t 
             where  t.dept_code=s.dept_code and  t.date_stat=to_date('{1}','yyyy-mm-dd'))as end_num
from   met_cas_inpatientdayreport s 
where  s.date_stat >= to_date('{0}','yyyy-mm-dd')
and    s.date_stat <= to_date('{1}','yyyy-mm-dd')
group by s.dept_code
order by s.dept_code";

            execTotSql = string.Format(execTotSql, this.BeginDate.ToString("yyyy-MM-dd"), this.EndDate.ToString("yyyy-MM-dd"));

            DataSet dsTot = new DataSet();
            if (dataManager.ExecQuery(execTotSql, ref dsTot) == -1)
            {
                MessageBox.Show("床位日报查询发生错误" + dataManager.Err);
                return(-1);
            }

            if (dsTot != null && dsTot.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in dsTot.Tables[0].Rows)
                {
                    for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
                    {
                        if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColDeptCode].Text == dr[0].ToString())
                        {
                            //入院人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColInNum].Text = NConvert.ToDecimal(dr[1]).ToString();
                            //出院人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTot].Text = NConvert.ToDecimal(dr[2]).ToString();
                            //转入人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferIn].Text = NConvert.ToDecimal(dr[3]).ToString();
                            //转出人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferOut].Text = NConvert.ToDecimal(dr[4]).ToString();
                            //实开床位
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColStandardNum].Text = NConvert.ToDecimal(dr[5]).ToString();
                            //期初人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColBeginNum].Text = NConvert.ToDecimal(dr[6]).ToString();
                            //期末人数
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColEndNum].Text = NConvert.ToDecimal(dr[7]).ToString();


                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColInNum].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColInNum].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTot].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTot].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferIn].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferIn].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferOut].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColTransferOut].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColStandardNum].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColStandardNum].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColBeginNum].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColBeginNum].Text = "";
                            }
                            if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColEndNum].Text == "0")
                            {
                                this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColEndNum].Text = "";
                            }
                            //if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColOutStat].Text == "0")
                            //    this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColOutStat].Text = "";
                            //if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColOutTot].Text == "0")
                            //    this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColOutTot].Text = "";
                        }
                    }
                }
            }

            #endregion

            #region 出院总床日数


            string execOutStatSql = @"select  t.dept_code,sum(trunc(decode(s.IN_STATE,'N',s.oper_date,s.out_date)) - trunc(s.in_date))
from    met_cas_dayreport_detail t,fin_ipr_inmaininfo s
where   t.stat_date >= to_date('{0}','yyyy-mm-dd')
and     t.stat_date <= to_date('{1}','yyyy-mm-dd')
and     t.valid_state = '0'
and     t.stat_type in ('O','OF')
and     t.inpatient_no = s.inpatient_no
group by t.dept_code";

            execOutStatSql = string.Format(execOutStatSql, this.BeginDate.ToString("yyyy-MM-dd"), this.EndDate.ToString("yyyy-MM-dd"));

            DataSet dsOutStat = new DataSet();
            if (dataManager.ExecQuery(execOutStatSql, ref dsOutStat) == -1)
            {
                MessageBox.Show("床位日报查询发生错误" + dataManager.Err);
                return(-1);
            }

            if (dsOutStat != null && dsOutStat.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in dsOutStat.Tables[0].Rows)
                {
                    for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
                    {
                        if (this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColDeptCode].Text == dr[0].ToString())
                        {
                            this.neuSpread1_Sheet1.Cells[i, (int)ColumnEnum.ColOutStat].Text = NConvert.ToDecimal(dr[1]).ToString();
                        }
                    }
                }
            }

            #endregion

            #region 合计统计

            this.SetSum((int)ColumnEnum.ColDept, (int)ColumnEnum.ColStandardNum, (int)ColumnEnum.ColBeginNum, (int)ColumnEnum.ColInNum,
                        (int)ColumnEnum.ColTransferIn, (int)ColumnEnum.ColTransferOut, (int)ColumnEnum.ColTot, (int)ColumnEnum.ColOutTot,
                        (int)ColumnEnum.ColOut1, (int)ColumnEnum.ColOut2, (int)ColumnEnum.ColOut3, (int)ColumnEnum.ColOut4,
                        (int)ColumnEnum.ColEndNum, (int)ColumnEnum.ColOutStat);

            #endregion

            return(1);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 明细查询
        /// </summary>
        /// <param name="operCode">欲查询人员编码</param>
        protected void QueryDetail(string operCode)
        {
            this.neuSpread1_Sheet2.Rows.Count = 0;

            DateTime beginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text);
            DateTime endTime   = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text);

            DateTime queryBeginDate = beginTime;
            DateTime queryEndDate   = System.DateTime.MinValue;

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

            string sqlIndex = "";

            if (this.isDrugTerminalQuery)
            {
                sqlIndex = "Pharmacy.Item.ClinicQuery.Druged.Oper.Detail";
            }
            else
            {
                sqlIndex = "Pharmacy.Item.ClinicQuery.Send.Oper.Detail";
            }

            string sql = "";

            if (dataManager.Sql.GetSql(sqlIndex, ref sql) == -1)
            {
                MessageBox.Show(Language.Msg("根据索引获取Sql语句出错 \n" + dataManager.Err));
                return;
            }

            DataSet dsDetail = null;

            string formatSql = "";

            while (queryEndDate < endTime)
            {
                queryEndDate = queryBeginDate.Date.AddDays(1);
                if (queryEndDate > endTime)
                {
                    queryEndDate = endTime;
                }

                formatSql = string.Format(sql, operCode, queryBeginDate, queryEndDate, this.cmbData.Tag.ToString());
                DataSet ds = new DataSet();
                if (dataManager.ExecQuery(formatSql, ref ds) == -1)
                {
                    MessageBox.Show(Language.Msg("工作量查询出错 \n" + dataManager.Err));
                    return;
                }

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (dsDetail == null)
                    {
                        dsDetail = ds.Clone();
                    }

                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        dsDetail.Tables[0].Rows.Add(new object[] {
                            dr[0],
                            dr[1],
                            dr[2],
                            dr[3],
                            dr[4],
                            dr[5],
                            dr[6]
                        });
                    }
                }
                queryBeginDate = queryEndDate;
            }

            if (dsDetail != null && dsDetail.Tables.Count > 0 && dsDetail.Tables[0].Rows.Count > 0)
            {
                this.neuSpread1_Sheet2.DataSource = dsDetail;
            }
            if (this.neuSpread1.Sheets.Contains(this.neuSpread1_Sheet2))
            {
                this.neuSpread1.ActiveSheet = this.neuSpread1_Sheet2;
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 从company实体中取数据,赋予控件
        /// </summary>
        private void SetCompany()
        {
            Neusoft.FrameWork.Management.DataBaseManger data = new Neusoft.FrameWork.Management.DataBaseManger();
            if (this.company == null)
            {
                this.company = new Neusoft.HISFC.Models.Material.MaterialCompany();
            }

            this.txtId.Text = this.company.ID;

            if (this.inputType == "I")
            {
                try
                {
                    this.company.ID = comCompany.GetMaxCompanyID(((int)kind).ToString());
                    this.txtId.Text = this.company.ID;
                }
                catch { }
            }
            this.txtName.Text         = company.Name;                  //公司名称
            this.txtCoporation.Text   = company.Coporation;            //公司法人
            this.txtAddress.Text      = company.Address;               //公司地址
            this.txtTelCode.Text      = company.TelCode;               //公司电话
            this.txtFaxCode.Text      = company.FaxCode;               //公司传真
            this.txtNetAddress.Text   = company.NetAddress;            //公司网址
            this.txtEMail.Text        = company.EMail;                 //公司邮箱
            this.txtLinkMan.Text      = company.LinkMan;               //联系人
            this.txtLinkMail.Text     = company.LinkMail;              //联系人邮箱
            this.txtLinkTel.Text      = company.LinkTel;               //联系人电话
            this.txtGMPInfo.Text      = company.GMPInfo;               //GMP信息
            this.txtGSPInfo.Text      = company.GSPInfo;               //GSP信息
            this.txtISOInfo.Text      = company.ISOInfo;               //ISO信息
            this.txtSpellCode.Text    = company.SpellCode;             //拼音码
            this.txtWbCode.Text       = company.WBCode;                //五笔码
            this.txtUserCode.Text     = company.UserCode;              //自定义码
            this.txtOpenBank.Text     = company.OpenBank;              //开户银行
            this.txtOpenAccounts.Text = company.OpenAccounts;          //开户帐号
            this.txtActualRate.Text   = company.ActualRate.ToString(); //加价率
            this.txtMemo.Text         = company.Memo;                  //备注

            if (company.BusinessDate == DateTime.MinValue)
            {
                this.dtBusinessDate.Value = DateTime.Now;
            }
            else
            {
                this.dtBusinessDate.Value = company.BusinessDate;
            }
            if (company.ManageDate == DateTime.MinValue)
            {
                this.dtManageDate.Value = DateTime.Now;
            }
            else
            {
                this.dtManageDate.Value = company.ManageDate;
            }
            if (company.DutyDate == DateTime.MinValue)
            {
                this.dtDutyDate.Value = DateTime.Now;
            }
            else
            {
                this.dtDutyDate.Value = company.DutyDate;
            }
            if (company.OrgDate == DateTime.MinValue)
            {
                this.dtOrgDate.Value = DateTime.Now;
            }
            else
            {
                this.dtOrgDate.Value = company.OrgDate;
            }

            if (company.IsValid)
            {
                this.chbIsValid.Checked = true;
            }
            else
            {
                this.chbIsValid.Checked = false;
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 从控件中取数据,赋予company实体
        /// </summary>
        private void GetCompany()
        {
            Neusoft.FrameWork.Management.DataBaseManger data = new Neusoft.FrameWork.Management.DataBaseManger();
            string operCode = ((Neusoft.HISFC.Models.Base.Employee)data.Operator).ID;

            if (this.company == null)
            {
                this.company = new Neusoft.HISFC.Models.Material.MaterialCompany();
            }

            this.company.ID = this.txtId.Text;

            if (this.inputType == "I")
            {
                try
                {
                    this.company.ID = comCompany.GetMaxCompanyID(((int)kind).ToString());
                    this.txtId.Text = this.company.ID;
                }
                catch { }
            }
            company.Kind         = ((int)this.kind).ToString();
            company.Name         = this.txtName.Text;                          //公司名称
            company.Coporation   = this.txtCoporation.Text;                    //公司法人
            company.Address      = this.txtAddress.Text;                       //公司地址
            company.TelCode      = this.txtTelCode.Text;                       //公司电话
            company.FaxCode      = this.txtFaxCode.Text;                       //公司传真
            company.NetAddress   = this.txtNetAddress.Text;                    //公司网址
            company.EMail        = this.txtEMail.Text;                         //公司邮箱
            company.LinkMan      = this.txtLinkMan.Text;                       //联系人
            company.LinkMail     = this.txtLinkMail.Text;                      //联系人邮箱
            company.LinkTel      = this.txtLinkTel.Text;                       //联系人电话
            company.GMPInfo      = this.txtGMPInfo.Text;                       //GMP信息
            company.GSPInfo      = this.txtGSPInfo.Text;                       //GSP信息
            company.ISOInfo      = this.txtISOInfo.Text;                       //ISO信息
            company.SpellCode    = this.txtSpellCode.Text;                     //拼音码
            company.WBCode       = this.txtWbCode.Text;                        //五笔码
            company.UserCode     = this.txtUserCode.Text;                      //自定义码
            company.Type         = ((int)this.type).ToString();                //公司类型
            company.OpenBank     = this.txtOpenBank.Text;                      //开户银行
            company.OpenAccounts = this.txtOpenAccounts.Text;                  //开户帐号
            company.ActualRate   = Convert.ToDecimal(this.txtActualRate.Text); //加价率
            if (this.chbIsValid.Checked)
            {
                company.IsValid = true; //有效
            }
            else
            {
                company.IsValid = false;
            }
            company.Memo     = this.txtMemo.Text;           //备注
            company.Oper.ID  = operCode;
            company.OperTime = comCompany.GetDateTimeFromSysDateTime();
            //{9E7FB328-89B3-4f43-A417-2EC3ACFC7093}
            //不用判断是否是最小的
            //if (company.BusinessDate == DateTime.MinValue)
            //{
            //    company.BusinessDate = DateTime.Now;
            //}
            //else
            //{
            company.BusinessDate = NConvert.ToDateTime(this.dtBusinessDate.Value);
            //}
            //if (company.ManageDate == DateTime.MinValue)
            //{
            //    company.ManageDate = DateTime.Now;
            //}
            //else
            //{
            company.ManageDate = NConvert.ToDateTime(this.dtManageDate.Value);
            //}
            //if (company.DutyDate == DateTime.MinValue)
            //{
            //    company.DutyDate = DateTime.Now;
            //}
            //else
            //{
            company.DutyDate = NConvert.ToDateTime(this.dtDutyDate.Value);
            //}
            //if (company.OrgDate == DateTime.MinValue)
            //{
            //    company.OrgDate = DateTime.Now;
            //}
            //else
            //{
            company.OrgDate = NConvert.ToDateTime(this.dtOrgDate.Value);
            //}
        }