Exemplo n.º 1
0
        /// <summary>
        /// 保存方法
        /// xlb 2013-01-08
        /// </summary>
        private void SaveEmrQcItem()
        {
            try
            {
                string message = "";
                if (!ValidateEdit(ref message))
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(message);
                    return;
                }
                emrQcItem        = new EmrQcItem();
                emrQcItem.Name   = textEditCodeName.Text;
                emrQcItem.Code   = textEditCode.Text;
                emrQcItem.I_Code = textEditICode.Text.Trim();
                emrQcItem.I_Name = textEditICodeName.Text;
                List <EmrQcItem> emrQcItemList = gridControlEmrQcItem.DataSource as List <EmrQcItem>;
                if (emrQcItemList == null)
                {
                    emrQcItemList = new List <EmrQcItem>();
                }

                if (textEditICode.Enabled)
                {
                    SqlParameter[] sps = { new SqlParameter("@ICODE", textEditICode.Text.Trim()) };
                    DataTable      dt  = DS_SqlHelper.ExecuteDataTable("select count(1) from emrqcitem where I_CODE=@ICODE ", sps, CommandType.Text);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        int count = int.Parse(dt.Rows[0][0].ToString());
                        if (count > 0)
                        {
                            DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该监控代码已存在");
                            textEditICode.Focus();
                            return;
                        }
                    }
                    EmrQcItem.InsertToEmrQcItem(emrQcItem);
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("新增成功");
                    emrQcItemList.Add(emrQcItem);
                }
                else
                {
                    EmrQcItem.UpdateToEmrQcItem(emrQcItem);
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("修改成功");
                }
                gridControlEmrQcItem.DataSource = new List <EmrQcItem>(emrQcItemList);
                gridViewEmrQcItem.MoveBy(emrQcItemList.Count - 1);

                SetEditState(false, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化病历质量控制数据
 /// xlb 2013-01-08
 /// </summary>
 private void InitDataEMrQcItem()
 {
     try
     {
         emrQcItem = new EmrQcItem();
         List <EmrQcItem> emrQcItemList = EmrQcItem.GetEmrQCItem(emrQcItem);
         gridControlEmrQcItem.DataSource = emrQcItemList;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 取消事件
 /// xlb 2013-01-08
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancel_Click(object sender, EventArgs e)
 {
     try
     {
         SetEditState(false, true);
         ClearControl(groupControlNotton);
         emrQcItem = new EmrQcItem();
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 显示选中行信息
 /// xlb 2013-01-08
 /// </summary>
 /// <param name="emrQcItem"></param>
 private void ShowEmrQcItem(EmrQcItem emrQcItem)
 {
     try
     {
         textEditCodeName.Text  = emrQcItem.Name;
         textEditCode.Text      = emrQcItem.Code;
         textEditICode.Text     = emrQcItem.I_Code;
         textEditICodeName.Text = emrQcItem.I_Name;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 查询方法
 /// xlb 2013-01-08
 /// </summary>
 private void Search()
 {
     try
     {
         emrQcItem        = new EmrQcItem();
         emrQcItem.I_Name = textEditCodeDesc.Text.Trim();
         emrQcItem.I_Code = txtCode.Text.Trim();
         List <EmrQcItem> emrQcItemList = EmrQcItem.GetEmrQCItem(emrQcItem);
         gridControlEmrQcItem.DataSource = emrQcItemList;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 选中行变化时触发的事件
 /// 项令波 2013-01-08
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridViewEmrQcItem_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         if (e.FocusedRowHandle < 0)
         {
             return;
         }
         emrQcItem = gridViewEmrQcItem.GetRow(e.FocusedRowHandle) as EmrQcItem;
         SetEditState(false, true);
         ShowEmrQcItem(emrQcItem);
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 删除事件
 /// xlb 2013-01-08
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDeleteEmrQcItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (gridViewEmrQcItem.FocusedRowHandle < 0)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("没有数据");
             return;
         }
         //获得需删除行的行号
         int rowHandel = gridViewEmrQcItem.FocusedRowHandle;
         int maxRow    = (gridViewEmrQcItem.DataSource as List <EmrQcItem>).Count;
         emrQcItem = gridViewEmrQcItem.GetRow(rowHandel) as EmrQcItem;
         int count = QCRule.QcRuleByQcCode(emrQcItem.I_Code);
         if (count > 0)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该监控代码被使用,无法删除");
             return;
         }
         DialogResult dialogDelete = DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("您确定删除此条数据吗?", "提示", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.OkCancel);
         if (dialogDelete == DialogResult.Cancel)
         {
             return;
         }
         EmrQcItem.DeleteEmrQcItem(emrQcItem);
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("删除成功");
         InitDataEMrQcItem();
         ClearControl(groupControlNotton);
         SetEditState(false, true);
         if (rowHandel >= 0 && rowHandel < maxRow - 1)
         {
             //焦点定位到删除行的下行 如果是最后一行
             gridViewEmrQcItem.MoveBy(rowHandel);
         }
         else if (rowHandel == maxRow - 1)
         {
             //如果删除最后一行则焦点定位到上一条数据
             gridViewEmrQcItem.MoveBy(rowHandel - 1);
         }
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 双击事件
 /// 应对FocusedRowChanged事件没触发
 /// xlb 2013-01-08
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridViewEmrQcItem_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (gridViewEmrQcItem.FocusedRowHandle < 0)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("请选择数据");
             return;
         }
         emrQcItem = gridViewEmrQcItem.GetRow(gridViewEmrQcItem.FocusedRowHandle) as EmrQcItem;
         SetEditState(false, true);
         ShowEmrQcItem(emrQcItem);
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }