示例#1
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         CommonNoteEntity commonNoteEntity = gvDataCommon.GetFocusedRow() as CommonNoteEntity;
         if (commonNoteEntity == null)
         {
             return;
             //Common.Ctrs.DLG.MessageBox.Show("没有选中要删除的行");
             //throw new Exception("没有选中要删除的行");
         }
         DialogResult diaResult = m_app.CustomMessageBox.MessageShow("确定要删除吗?", DrectSoft.Core.CustomMessageBoxKind.QuestionYesNo);
         if (diaResult == DialogResult.No)
         {
             return;
         }
         string message = "";
         bool   result  = commonNoteBiz.DelCommonNote(commonNoteEntity, ref message);
         if (result)
         {
             m_app.CustomMessageBox.MessageShow("删除成功!");
             Search();
         }
         else
         {
             m_app.CustomMessageBox.MessageShow(message);
         }
     }
     catch (Exception ex)
     {
         m_app.CustomMessageBox.MessageShow(ex.Message);
     }
 }
示例#2
0
 /// <summary>
 /// 将配置单的单个项目分配到每一个标签下面
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 /// <param name="commonNote_ItemList"></param>
 private void SetCommonNoteTabByItem(CommonNoteEntity commonNoteEntity, List <CommonNote_ItemEntity> commonNote_ItemList)
 {
     try
     {
         if (commonNoteEntity == null || commonNoteEntity.CommonNote_TabList == null)
         {
             return;
         }
         foreach (var commonTab in commonNoteEntity.CommonNote_TabList)
         {
             if (commonTab != null)
             {
                 List <CommonNote_ItemEntity> commonNoteiemList = new List <CommonNote_ItemEntity>();
                 foreach (var item in commonNote_ItemList)
                 {
                     if (item.CommonNote_Tab_Flow == commonTab.CommonNote_Tab_Flow)
                     {
                         commonNoteiemList.Add(item);
                     }
                 }
                 commonTab.CommonNote_ItemList = commonNoteiemList.OrderBy(a => Convert.ToInt32(a.OrderCode)).ToList();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
 /// <summary>
 /// 保存整体通用单
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public bool SaveCommonNoteAll(CommonNoteEntity commonNoteEntity, ref string message)
 {
     try
     {
         if (commonNoteEntity == null)
         {
             message = "保存的通用单为空";
             return(false);
         }
         SaveCommonNote(commonNoteEntity);
         SaveCommonNoteSiteRef(commonNoteEntity);
         foreach (var commonNote_TabItem in commonNoteEntity.CommonNote_TabList)
         {
             commonNote_TabItem.CommonNoteFlow = commonNoteEntity.CommonNoteFlow;
             SaveCommonNoteTab(commonNote_TabItem);
             if (commonNote_TabItem.CommonNote_ItemList == null)
             {
                 continue;
             }
             foreach (var item in commonNote_TabItem.CommonNote_ItemList)
             {
                 item.CommonNoteFlow      = commonNoteEntity.CommonNoteFlow;
                 item.CommonNote_Tab_Flow = commonNote_TabItem.CommonNote_Tab_Flow;
                 SaveCommonNoteItem(item);
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         message = ex.Message;
         return(false);
     }
 }
示例#4
0
        /// <summary>
        /// 获取通用单据的详细信息
        /// </summary>
        /// <param name="commonNoteFlow"></param>
        /// <returns></returns>
        public CommonNoteEntity GetDetailCommonNote(string commonNoteFlow)
        {
            try
            {
                CommonNoteEntity commonNoteEntity = new CommonNoteEntity();
                SqlParameter[]   sqlParams        = new SqlParameter[] {
                    new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50)
                };
                sqlParams[0].Value = commonNoteFlow;
                DataSet dataTableElement = m_app.SqlHelper.ExecuteDataSet("EMR_CommonNote.usp_GetDetailCommonNote", sqlParams, CommandType.StoredProcedure);
                commonNoteEntity = DataTableToList <CommonNoteEntity> .ConvertToModelOne(dataTableElement.Tables[0]);

                commonNoteEntity.CommonNote_TabList = DataTableToList <CommonNote_TabEntity> .ConvertToModel(dataTableElement.Tables[1]);

                List <CommonNote_ItemEntity> commonNote_ItemList = new List <CommonNote_ItemEntity>();
                commonNote_ItemList = DataTableToList <CommonNote_ItemEntity> .ConvertToModel(dataTableElement.Tables[2]);

                SetCommonNoteTabByItem(commonNoteEntity, commonNote_ItemList);
                SetCommonNoteSiteOne(commonNoteEntity);
                return(commonNoteEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
 /// <summary>
 /// 判断是否可编辑 如果该条单据已经使用 则不可再对该条单据进行修改
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 /// <returns></returns>
 private bool CanEditCommonNote(CommonNoteEntity commonNoteEntity)
 {
     try
     {
         if (string.IsNullOrEmpty(commonNoteEntity.CommonNoteFlow))
         {
             return(true);
         }
         else
         {
             string    sql     = string.Format("select count(*) from incommonnote i where i.commonnoteflow='{0}' and i.valide='1'", commonNoteEntity.CommonNoteFlow);
             DataTable dtCount = m_app.SqlHelper.ExecuteDataTable(sql, CommandType.Text);
             if (dtCount == null || dtCount.Rows == null | dtCount.Rows.Count <= 0)
             {
                 return(true);
             }
             else if (dtCount.Rows[0][0].ToString() == "0")
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#6
0
        //保存
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string message        = "";
                bool   validateResult = uCCommonNoteInfo.ValidateCommonNote();
                if (validateResult == false)
                {
                    return;
                }
                CommonNoteEntity      commonNoteEntityNew   = uCCommonNoteInfo.SaveCommonNote();
                bool                  saveResult            = commonNoteBiz.SaveCommonNoteAll(commonNoteEntityNew, ref message);
                CommonNoteCountEntity commonNoteCountEntity = uCCommonNoteInfo.SaveCommonCount();
                commonNoteCountEntity.CommonNoteFlow = commonNoteEntityNew.CommonNoteFlow;
                CommonNoteBiz.AddOrModCommonNoteEntity(commonNoteCountEntity);
                if (saveResult)
                {
                    m_app.CustomMessageBox.MessageShow("保存成功");


                    //从数据库中取对象 为了确保对象数据的完整
                    commonNoteEntityNew = commonNoteBiz.GetDetailCommonNote(commonNoteEntityNew.CommonNoteFlow);
                    Search();
                    //RefreshTabpage(commonNoteEntityNew);
                }
                else
                {
                    m_app.CustomMessageBox.MessageShow(message);
                }
            }
            catch (Exception ex)
            {
                m_app.CustomMessageBox.MessageShow(ex.Message);
            }
        }
示例#7
0
        //通用单项目
        private void SaveCommonNote(CommonNoteEntity commonNoteEntity)
        {
            try
            {
                if (string.IsNullOrEmpty(commonNoteEntity.CommonNoteFlow))
                {
                    commonNoteEntity.CommonNoteFlow = Guid.NewGuid().ToString();
                    commonNoteEntity.Valide         = "1";
                }
                if (string.IsNullOrEmpty(commonNoteEntity.CreateDoctorID) || string.IsNullOrEmpty(commonNoteEntity.CreateDoctorName))
                {
                    commonNoteEntity.CreateDoctorID   = m_app.User.DoctorId;
                    commonNoteEntity.CreateDoctorName = m_app.User.DoctorName;
                }
                DrectSoft.Core.GenerateShortCode generateShortCode = new DrectSoft.Core.GenerateShortCode(m_app.SqlHelper);
                string[] strpywbs = generateShortCode.GenerateStringShortCode(commonNoteEntity.CommonNoteName);
                if (strpywbs.Length == 2)
                {
                    commonNoteEntity.PYM = strpywbs[0];
                    commonNoteEntity.WBM = strpywbs[1];
                }

                SqlParameter[] sqlParams = new SqlParameter[] {
                    new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50),
                    new SqlParameter("@CommonNoteName", SqlDbType.VarChar, 50),
                    new SqlParameter("@PrinteModelName", SqlDbType.VarChar, 50),
                    new SqlParameter("@ShowType", SqlDbType.VarChar, 50),
                    new SqlParameter("@CreateDoctorID", SqlDbType.VarChar, 50),
                    new SqlParameter("@CreateDoctorName", SqlDbType.VarChar, 50),
                    new SqlParameter("@UsingFlag", SqlDbType.VarChar, 1),
                    new SqlParameter("@Valide", SqlDbType.VarChar, 1),
                    new SqlParameter("@PYM", SqlDbType.VarChar, 50),
                    new SqlParameter("@WBM", SqlDbType.VarChar, 50),
                    new SqlParameter("@UsingPicSign", SqlDbType.VarChar, 1),
                    new SqlParameter("@UsingCheckDoc", SqlDbType.VarChar, 1)
                };

                sqlParams[0].Value  = commonNoteEntity.CommonNoteFlow;
                sqlParams[1].Value  = commonNoteEntity.CommonNoteName;
                sqlParams[2].Value  = commonNoteEntity.PrinteModelName;
                sqlParams[3].Value  = commonNoteEntity.ShowType;
                sqlParams[4].Value  = commonNoteEntity.CreateDoctorID;
                sqlParams[5].Value  = commonNoteEntity.CreateDoctorName;
                sqlParams[6].Value  = commonNoteEntity.UsingFlag;
                sqlParams[7].Value  = commonNoteEntity.Valide;
                sqlParams[8].Value  = commonNoteEntity.PYM;
                sqlParams[9].Value  = commonNoteEntity.WBM;
                sqlParams[10].Value = commonNoteEntity.UsingPicSign;
                sqlParams[11].Value = commonNoteEntity.UsingCheckDoc;
                m_app.SqlHelper.ExecuteNoneQuery("EMR_CommonNote.usp_AddOrModCommonNote", sqlParams, CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#8
0
 private void btnCopy_Click(object sender, EventArgs e)
 {
     try
     {
         CommonNoteEntity commonNoteEntity = gvDataCommon.GetFocusedRow() as CommonNoteEntity;
         if (commonNoteEntity == null)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("没有选中记录");
             return;
         }
         CommonNoteEntity commonNoteNew = new CommonNoteEntity();
         commonNoteNew = commonNoteBiz.GetDetailCommonNote(commonNoteEntity.CommonNoteFlow);
         commonNoteNew.CommonNoteFlow   = "";
         commonNoteNew.CreateDateTime   = "";
         commonNoteNew.CreateDoctorID   = "";
         commonNoteNew.CreateDoctorName = "";
         if (commonNoteNew.CommonNote_TabList != null)
         {
             foreach (var tabitem in commonNoteNew.CommonNote_TabList)
             {
                 tabitem.CommonNoteFlow      = "";
                 tabitem.CommonNote_Tab_Flow = "";
                 tabitem.CreateDateTime      = "";
                 tabitem.CreateDoctorID      = "";
                 tabitem.CreateDoctorName    = "";
                 foreach (var item in tabitem.CommonNote_ItemList)
                 {
                     item.CommonNoteFlow       = "";
                     item.CommonNote_Tab_Flow  = "";
                     item.CommonNote_Item_Flow = "";
                     item.CreateDateTime       = "";
                     item.CreateDoctorID       = "";
                     item.CreateDoctorName     = "";
                 }
             }
         }
         string message    = "";
         bool   saveResult = commonNoteBiz.SaveCommonNoteAll(commonNoteNew, ref message);
         if (saveResult)
         {
             Search();
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功");
         }
         else
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(message);
         }
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
示例#9
0
 public CommonNoteInfo(CommonNoteEntity commonNoteEntity, IEmrHost app)
 {
     try
     {
         m_CommonNoteEntity = commonNoteEntity;
         m_app = app;
         InitializeComponent();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#10
0
 //添加通用单标签页 包括新增和修改
 private void AddTabPage(CommonNoteEntity commonNoteEntity)
 {
     try
     {
         uCCommonNoteInfo = new CommonTableConfig.CommonNoteInfo(commonNoteEntity, m_app);
         uCCommonNoteInfo.btnSave.Click += new EventHandler(btnSave_Click);
         uCCommonNoteInfo.ShowDialog();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#11
0
        private void SaveCommonNoteSiteRef(CommonNoteEntity commonNoteEntity)
        {
            try
            {
                //先删除所有的对应科室和病区 再重新添加
                SqlParameter[] sqlParamsDel = new SqlParameter[] {
                    new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50)
                };
                sqlParamsDel[0].Value = commonNoteEntity.CommonNoteFlow;
                m_app.SqlHelper.ExecuteNoneQuery("EMR_CommonNote.usp_DelCommonNote_Site", sqlParamsDel, CommandType.StoredProcedure);

                foreach (var item in commonNoteEntity.BaseDepartments)
                {
                    SqlParameter[] sqlParams = new SqlParameter[]
                    {
                        new SqlParameter("@Site_Flow", SqlDbType.VarChar, 50),
                        new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50),
                        new SqlParameter("@RelationType", SqlDbType.VarChar, 50),
                        new SqlParameter("@Site_ID", SqlDbType.VarChar, 50),
                        new SqlParameter("@Valide", SqlDbType.VarChar, 50)
                    };
                    sqlParams[0].Value = Guid.NewGuid().ToString();
                    sqlParams[1].Value = commonNoteEntity.CommonNoteFlow;
                    sqlParams[2].Value = "01";
                    sqlParams[3].Value = item.Id;
                    sqlParams[4].Value = "1";
                    m_app.SqlHelper.ExecuteNoneQuery("EMR_CommonNote.usp_AddOrModCommonNote_Site", sqlParams, CommandType.StoredProcedure);
                }

                foreach (var item in commonNoteEntity.BaseAreas)
                {
                    SqlParameter[] sqlParams = new SqlParameter[] {
                        new SqlParameter("@Site_Flow", SqlDbType.VarChar, 50),
                        new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50),
                        new SqlParameter("@RelationType", SqlDbType.VarChar, 50),
                        new SqlParameter("@Site_ID", SqlDbType.VarChar, 50),
                        new SqlParameter("@Valide", SqlDbType.VarChar, 50)
                    };
                    sqlParams[0].Value = Guid.NewGuid().ToString();
                    sqlParams[1].Value = commonNoteEntity.CommonNoteFlow;
                    sqlParams[2].Value = "02";
                    sqlParams[3].Value = item.Id;
                    sqlParams[4].Value = "1";
                    m_app.SqlHelper.ExecuteNoneQuery("EMR_CommonNote.usp_AddOrModCommonNote_Site", sqlParams, CommandType.StoredProcedure);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#12
0
 /// <summary>
 /// 删除配置单
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public bool DelCommonNote(CommonNoteEntity commonNoteEntity, ref string message)
 {
     commonNoteEntity.Valide = "0";
     try
     {
         SaveCommonNote(commonNoteEntity);
         return(true);
     }
     catch (Exception ex)
     {
         message = ex.Message;
         return(false);
     }
 }
示例#13
0
        /// <summary>
        /// 通过流水号获取配置单
        /// </summary>
        /// <param name="commonNoteFlow"></param>
        /// <returns></returns>
        public CommonNoteEntity GetSimpleCommonNoteByflow(string commonNoteFlow)
        {
            try
            {
                string           sql              = string.Format("select * from commonnote where commonnote.commonnoteflow='{0}';", commonNoteFlow);
                DataTable        dtCommonNote     = m_app.SqlHelper.ExecuteDataTable(sql, CommandType.Text);
                CommonNoteEntity commonNoteEntity = DataTableToList <CommonNoteEntity> .ConvertToModelOne(dtCommonNote);

                SetCommonNoteSiteOne(commonNoteEntity);
                return(commonNoteEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#14
0
 /// <summary>
 /// 双击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gvDataCommon_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         CommonNoteEntity commonNoteEntity = gvDataCommon.GetFocusedRow() as CommonNoteEntity;
         if (commonNoteEntity == null)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("没有选中要编辑的项目");
             return;
             //throw new Exception("没有选中要编辑的项目");
         }
         RefreshTabpage(commonNoteEntity);
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
示例#15
0
        /// <summary>
        /// 为单个配置单设置科室和病区
        /// </summary>
        /// <param name="commonNoteitem"></param>
        private void SetCommonNoteSiteOne(CommonNoteEntity commonNoteitem)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[] {
                    new SqlParameter("@commonnoteflow", SqlDbType.VarChar, 50)
                };
                sqlParams[0].Value = commonNoteitem.CommonNoteFlow;
                DataSet dataSetSite = m_app.SqlHelper.ExecuteDataSet("EMR_CommonNote.usp_GetCommonNoteSite", sqlParams, CommandType.StoredProcedure);
                commonNoteitem.BaseDepartments = DataTableToList <BaseDictory> .ConvertToModel(dataSetSite.Tables[0]);

                commonNoteitem.BaseAreas = DataTableToList <BaseDictory> .ConvertToModel(dataSetSite.Tables[1]);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#16
0
        /// <summary>
        /// 初始化CommonNoteEntity中的信息到控件上
        /// </summary>
        private void InitCommonNoteData()
        {
            try
            {
                if (!string.IsNullOrEmpty(m_CommonNoteEntity.CommonNoteFlow))
                {
                    m_CommonNoteEntity = m_CommonNoteBiz.GetDetailCommonNote(m_CommonNoteEntity.CommonNoteFlow);
                }
                txtNoteName.Text = m_CommonNoteEntity.CommonNoteName;

                DataTable dtPrint = m_CommonNoteBiz.GetPrintTem();
                //处理打印模板 显示模板名和描述
                string printShowName = m_CommonNoteEntity.PrinteModelName;
                if (dtPrint != null && dtPrint.Rows.Count > 0)
                {
                    foreach (DataRow dritem in dtPrint.Rows)
                    {
                        int myIndex = dritem["TEMPNAME"].ToString().IndexOf(".");
                        if (myIndex > 0 && dritem["TEMPNAME"].ToString().Substring(0, myIndex) == m_CommonNoteEntity.PrinteModelName)
                        {
                            printShowName = dritem["TEMPNAME"].ToString() + "--" + dritem["TEMPDESC"].ToString();
                            break;
                        }
                    }
                }
                cboxPrint.Text       = printShowName;
                comboxShowType.Text  = m_CommonNoteEntity.ShowType;
                chboxUsing.Checked   = m_CommonNoteEntity.UsingFlag == "1" ? true : false;
                chboxPicEdit.Checked = m_CommonNoteEntity.UsingPicSign == "1" ? true : false;
                //chboxCheck.Checked = m_CommonNoteEntity.UsingCheckDoc == "1" ? true : false;
                //加载科室信息
                InitChcomBoxChecked(chListDept, m_CommonNoteEntity.BaseDepartments);
                //加载病区信息
                InitChcomBoxChecked(chlistWard, m_CommonNoteEntity.BaseAreas);
                //加载commonNoteTab
                InitCommonNoteTab(m_CommonNoteEntity.CommonNote_TabList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#17
0
 /// <summary>
 /// 添加数据库存在的tab
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 private void RefreshTabpage(CommonNoteEntity commonNoteEntity)
 {
     AddTabPage(commonNoteEntity);
 }