private void btnCancel_Click(object sender, EventArgs e)
        {
            try
            {
                int fouceRowIndex = dbGridView.FocusedRowHandle;
                if (fouceRowIndex < 0)
                {
                    dbGrid.Focus();
                    SqlUtil.App.CustomMessageBox.MessageShow("请选择一条病人记录");
                    return;
                }
                DataRow foucesRow = dbGridView.GetDataRow(fouceRowIndex);
                if (null == foucesRow || null == foucesRow["NOOFINPAT"])
                {
                    return;
                }
                int    noofinpat  = int.Parse(foucesRow["NOOFINPAT"].ToString().Trim());
                string statusname = foucesRow["GDZT"].ToString().Trim();
                if (!(statusname == "已归档"))
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该状态病历不能撤销归档");
                    return;
                }
                //DataTable dt = DS_SqlService.GetRecordsByNoofinpat(noofinpat);
                //if (null == dt || dt.Rows.Count == 0)
                //{
                //    Common.Ctrs.DLG.MessageBox.Show(foucesRow["NAME"] + " 没有病历,无法撤销归档。");
                //    return;
                //}

                if (DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("您确定要撤销 " + foucesRow["NAME"] + " 的病历归档吗?", "撤销归档病历", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                //DS_BaseService.CheckRecordRebacked(noofinpat.ToString())
                if (foucesRow["islock"].ToString() == "4701")
                {
                    int num = DS_SqlService.SetRecordsCancel(noofinpat.ToString());
                    if (num > 0)
                    {
                        DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("撤销归档成功");
                        dbGridView.DeleteRow(dbGridView.FocusedRowHandle);
                        return;
                    }
                }
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该病人未归档无法撤销。");
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
Exemple #2
0
 /// <summary>
 /// 撤销归档
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancel_Click(object sender, EventArgs e)
 {
     try
     {
         int fouceRowIndex = gvInpatient.FocusedRowHandle;
         if (fouceRowIndex < 0)
         {
             gcInpatient.Focus();
             SqlUtil.App.CustomMessageBox.MessageShow("请选择一条病人记录");
             return;
         }
         DataRow foucesRow = gvInpatient.GetDataRow(fouceRowIndex);
         if (null == foucesRow || null == foucesRow["NOOFINPAT"])
         {
             return;
         }
         int noofinpat = int.Parse(foucesRow["NOOFINPAT"].ToString().Trim());
         if (DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("您确定要撤销 " + foucesRow["NAME"] + " 的病历归档吗?", "撤销归档病历", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.YesNo) == DialogResult.No)
         {
             return;
         }
         //DS_BaseService.CheckRecordRebacked(noofinpat.ToString())
         if (foucesRow["islock"].ToString() == "4701")
         {
             int num = DS_SqlService.SetRecordsCancel(noofinpat.ToString());
             if (num > 0)
             {
                 DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("撤销归档成功");
                 gvInpatient.DeleteRow(gvInpatient.FocusedRowHandle);
                 return;
             }
         }
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该病人未归档无法撤销。");
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("撤销归档失败!" + ex.Message);
         return;
     }
 }