private void miDel_Click(object sender, RoutedEventArgs e)
        {
            if (null == lvRecord.SelectedItem)
            {
                BLPublic.Dialogs.Alert("请选择要删除的记录.");
                lvRecord.Focus();
                return;
            }

            CheckRecord chkRcd = (CheckRecord)lvRecord.SelectedItem;

            if (!"手工录入".Equals(chkRcd.CheckName))
            {
                BLPublic.Dialogs.Alert("非手工录入,不可删除.");
                lvRecord.Focus();
                return;
            }

            if (BLPublic.Dialogs.Yes != BLPublic.Dialogs.Ask2("是否确定删除所选记录?"))
            {
                return;
            }

            if (AppConst.db.ExecSQL(string.Format(SQL.DEL_CHK_RCD, chkRcd.RecordNo)))
            {
                BLPublic.Dialogs.Info("删除成功");
                lvRecord.Items.RemoveAt(lvRecord.SelectedIndex);
                lvItems.Items.Clear();
            }
            else
            {
                BLPublic.Dialogs.Error("删除失败:" + AppConst.db.Error);
            }
        }
        private void lvRecord_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            lvItems.Items.Clear();
            if (null == lvRecord.SelectedItem)
            {
                return;
            }

            CheckRecord chkRcd = (CheckRecord)lvRecord.SelectedItem;
            string      sql    = "";

            if (WinAddCheck.CT_LISCHK.Equals(chkRcd.TypeCode))
            {
                sql = SQL.SEL_LISCHK_BYNO;
            }

            else if (WinAddCheck.CT_BODYCHK.Equals(chkRcd.TypeCode))
            {
                sql = SQL.SEL_BODYCHK_BYNO;
            }

            else if (WinAddCheck.CT_VIRUSCHK.Equals(chkRcd.TypeCode))
            {
                sql = SQL.SEL_VIRUSCHK_BYNO;
            }

            else
            {
                return;
            }

            sql = string.Format(sql, chkRcd.CheckTime.Substring(0, 10), chkRcd.RecordNo);

            IDataReader dr = null;
            int         i  = 1;

            if (AppConst.db.GetRecordSet(sql, ref dr))
            {
                while (dr.Read())
                {
                    lvItems.Items.Add(new CheckResult(i++, dr["ResultID"].ToString(), dr["Code"].ToString(),
                                                      dr["Name"].ToString(), dr["ResultValue"].ToString(), dr["ResultUnit"].ToString(),
                                                      dr["Domain"].ToString(), dr["ValueDrect"].ToString()));
                }

                dr.Close();
            }
            else
            {
                BLPublic.Dialogs.Error("加载检查内容失败:" + AppConst.db.Error);
            }
        }
        private void miDelRt_Click(object sender, RoutedEventArgs e)
        {
            if (null == lvRecord.SelectedItem)
            {
                BLPublic.Dialogs.Alert("请选择要删除的记录.");
                lvRecord.Focus();
                return;
            }

            if (null == lvItems.SelectedItem)
            {
                BLPublic.Dialogs.Alert("请选择要删除的记录.");
                lvItems.Focus();
                return;
            }

            CheckRecord chkRcd = (CheckRecord)lvRecord.SelectedItem;

            if (!"手工录入".Equals(chkRcd.CheckName))
            {
                BLPublic.Dialogs.Alert("非手工录入,不可删除.");
                lvRecord.Focus();
                return;
            }

            if (BLPublic.Dialogs.Yes != BLPublic.Dialogs.Ask2("是否确定删除所选记录?"))
            {
                return;
            }

            string sql = "";

            if (chkRcd.CheckType.Contains("体格检查"))
            {
                sql = SQL.DEL_BODYCHK;
            }
            else
            {
                sql = SQL.DEL_LISCHK;
            }

            if (AppConst.db.ExecSQL(string.Format(sql, chkRcd.RecordNo, ((CheckResult)lvItems.SelectedItem).ResultID)))
            {
                BLPublic.Dialogs.Info("删除成功");
                lvItems.Items.RemoveAt(lvItems.SelectedIndex);
            }
            else
            {
                BLPublic.Dialogs.Error("删除失败:" + AppConst.db.Error);
            }
        }
Exemple #4
0
        private void lvChkRecord_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (null == lvLISChkRecord.SelectedItem)
            {
                return;
            }

            CheckRecord chkRcd = (CheckRecord)lvLISChkRecord.SelectedItem;

            WinInfoDialog win = new WinInfoDialog();

            win.Owner       = AppConst.winMain;
            win.Title       = chkRcd.CheckType;
            win.PatientCode = this.patient.PatientCode;

            win.showCheckResult(chkRcd.RecordNo, chkRcd.TypeCode, chkRcd.CheckTime, this.addCustody);
            win.ShowDialog();
            win = null;
            lbOpRecord.Items.Refresh();
        }