Exemplo n.º 1
0
        /// <summary>
        /// 根据选择科室控制,质控员和科主任下拉框
        /// </summary>
        private void GetDoctorUser()
        {
            string deptid = lookUpEditorDepartment.CodeValue;

            if (deptid == "")
            {
                return;
            }
            else
            {
                //处理科室质控员下拉框
                string sql = string.Format(@"select * from users a where a.deptid = '{0}' and a.grade is not null  and a.grade <> '2004' ", deptid);
                lookUpWQCPerson.SqlHelper = m_App.SqlHelper;
                DataTable dt = m_App.SqlHelper.ExecuteDataTable(sql);
                dt.Columns["ID"].Caption   = "医生代码";
                dt.Columns["NAME"].Caption = "医生名称";
                Dictionary <string, int> cols = new Dictionary <string, int>();
                cols.Add("ID", 65);
                cols.Add("NAME", 160);
                SqlWordbook deptWordBook = new SqlWordbook("querybook", dt, "ID", "NAME", cols, "ID//NAME//py//wb");
                lookUpEQCPerson.SqlWordbook = deptWordBook;
                //处理科室主任下拉框
                lookUpEZhuRen.Enabled   = true;
                lookUpWZhuren.SqlHelper = m_App.SqlHelper;
                DataTable dt1 = m_SqlManager.GetDirectorDoc(deptid);
                dt1.Columns["ID"].Caption   = "医生代码";
                dt1.Columns["NAME"].Caption = "医生名称";
                Dictionary <string, int> cols1 = new Dictionary <string, int>();
                cols1.Add("ID", 65);
                cols1.Add("NAME", 160);
                SqlWordbook deptWordBook1 = new SqlWordbook("querybook", dt1, "ID", "NAME", cols1, "ID//NAME//py//wb");
                lookUpEZhuRen.SqlWordbook = deptWordBook1;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 根据用户质控权限初始化窗口 add by wyt 2012-12-12
 /// </summary>
 private void InitQCManager()
 {
     try
     {
         bool haveRole = false;
         m_qcAuth = Authority.DEPTQC;  //默认科室质控员
         lookUpEditorDepartment.Enabled = false;
         lookUpEditorStatus.Enabled     = false;
         string deptid = m_app.User.CurrentDeptId;
         string userid = m_app.User.DoctorId;
         //质控科质控员
         string   configvalue = m_SqlManager.GetConfigValueByKey("ShowAllDeptQuality");
         string   c_UserJobId = m_app.User.GWCodes;              //当前登录人的jobid标识
         string[] userJobid   = c_UserJobId.Split(',');
         if (!string.IsNullOrEmpty(configvalue))
         {
             if (configvalue.Contains(","))                      //配置了多个角色可查看
             {
                 string[] configjobid = configvalue.Split(',');  //配置里的多个角色jobid
                 for (int i = 0; i < configjobid.Length; i++)    //先循环配置里所有jobid
                 {
                     if (haveRole == true)
                     {
                         break;
                     }
                     for (int j = 0; j < userJobid.Length; j++)  //再循环登录人的多个jobid
                     {
                         if (configjobid[i] == userJobid[j])
                         {
                             m_qcAuth = Authority.QC;
                             haveRole = true;
                             lookUpEditorDepartment.Enabled = true;
                             lookUpEditorStatus.Enabled     = true;
                             break;
                         }
                     }
                 }
             }
             else
             {
                 foreach (string item in userJobid) //取出
                 {
                     if (item == configvalue)       //当前登录人的jobid在系统配置中,可以查看全院质控
                     {
                         m_qcAuth = Authority.QC;
                         haveRole = true;
                         lookUpEditorDepartment.Enabled = true;
                         lookUpEditorStatus.Enabled     = true;
                         break;
                     }
                 }
             }
         }
         if (haveRole == false)
         {
             DataTable deptmanager = m_SqlManager.GetDirectorDoc(deptid);
             foreach (DataRow dr in deptmanager.Rows)
             {
                 if (dr["ID"].ToString() == userid)
                 {
                     m_qcAuth = Authority.DEPTMANAGER;
                     lookUpEditorDepartment.Enabled = false;
                     lookUpEditorStatus.Enabled     = false;
                     break;
                 }
             }
         }
     }
     catch
     {
         throw;
     }
 }