Exemple #1
0
        /// <summary>
        /// 即为添加操作,如果原来已经配置该科室,则为更新操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            string deptid        = lookUpEditorDepartment.CodeValue.ToString();
            string qcmanagerid   = lookUpEQCPerson.CodeValue.ToString();
            string chiefdoctorid = lookUpEZhuRen.CodeValue.ToString();
            string valid         = string.Empty;

            if (string.IsNullOrEmpty(deptid) && string.IsNullOrEmpty(qcmanagerid))
            {
                m_App.CustomMessageBox.MessageShow("请核对选择项!");
                return;
            }
            DataTable dt = m_SqlManager.GetDeptQCManager(deptid);

            if (dt.Rows.Count > 0)//有就更新
            {
                m_SqlManager.UpdateQCManagerUSer("", deptid, qcmanagerid, chiefdoctorid, "1");
                m_App.CustomMessageBox.MessageShow("更新成功");
            }
            else//没有就插入
            {
                m_SqlManager.InsertQCManagerUSer("", deptid, qcmanagerid, chiefdoctorid, "1");
                m_App.CustomMessageBox.MessageShow("新增成功");
            }
            BindGridControl();
        }
Exemple #2
0
        /// <summary>
        /// 即为添加操作,如果原来已经配置该科室,则为更新操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            try
            {
                string deptid        = lookUpEditorDepartment.CodeValue.ToString() == null ? string.Empty : lookUpEditorDepartment.CodeValue.ToString();
                string qcmanagerid   = lookUpEQCPerson.CodeValue.ToString() == null ? string.Empty : lookUpEQCPerson.CodeValue.ToString();
                string chiefdoctorid = lookUpEZhuRen.CodeValue.ToString() == null ? string.Empty : lookUpEZhuRen.CodeValue.ToString();
                string valid         = string.Empty;

                if (string.IsNullOrEmpty(deptid))
                {
                    m_App.CustomMessageBox.MessageShow("选项不能为空,请核对选择项!");
                    lookUpEditorDepartment.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(qcmanagerid))
                {
                    m_App.CustomMessageBox.MessageShow("选项不能为空,请核对选择项!");
                    lookUpEQCPerson.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(chiefdoctorid))
                {
                    m_App.CustomMessageBox.MessageShow("选项不能为空,请核对选择项!");
                    lookUpEZhuRen.Focus();
                    return;
                }
                DataTable dt = m_SqlManager.GetDeptQCManager(deptid);
                if (dt.Rows.Count > 0)//有就更新
                {
                    m_SqlManager.UpdateQCManagerUSer("", deptid, qcmanagerid, chiefdoctorid, "1");
                    m_App.CustomMessageBox.MessageShow("更新成功");
                }
                else//没有就插入
                {
                    m_SqlManager.InsertQCManagerUSer("", deptid, qcmanagerid, chiefdoctorid, "1");
                    m_App.CustomMessageBox.MessageShow("新增成功");
                }
                BindGridControl();
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }