Example #1
0
 /// <summary>
 /// 新增构造函数的参数 控制页面设置复选框显示 edit by ywk 2012-3-31 14:06:39
 /// </summary>
 /// <param name="emrtemplet"></param>
 /// <param name="app"></param>
 public AddNewTemplate(Emrtemplet emrtemplet, IEmrHost app, bool isShowPage)
 {
     InitializeComponent();
     m_app                    = app;
     m_emrtemplet             = null == emrtemplet ? new Emrtemplet() : emrtemplet;
     this.chkPageSize.Visible = isShowPage;
     this.chkPageSize.Checked = isShowPage;
 }
Example #2
0
        /// <summary>
        /// 将页面信息绑定到Emrtemplet实体中
        /// edit by Yanqiao.Cai 2012-11-06
        /// add try ... catch
        /// </summary>
        private void BindEmrTemplet()
        {
            try
            {
                if (this.lookUpEditorMr_class.CodeValue == "")
                {//必须填写模板类型
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("请选择模板类型");
                    this.lookUpEditorMr_class.Focus();
                    return;
                }
                else if (this.txt_mr_name.Text.Trim().Length == 0)
                {//必须填写模板名称
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("模板名称不能为空");
                    this.txt_mr_name.Focus();
                    return;
                }
                else if (this.lookUpEditorDepartment.CodeValue == "")
                {//必须填写模板科室
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("请选择所属科室");
                    this.lookUpEditorDepartment.Focus();
                    return;
                }
                else if (this.lookUpEditorDepartment.CodeValue != "*" && this.lookUpEditorDepartment.CodeValue != "通用科室")
                {
                    var subDepts = m_depts.Select(" len(ID) > 2 and ID <> '" + this.lookUpEditorDepartment.CodeValue + "' and ID like '" + this.lookUpEditorDepartment.CodeValue + "%" + "' ");
                    if (null != subDepts && subDepts.Length > 0)
                    {
                        DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(this.lookUpEditorDepartment.Text + "下存在子科室,请选择子科室。");
                        this.lookUpEditorDepartment.Focus();
                        return;
                    }
                }

                m_IsOK                 = true;
                m_emrtemplet           = new Emrtemplet();
                m_emrtemplet.TempletId = this.txtTEMPLET_ID.Text;
                m_emrtemplet.MrClass   = this.lookUpEditorMr_class.CodeValue;
                //add by ywk 2012年4月15日12:00:46
                //if (ContainStar)//如果含有星号
                //{
                //    m_emrtemplet.MrName = "★" + this.txt_mr_name.Text;
                //}
                //else
                //{
                m_emrtemplet.MrName = this.txt_mr_name.Text;
                //}

                m_emrtemplet.QcCode     = this.lookUpEditorqc_code.CodeValue;
                m_emrtemplet.DeptId     = this.lookUpEditorDepartment.CodeValue;
                m_emrtemplet.WriteTimes = this.radgroupWRITE_TIMES.SelectedIndex;
                //新页
                if (this.chk_new_page_falg.Checked)
                {
                    m_emrtemplet.NewPageFlag = 1;
                }
                else
                {
                    m_emrtemplet.NewPageFlag = 0;
                }
                //新页结束
                if (this.chk_new_page_end.Checked)
                {
                    m_emrtemplet.NEW_PAGE_END = 1;
                }
                else
                {
                    m_emrtemplet.NEW_PAGE_END = 0;
                }
                //首程
                if (this.checkEditFirstDaily.Checked)
                {
                    m_emrtemplet.IsFirstDailyEmr = "1";
                }
                else
                {
                    m_emrtemplet.IsFirstDailyEmr = "0";
                }
                m_DailyTitle          = txtTitle.Text;
                m_emrtemplet.FileName = m_DailyTitle;
                if (chkIsShowTitle.Checked)
                {
                    m_IsShowDailyTitle = "1";
                }
                else
                {
                    m_IsShowDailyTitle = "0";
                }
                m_emrtemplet.IsShowDailyTitle = m_IsShowDailyTitle;
                if (checkEditIsGouTong.Checked)
                {
                    m_IsYiHuanGouTong = "1";
                }
                else
                {
                    m_IsYiHuanGouTong = "0";
                }
                m_emrtemplet.IsYiHuanGouTong = m_IsYiHuanGouTong;

                //是否读取页面配置
                //add by ywk 2012年3月31日9:36:30
                if (chkPageSize.Checked)
                {
                    m_IsConfigPageSize = "1";
                }
                else
                {
                    m_IsConfigPageSize = "0";
                }
                m_emrtemplet.IsPageConfigSize = m_IsConfigPageSize;

                //判断是否含有星号
                if (m_MrName.StartsWith("★"))
                {
                    m_emrtemplet.ShowStar = true;
                }
                else
                {
                    m_emrtemplet.ShowStar = false;//封装为属性
                }



                m_emrtemplet.State = "";
                //if (m_emrtemplet != null)
                //{
                //    m_emrtemplet.TempletId = m_TempletId;
                //    m_emrtemplet.MrClass = m_MrClass;
                //    m_emrtemplet.MrName = m_MrName;
                //    m_emrtemplet.QcCode = m_QcCode;
                //    m_emrtemplet.DeptId = m_DeptId;
                //    m_emrtemplet.WriteTimes = m_WriteTimes;
                //    m_emrtemplet.NewPageFlag = m_NewPageFlag;
                //    m_emrtemplet.IsFirstDailyEmr = m_IsFirstDaily;
                //    m_emrtemplet.NewPageFlag = m_IsNew == false ? 0 : 1;
                //    m_emrtemplet.FileName = m_DailyTitle;
                //    m_emrtemplet.IsShowDailyTitle = m_IsShowDailyTitle;
                //}

                this.Close();
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }