Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        public void Query()
        {
            Neusoft.NFC.Interface.Classes.Function.ShowWaitForm("正在进行查询...请稍候");
            Application.DoEvents();

            string exeSql = "";

            if (this.ckAll.Checked)                     //全部药品
            {
                exeSql = string.Format(this.sql1, stroeageCode);
            }
            else
            {
                if (this.cmbDrug.Tag != null && this.cmbDrug.Tag.ToString() != "")
                {
                    exeSql = string.Format(this.sql2, stroeageCode, this.cmbDrug.Tag.ToString());
                }
                else
                {
                    Neusoft.NFC.Interface.Classes.Function.HideWaitForm();
                    return;
                }
            }

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

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(exeSql, ref ds) == -1)
            {
                Neusoft.NFC.Interface.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.NFC.Interface.Classes.Function.HideWaitForm();
        }
Beispiel #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void Init()
        {
            // Neusoft.HISFC.Management.Pharmacy.Item itemManager = new Neusoft.HISFC.Management.Pharmacy.Item();
            // List<Neusoft.HISFC.Object.Pharmacy.Item> itemList = itemManager.QueryItemList(true);
            //this.cmbDrug.AddItems(new ArrayList(itemList.ToArray()));


            Neusoft.HISFC.Management.Manager.Department deptManager = new Neusoft.HISFC.Management.Manager.Department();

            ArrayList alDept = deptManager.GetDeptmentAll();

            this.deptHelper = new Neusoft.NFC.Public.ObjectHelper(alDept);

            string operCode = string.Empty;

            Neusoft.NFC.Management.DataBaseManger data = new Neusoft.NFC.Management.DataBaseManger();

            operCode = ((Neusoft.HISFC.Object.Base.Employee)data.Operator).ID;

            //取该操作员所在科室即可
            stroeageCode = ((Neusoft.HISFC.Object.Base.Employee)data.Operator).Dept.ID;

            #region 加载Sql

            //            this.sql1 = @"
            //select s.trade_name 药品名称,s.specs 规格,t.drug_dept_code 库存科室,
            //       round(t.store_sum / t.pack_qty,2) 库存量,s.pack_unit 单位,
            //       s.spell_code 拼音码,s.wb_code 五笔码,s.custom_code 自定义码,
            //	   t.drug_code 药品编码,t.drug_dept_code 库存编码,t.valid_state 停用
            //from   pha_com_stockinfo t,pha_com_baseinfo s
            //where  t.drug_code = s.drug_code";
            //and t.storage_code= '{stroeageCode}'
            this.sql1 = @"
           select s.item_name 物品名称,s.specs 规格,t.store_num 库存,t.price 单价,t.stat_unit 包装单位,t.store_cost 库存金额,t.valid_state 有效标志,s.item_code,s.kind_code,s.spell_code 拼音码,t.place_code
           from  log_mat_baseinfo s,log_mat_stock t
           where t.item_code=s.item_code
            and t.storage_code= '{0}'"
            ;
            this.sql2 = @"
         select s.item_name 物品名称,s.item_code,s.kind_code,s.spell_code 拼音码,s.specs 规格,t.store_num 库存,t.price 单价,t.stat_unit 包装单位,t.store_cost 库存金额,,t.valid_state 有效标志s.item_code,s.kind_code,s.spell_code 拼音码,t.place_code
         from  log_mat_baseinfo s,log_mat_stock t
         where t.item_code=s.item_code
         and t.storage_code= '{0}'
         and t.item_code = '{1}'";

            #endregion

            this.neuSpread1_Sheet1.DefaultStyle.Locked = true;
            //this.neuSpread1_Sheet2.DefaultStyle.Locked = true;
        }
Beispiel #3
0
        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void Init()
        {
            Neusoft.NFC.Management.DataBaseManger dataManager = new Neusoft.NFC.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();
        }