Exemplo n.º 1
0
        /// <summary>
        /// 设置数据至报表

        /// </summary>
        private void m_mthSetDataToReport()
        {
            this.objController = new clsCtl_Purchase_Detail();

            datWindow.Modify("m_txtProviderName.text='" + Drv.ProviderName + "'");
            datWindow.Modify("m_txtIncomeBillNumber.text='" + Drv.IncomeBillNumber + "'");
            //datWindow.Modify("m_txtInvoiceNumber.text='" + Drv.InvoiceNumber + "'");
            datWindow.Modify("m_dtpInComeDate.text='" + Drv.InComeDate + "'");
            datWindow.Modify("m_txtProvidBillNo.text='" + Drv.ProvidBillNo + "'");
            datWindow.Modify("m_txtInvoiceDate.text='" + Drv.InvoiceDate + "'");
            datWindow.Modify("m_txtPurchasePerson.text='" + Drv.PurchasePerson + "'");
            datWindow.Modify("m_txtMakeBillPerson.text='" + Drv.MakeBillPerson + "'");
            datWindow.Modify("m_txtStroehouseManager.text='" + Drv.StroehouseManager + "'");
            datWindow.Modify("m_txtAccountant.text='" + Drv.Accountant + "'");
            datWindow.Modify("m_txtRemark.text='" + Drv.Remark + "'");
            datWindow.Modify("m_StorageName.text='" + Drv.StorageName + "'");
            datWindow.Modify("t_mone.text='" + Drv.strBigWrith + "'");

            if (datWindow.DataWindowObject == "purchase_detailreport_cs")
            {
                datWindow.Modify("t_tile.text = '" + this.objController.m_objComInfo.m_strGetHospitalTitle() + "入库单(" + Drv.StorageName + ")'");
            }
            else if (datWindow.DataWindowObject == "purchase_detailreport_ts")
            {
                datWindow.Modify("t_tile.text = '" + this.objController.m_objComInfo.m_strGetHospitalTitle() + "入库验收单'");
            }
            else
            {
                datWindow.Modify("t_tile.text = '" + this.objController.m_objComInfo.m_strGetHospitalTitle() + "采购入库单" + "'");
            }
            int m_intShow;
            clsDcl_Purchase_DetailReport m_objDon = new clsDcl_Purchase_DetailReport();

            m_objDon.m_lngGetIfShowInfo(out m_intShow);
            //((clsDcl_Purchase_DetailReport)m_objDomain).m_lngGetIfShowInfo(out m_blnShow);
            if (m_intShow == 0)
            {
                datWindow.Modify("t_info.text=''");
            }
            datWindow.SetRedrawOff();
            datWindow.Retrieve(Drv.p_dtbVal);
            datWindow.CalculateGroups();
            datWindow.Refresh();
            datWindow.SetRedrawOn();
        }
Exemplo n.º 2
0
        private void frmMedicineOutReport_Load(object sender, EventArgs e)
        {
            this.objController = new clsCtl_MedicineOut();
            //datWindow.DataWindowObject = "outstorage_detailreport_cs";
            if (datWindow.DataWindowObject == "outstorage_detailreport_cs")
            {
                datWindow.Modify("t_titel.text='" + this.objController.m_objComInfo.m_strGetHospitalTitle() + "出库单(" + RoomName + ")'");

                datWindow.Modify("t_bigwrith.text='" + strBigwrith + "'");

                dtb.Columns.Add("validperiod_chr", typeof(System.String));
                dtb.Columns.Add("group_int", typeof(System.Int32));
                int intGroup = 0;
                for (int i = 0; i < dtb.Rows.Count; i++)
                {
                    if (i % 15 == 0)
                    {
                        intGroup++;
                    }
                    dtb.Rows[i]["group_int"] = intGroup;
                    if (dtb.Rows[i]["validperiod_dat"].ToString().StartsWith("0001"))
                    {
                        dtb.Rows[i]["validperiod_chr"] = DBNull.Value;
                    }
                    else
                    {
                        dtb.Rows[i]["validperiod_chr"] = Convert.ToDateTime(dtb.Rows[i]["validperiod_dat"]).ToString("yyyy-MM-dd");
                    }
                }
                dtb.Columns.Remove("validperiod_dat");
            }
            else
            {
                datWindow.Modify("t_titel.text='" + this.objController.m_objComInfo.m_strGetHospitalTitle() + "药品调拔单'");
            }
            datWindow.Modify("m_storagename.text='" + RoomName + "'");
            datWindow.Modify("m_txtreceivedept.text='" + ReceiveDept + "'");
            datWindow.Modify("m_txtman.text='" + Man + "'");
            datWindow.Modify("m_txtman2.text='" + Man + "'");
            datWindow.Modify("m_dtpdate.text='" + zDate + "'");
            datWindow.Modify("m_txtoutputorder.text='" + OutputOrder + "'");

            int m_intShow;
            clsDcl_Purchase_DetailReport m_objDon = new clsDcl_Purchase_DetailReport();

            m_objDon.m_lngGetIfShowInfo(out m_intShow);
            if (m_intShow == 0)
            {
                datWindow.Modify("t_info.text=''");
            }
            datWindow.PrintProperties.Preview = true;
            datWindow.Retrieve(dtb);
            datWindow.CalculateGroups();
            datWindow.Refresh();

            if (i_showType == 0)
            {
                this.Visible = false;
                clsCtl_Public clsPub = new clsCtl_Public();
                clsPub.ChoosePrintDialog(datWindow, true);

                this.Close();
            }
        }
        private void frmInStorageMedicineWithdrawDetailReport_Load(object sender, EventArgs e)
        {
            int intGetPrintType;

            ((clsCtl_InStorageMedicineWithdrawDetailReport)objController).getPrinttype(out intGetPrintType);

            m_objDetail_Param = new clsMs_MedicineWithdrawDetailQueryCondition_VO();
            m_objDetail_Param.m_strStorageID = strInstorageid_vchr;
            strTitle = ((clsCtl_InStorageMedicineWithdrawDetailReport)objController).getLogo();
            datWindow.Modify("t_titel.text='" + strTitle + "'");
            int m_intShow;
            clsDcl_Purchase_DetailReport m_objDon = new clsDcl_Purchase_DetailReport();

            m_objDon.m_lngGetIfShowInfo(out m_intShow);


            if (intInitial == 0)
            {
                if (intGetPrintType == 1)
                {
                    //使用External格式的报表打印

                    datWindow.SetRedrawOff();
                    datWindow.DataWindowObject = null;
                    datWindow.DataWindowObject = "instoragemedicinewithdraw_cs";
                    datWindow.Modify("t_titel.text='" + strTitle + "退库单(" + strStoragename_chr + ")'");
                    datWindow.Modify("t_bug.text='" + decBug + "'");
                    datWindow.Modify("m_storagename.text='" + strStoragename_chr + "'");
                    datWindow.Modify("m_txtoutputorder.text='" + strInstorageid_vchr + "'");
                    datWindow.Modify("m_dtpdate.text='" + strExam_dat + "'");
                    datWindow.Modify("m_txtreceivedept.text='" + strReturndept_chr + "'");
                    datWindow.Modify("m_txtman.text='" + strMakername_chr + "'");
                    datWindow.Modify("m_txtman2.text='" + strMakername_chr + "'");
                    datWindow.Modify("m_txtprovidername.text='" + strInaccountername_chr + "'");
                    datWindow.Modify("t_commnet.text='" + strCommnet_vchr + "'");
                    if (m_intShow == 0)
                    {
                        datWindow.Modify("t_info.text=''");
                    }
                    for (int i = 0; i < m_dtbDetail.Rows.Count; i++)
                    {
                        DataRow dtr = m_dtbDetail.Rows[i];
                        int     row = this.datWindow.InsertRow();

                        this.datWindow.SetItemString(row, "assistcode_chr", dtr["assistcode_chr"].ToString());
                        this.datWindow.SetItemString(row, "medicinename_vch", dtr["medicinename_vch"].ToString());
                        this.datWindow.SetItemString(row, "medspec_vchr", dtr["medspec_vchr"].ToString());
                        this.datWindow.SetItemString(row, "opunit_chr", dtr["opunit_chr"].ToString());
                        this.datWindow.SetItemSqlDouble(row, "AMOUNT", Convert.ToDouble(dtr["AMOUNT"]));
                        this.datWindow.SetItemSqlDouble(row, "callprice_int", Convert.ToDouble(dtr["callprice_int"]));
                        this.datWindow.SetItemSqlDouble(row, "callsum", Convert.ToDouble(dtr["callsum"]));
                        this.datWindow.SetItemSqlDouble(row, "retailprice_int", Convert.ToDouble(dtr["retailprice_int"]));
                        this.datWindow.SetItemSqlDouble(row, "retailsum", Convert.ToDouble(dtr["retailsum"]));
                    }

                    //if (m_dtbDetail.Rows.Count % 6 != 0)
                    //{
                    //    int ros = 6 - m_dtbDetail.Rows.Count % 6;
                    //    int i_valCount = m_dtbDetail.Rows.Count + ros;
                    //    for (int i = 0; i < ros; i++)
                    //    {
                    //        int row = this.datWindow.InsertRow();
                    //        this.datWindow.SetItemString(row, "assistcode_chr", "");
                    //    }
                    //}
                    datWindow.SetRedrawOn();
                    datWindow.Refresh();
                    datWindow.PrintProperties.Preview = true;
                    return;
                }
                else
                {
                    datWindow.DataWindowObject = null;
                    datWindow.DataWindowObject = "instoragemedicinewithdraw_lj";

                    //按药品ID排序
                    DataView dtv = new DataView();
                    dtv         = m_dtbDetail.DefaultView;
                    dtv.Sort    = "assistcode_chr";
                    m_dtbDetail = dtv.ToTable();

                    datWindow.Modify("t_titel.text='" + strTitle + "退药单'");
                    if (m_intShow == 0)
                    {
                        datWindow.Modify("t_info.text=''");
                    }
                }
            }

            datWindow.Modify("t_bug.text='" + decBug + "'");
            datWindow.Modify("m_storagename.text='" + strStoragename_chr + "'");
            datWindow.Modify("m_txtoutputorder.text='" + strInstorageid_vchr + "'");
            datWindow.Modify("m_dtpdate.text='" + strExam_dat + "'");
            datWindow.Modify("m_txtreceivedept.text='" + strReturndept_chr + "'");
            datWindow.Modify("m_txtman.text='" + strMakername_chr + "'");
            datWindow.Modify("m_txtman2.text='" + strMakername_chr + "'");
            datWindow.Modify("m_txtprovidername.text='" + strInaccountername_chr + "'");
            datWindow.Modify("t_commnet.text='" + strCommnet_vchr + "'");
            if (m_intShow == 0)
            {
                datWindow.Modify("t_info.text=''");
            }
            if (intGetPrintType == 0)
            {
                DataRow dro;
                if (m_dtbDetail.Rows.Count % 6 != 0)
                {
                    int ros        = 6 - m_dtbDetail.Rows.Count % 6;
                    int i_valCount = m_dtbDetail.Rows.Count + ros;
                    for (int i = 0; i < ros; i++)
                    {
                        dro = m_dtbDetail.NewRow();
                        m_dtbDetail.Rows.Add(dro);
                    }
                }
            }
            datWindow.Retrieve(m_dtbDetail);
            datWindow.PrintProperties.Preview = true;
        }
        /// <summary>
        ///打开预览窗体
        /// </summary>
        internal long m_OutPurchasePrint(clsMS_OutStorage_VO m_objCurrentSubArr)
        {
            if (m_objCurrentSubArr == null)
            {
                MessageBox.Show("抱歉,没有数据可打印!", "药品入库", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(-1);
            }
            DataTable p_OutDtbVal = new DataTable();

            this.m_objDomain.m_lngGetOutStorageDetailReport(m_objCurrentSubArr.m_lngSERIESID_INT, m_objViewer.i_showType, out p_OutDtbVal, "");
            DataRow   dro;
            DataTable dtb    = new DataTable();
            int       i_temp = 0;

            string RoomName;

            this.m_objDomain.m_lngGetStoreRoomName(m_objCurrentSubArr.m_strSTORAGEID_CHR, out RoomName);
            if (m_objViewer.i_showType == 0)
            {
                dtb = p_OutDtbVal.Clone();

                //DataView dtv = new DataView();
                //dtv = dtb.DefaultView;
                //dtv.Sort = "medicinetypeid_chr,medicineid_chr";
                //dtb = dtv.ToTable();

                for (int i_low = 0; i_low < p_OutDtbVal.Rows.Count; i_low++)
                {
                    i_temp++;
                    dtb.ImportRow(p_OutDtbVal.Rows[i_low]);
                    //药品和材料分开两张打


                    if (((i_low + 1) >= p_OutDtbVal.Rows.Count) || ((p_OutDtbVal.Rows[i_low]["medicinetypesetid"].ToString()) != (p_OutDtbVal.Rows[i_low + 1]["medicinetypesetid"].ToString())))
                    {
                        int ros        = 8 - i_temp % 8;
                        int i_valCount = dtb.Rows.Count + ros;
                        for (int i = 0; i < ros; i++)
                        {
                            dro = dtb.NewRow();
                            dtb.Rows.Add(dro);
                        }
                        i_temp = 0;
                    }
                }

                m_objViewer.datWindow.DataWindowObject = "foreignretreatoutstorage_lj";
                m_objViewer.datWindow.Modify("t_titel.text='" + m_objComInfo.m_strGetHospitalTitle() + "退药出库单" + "'");
            }
            else
            {
                dtb = p_OutDtbVal.Copy();
                m_objViewer.datWindow.DataWindowObject = "foreignretreatoutstorage_cs";
                m_objViewer.datWindow.Modify("t_titel.text='" + m_objComInfo.m_strGetHospitalTitle() + "退货单(" + RoomName + ")'");
                m_objViewer.datWindow.Modify("t_OUTSTORAGEID.text='" + m_objViewer.strOutputOrder + "'");
            }
            decimal decBug = Convert.ToDecimal(m_objViewer.strBug);
            string  mmm    = new Money(decBug).ToString();

            m_objViewer.datWindow.Modify("t_bug.text='" + mmm + "'");
            m_objViewer.datWindow.Modify("t_outDate.text='" + m_objViewer.strOutDate + "'");
            m_objViewer.datWindow.Modify("t_VENDOR.text='" + m_objViewer.strVENDOR + "'");
            m_objViewer.datWindow.Modify("m_txtroom.text='" + RoomName + "'");
            m_objViewer.datWindow.Modify("m_txtman2.text='" + m_objCurrentSubArr.m_strASKERName + "'");
            m_objViewer.datWindow.Modify("m_txtman.text='" + m_objCurrentSubArr.m_strASKERName + "'");

            int m_intShow;
            clsDcl_Purchase_DetailReport m_objDon = new clsDcl_Purchase_DetailReport();

            m_objDon.m_lngGetIfShowInfo(out m_intShow);
            if (m_intShow == 0)
            {
                m_objViewer.datWindow.Modify("t_info.text=''");
            }

            m_objViewer.dtb = dtb;
            return(1);
        }