예제 #1
0
        private void Del_Click(object sender, RoutedEventArgs e)
        {
            if (null == lvRecord.SelectedItem)
            {
                BLPublic.Dialogs.Alert("选择要删除记录.");
                lvRecord.Focus();
                return;
            }
            if (BLPublic.Dialogs.Yes != BLPublic.Dialogs.Ask("是否确定删除所选记录?"))
            {
                lvRecord.Focus();
            }

            AnalysisModel rcd = (AnalysisModel)lvRecord.SelectedItem;

            if (AppConst.db.ExecSQL(string.Format(SQL.DEL_RCD + SQL.DEL_RCD_ITEM_BYRCD, rcd.RecordID)))
            {
                lvRecord.Items.RemoveAt(lvRecord.SelectedIndex);
                this.frmRpt.showReport(null);

                BLPublic.Dialogs.Info("删除成功.");
            }
            else
            {
                BLPublic.Dialogs.Error("删除失败:" + AppConst.db.Error);
            }
        }
예제 #2
0
        /// <summary>
        /// 显示评价记录
        /// </summary>
        /// <param name="_rcd"></param>
        private void showRecord(AnalysisModel _rcd)
        {
            IDataReader dr = null;

            BLPublic.BLDataReader blDR = null;
            if (null == this.report)
            {
                this.report = new Report();
                this.report.Load(@"report.frx");

                if (AppConst.db.GetRecordSet(SQL.SEL_ANALYSIS_DOCITEM, ref dr))
                {
                    blDR = new BLPublic.BLDataReader(dr);
                    while (blDR.next())
                    {
                        this.report.SetParameterValue(blDR.getString("DataItemCode").ToLower(), blDR.getString("DefaultValue"));
                    }

                    blDR.close();
                }
                else
                {
                    BLPublic.Dialogs.Error("评价文档默认值失败:" + AppConst.db.Error);
                    return;
                }

                this.report.SetParameterValue("isman", boolLabel(false));
                this.report.SetParameterValue("iswoman", boolLabel(false));
            }

            setReportValue("recorder", _rcd.Recorder);
            setReportValue("recordtime", _rcd.RecordTime);

            if (AppConst.db.GetRecordSet(string.Format(SQL.SEL_PNTINFO, this.patient.PatientCode), ref dr))
            {
                blDR = new BLPublic.BLDataReader(dr);
                if (blDR.next())
                {
                    string sex = blDR.getString("Sex");
                    this.report.GetParameter("patient.roomname").Value     = blDR.getString("DeptName");
                    this.report.GetParameter("patient.bedno").Value        = blDR.getString("BedNo");
                    this.report.GetParameter("patient.inhospitalno").Value = blDR.getString("HospitalNo");
                    this.report.GetParameter("patient.patientname").Value  = blDR.getString("PatientName");
                    this.report.GetParameter("isman").Value   = boolLabel("男".Equals(sex) || "m".Equals(sex));
                    this.report.GetParameter("iswoman").Value = boolLabel("女".Equals(sex) || "f".Equals(sex));
                }

                blDR.close();
            }

            if (AppConst.db.GetRecordSet(string.Format(SQL.SEL_RCDITEMS, _rcd.RecordID), ref dr))
            {
                blDR = new BLPublic.BLDataReader(dr);
                while (blDR.next())
                {
                    setReportValue(blDR.getString("DataItemCode").ToLower(), blDR.getString("ItemValue"));
                }

                blDR.close();
            }

            this.frmRpt.showReport(this.report);
        }