/// <summary>
        /// 查询
        /// </summary>
        /// <returns>成功返回1 失败返回-1</returns>
        protected int Query()
        {
            if (!this.IsValid())
            {
                return(-1);
            }

            string strSqlIndex = this.GetSqlIndex();

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

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(strSqlIndex, ref ds, this.cmbDrug.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("执行查询发生错误") + dataManager.Err);
                return(-1);
            }

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

            return(1);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        protected int Query()
        {
            if (this.cmbStockDept.Tag == null || this.cmbStockDept.Tag.ToString() == "")
            {
                MessageBox.Show(Language.Msg("请选择查询药房"));
                return(-1);
            }

            System.Data.DataSet ds = new DataSet();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            if (dataManager.ExecQuery("Pharmacy.DayStore.DayReport", ref ds, this.cmbStockDept.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("查询发生错误") + dataManager.Err);
                return(-1);
            }

            if (ds == null || ds.Tables.Count <= 0)
            {
                return(0);
            }

            this.fpHead.DataSource = ds;

            return(1);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns>成功返回1 失败返回-1</returns>
        protected int Query()
        {
            if (!this.IsValid())
            {
                return(-1);
            }

            this.neuSpread1_Sheet1.Reset();
            string strSqlIndex = this.GetSqlIndex();

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

            DataSet ds = new DataSet();

            if (dataManager.ExecQuery(strSqlIndex, ref ds, this.cmbDrug.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("执行查询发生错误") + dataManager.Err);
                return(-1);
            }

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                this.neuSpread1_Sheet1.DataSource = ds;
                //{F371AF75-B75B-43a1-82BD-849A1FECB300}取消第一行的空行
                //this.neuSpread1_Sheet1.Rows.Add(0, 1);
                //this.neuSpread1_Sheet1.Cells[0, 0].ColumnSpan = this.neuSpread1_Sheet1.Columns.Count;
            }
            else
            {
                this.neuSpread1_Sheet1.DataSource = null;
                this.neuSpread1_Sheet1.Rows.Count = 0;
            }

            return(1);
        }
Beispiel #4
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>

        protected int Query()
        {
            if (this.cmbStockDept.Tag == null || this.cmbStockDept.Tag.ToString() == "")
            {
                MessageBox.Show(Language.Msg("请选择查询药库"));
                return(-1);
            }

            System.Data.DataSet ds = new DataSet();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            if (dataManager.ExecQuery("Pharmacy.Report.InputSum", ref ds, this.cmbStockDept.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("没有相关信息!") + dataManager.Err);
                return(-1);
            }

            if (ds == null || ds.Tables.Count <= 0)
            {
                return(0);
            }
            this.fpSpread1_Sheet1.DataSource = ds;



            int     iTotIndex = this.fpSpread1_Sheet1.RowCount;
            decimal sumNum4   = 0;
            decimal sumNum3   = 0;
            decimal sumNum2   = 0;
            decimal sumNum1   = 0;


            for (int i = 0; i < iTotIndex; i++)
            {
                sumNum1 = sumNum1 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 1].Text);
                sumNum2 = sumNum2 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 2].Text);
                sumNum3 = sumNum3 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 3].Text);
                sumNum4 = sumNum4 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 4].Text);
            }
            //this.fpSpread1_Sheet1.RowCount = iTotIndex + 1;
            this.fpSpread1_Sheet1.Rows.Add(iTotIndex, 1);
            this.fpSpread1_Sheet1.Cells[iTotIndex, 0].Text = "合计";
            this.fpSpread1_Sheet1.Cells[iTotIndex, 1].Text = sumNum1.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 2].Text = sumNum2.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 3].Text = sumNum3.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 4].Text = sumNum4.ToString();

            return(1);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        protected int Query()
        {
            //if (this.cmbStockDept.Tag == null || this.cmbStockDept.Tag.ToString() == "")
            //{
            //    MessageBox.Show(Language.Msg("请选择查询药库"));
            //    return -1;
            //}
            ds.Clear();
            this.GetQueryTime();
            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            if (dataManager.ExecQuery("Pharmacy.Report.ExpenseQuery", ref ds, this.cmbNurseCellCode.Tag.ToString(), this.cmbDrugCode.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString(), DateNum) == -1)
            {
                MessageBox.Show(Language.Msg("没有相关信息!") + dataManager.Err);
                return(-1);
            }

            if (ds == null || ds.Tables.Count <= 0)
            {
                return(0);
            }
            //this.filterField = new string[2] { "病区", "药品名称" };
            this.dv = new DataView(this.ds.Tables[0]);
            this.fpSpread1_Sheet1.DataSource = this.dv;

            //int iTotIndex = this.fpSpread1_Sheet1.RowCount;
            //decimal sumNum4 = 0;
            //decimal sumNum3 = 0;
            //decimal sumNum2 = 0;
            //decimal sumNum1 = 0;


            //for (int i = 0; i < iTotIndex; i++)
            //{
            //    sumNum1 = sumNum1 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 1].Text);
            //    sumNum2 = sumNum2 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 2].Text);
            //    sumNum3 = sumNum3 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 3].Text);
            //    sumNum4 = sumNum4 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 4].Text);
            //}
            ////this.fpSpread1_Sheet1.RowCount = iTotIndex + 1;
            //this.fpSpread1_Sheet1.Rows.Add(iTotIndex, 1);
            //this.fpSpread1_Sheet1.Cells[iTotIndex, 0].Text = "合计";
            //this.fpSpread1_Sheet1.Cells[iTotIndex, 1].Text = sumNum1.ToString();
            //this.fpSpread1_Sheet1.Cells[iTotIndex, 2].Text = sumNum2.ToString();
            //this.fpSpread1_Sheet1.Cells[iTotIndex, 3].Text = sumNum3.ToString();
            //this.fpSpread1_Sheet1.Cells[iTotIndex, 4].Text = sumNum4.ToString();

            return(1);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>

        protected int Query()
        {
            if (this.cmbStockDept.Tag == null || this.cmbStockDept.Tag.ToString() == "")
            {
                MessageBox.Show(Language.Msg("请选择查询药库"));
                return(-1);
            }

            if (this.dtpBeginTime.Value > this.dtpEndTime.Value)
            {
                MessageBox.Show("开始时间不能大于结束时间!");
                return(-1);
            }

            string sqlID = string.Empty;

            if (neuCheckBox1.Checked)
            {
                //显示药品类别
                sqlID = "WinForms.Report.Logistics.Pharmacy.InputSumBYDrugType";
            }
            else
            {
                //只按供货单位分组
                sqlID = "Report.Logistics.Pharmacy.InputSum";
            }

            System.Data.DataSet ds = new DataSet();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            if (dataManager.ExecQuery(sqlID, ref ds, this.cmbStockDept.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("没有相关信息!") + dataManager.Err);
                return(-1);
            }

            if (ds == null || ds.Tables.Count <= 0)
            {
                return(0);
            }
            this.fpSpread1_Sheet1.DataSource = ds;



            int     iTotIndex = this.fpSpread1_Sheet1.RowCount;
            decimal sumNum4   = 0;
            decimal sumNum3   = 0;
            decimal sumNum2   = 0;
            decimal sumNum1   = 0;


            if (neuCheckBox1.Checked)
            {
                for (int i = 0; i < iTotIndex; i++)
                {
                    sumNum1 = sumNum1 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 5].Text);
                    sumNum2 = sumNum2 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 2].Text);
                    sumNum3 = sumNum3 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 3].Text);
                    sumNum4 = sumNum4 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 4].Text);
                }
                //this.fpSpread1_Sheet1.RowCount = iTotIndex + 1;
                this.fpSpread1_Sheet1.Rows.Add(iTotIndex, 1);

                this.fpSpread1_Sheet1.Cells[iTotIndex, 0].Text = "合计";
                this.fpSpread1_Sheet1.Cells[iTotIndex, 5].Text = sumNum1.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex, 2].Text = sumNum2.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex, 3].Text = sumNum3.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex, 4].Text = sumNum4.ToString();
            }
            else
            {
                for (int i = 0; i < iTotIndex; i++)
                {
                    sumNum1 = sumNum1 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 1].Text);
                    sumNum2 = sumNum2 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 2].Text);
                    sumNum3 = sumNum3 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 3].Text);
                    sumNum4 = sumNum4 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 4].Text);
                }
                //this.fpSpread1_Sheet1.RowCount = iTotIndex + 1;
                this.fpSpread1_Sheet1.Rows.Add(iTotIndex, 1);
                this.fpSpread1_Sheet1.Cells[iTotIndex + 1, 0].Text = "合计";
                this.fpSpread1_Sheet1.Cells[iTotIndex + 1, 1].Text = sumNum1.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex + 1, 2].Text = sumNum2.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex + 1, 3].Text = sumNum3.ToString();
                this.fpSpread1_Sheet1.Cells[iTotIndex + 1, 4].Text = sumNum4.ToString();
            }

            return(1);
        }