コード例 #1
0
 /// <summary>
 /// 根据选择科室控制,质控员和科主任下拉框
 /// </summary>
 private void GetDoctorUser()
 {
     try
     {
         string deptid = lookUpEditorDepartment.CodeValue;
         if (deptid == "")
         {
             return;
         }
         else
         {
             //处理科室质控员下拉框
             string sql = string.Format(@"select * from users a where a.valid = 1 and 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", 70);
             cols.Add("NAME", 80);
             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", 70);
             cols1.Add("NAME", 80);
             SqlWordbook deptWordBook1 = new SqlWordbook("querybook", dt1, "ID", "NAME", cols1, "ID//NAME//py//wb");
             lookUpEZhuRen.SqlWordbook = deptWordBook1;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
ファイル: OutMedicalScore.cs プロジェクト: xuanximoming/key
 /// <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;
     }
 }
コード例 #3
0
        /// <summary>
        /// 根据用户质控权限初始化窗口 add by wyt 2012-12-06
        /// </summary>
        private void InitQCManager()
        {
            try
            {
                bool haveRole = false;
                m_auth = Authority.DEPTQC;  //默认科室质控员
                string deptid = m_App.User.CurrentDeptId;
                string userid = m_App.User.DoctorId;
                //质控科质控员
                string   configvalue = m_SqlManger.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_auth   = Authority.QC;
                                    haveRole = true;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        foreach (string item in userJobid) //取出
                        {
                            if (item == configvalue)       //当前登录人的jobid在系统配置中,可以查看全院质控
                            {
                                m_auth   = Authority.QC;
                                haveRole = true;
                                break;
                            }
                        }
                    }
                }
                # region 王运涛 注释
                //string gwcodes = m_App.User.GWCodes;
                //string[] gwcode = gwcodes.Split(',');
                //foreach (string code in gwcode)
                //{
                //    if (code == "88")
                //    {
                //        m_auth = Authority.QC;
                //        break;
                //    }
                //}
                //string qcuserid = GetConfigValueByKey("RHQCMangesConfig");
                //string[] qcuserids = qcuserid.Split(',');
                //foreach (string id in qcuserids)
                //{
                //    if (m_App.User.DoctorId == id)
                //    {
                //        m_auth = Authority.QC;
                //        break;
                //    }
                //}
                //if (m_App.User.CurrentDeptId == "5117")
                //{
                //    m_auth = Authority.QC;
                //}
                #endregion
                if (haveRole == false)
                {
                    DataTable deptmanager = m_SqlManger.GetDirectorDoc(deptid);
                    foreach (DataRow dr in deptmanager.Rows)
                    {
                        if (dr["ID"].ToString() == userid)
                        {
                            m_auth = Authority.DEPTMANAGER;
                            break;
                        }
                    }
                }
                switch (m_auth)
                {
                case Authority.DEPTQC:
                    this.simpleButtonAddQC.Visible    = true;
                    this.simpleButtonSubmit.Visible   = true;
                    this.simpleButtonCheckIn.Visible  = false;
                    this.simpleButtonCheckOut.Visible = false;
                    this.simpleButtonDel.Visible      = true;
                    break;

                case Authority.DEPTMANAGER:
                    this.simpleButtonAddQC.Visible    = false;
                    this.simpleButtonSubmit.Visible   = false;
                    this.simpleButtonCheckIn.Visible  = true;
                    this.simpleButtonCheckOut.Visible = true;
                    this.simpleButtonDel.Visible      = false;
                    break;

                case Authority.QC:
                    this.simpleButtonAddQC.Visible    = true;
                    this.simpleButtonSubmit.Visible   = false;
                    this.simpleButtonCheckIn.Visible  = false;
                    this.simpleButtonCheckOut.Visible = false;
                    this.simpleButtonDel.Visible      = true;
                    break;
                }
            }