public HeaderFooterSetting(ZYTextDocument doc, SQLUtil sqlUtil) { InitializeComponent(); m_Doc = doc; m_SqlUtil = sqlUtil; }
/// <summary> /// 根据配置操作模板列表 /// **ywk* /// </summary> /// <param name="_emrDepartMent"></param> /// <returns></returns> private DataTable GetEmrDeptMent(DataTable _emrDepartMent) { bool IsOperDt = false; DataTable newdt = new DataTable(); SQLUtil sqlutil = new SQLUtil(m_app); string configvalue = sqlutil.GetConfigValueByKey("UniversalTempletConfig"); 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 { for (int j = 0; j < userJobid.Length; j++) //再循环登录人的多个jobid { if (configjobid[i] == userJobid[j]) { IsOperDt = true;//循环到配置中有此角色时,就没必要再循环了 break; } //else //{ // IsOperDt = false; //} } } } else//只配置了一个角色 { foreach (string item in userJobid)//取出 { if (item == configvalue)//当前登录人的jobid在系统配置中, { IsOperDt = true; break; } //else //{ // IsOperDt = false; //} } } } if (!IsOperDt)//如果配置了就把DT数据处理 { newdt = _emrDepartMent.Copy(); DataRow[] dr = newdt.Select("DEPT_ID='*' "); for (int i = 0; i < dr.Length; i++) { newdt.Rows.Remove(dr[i]); } } else { //newdt = _emrDepartMent.Copy(); newdt = m_app.SqlHelper.ExecuteDataTable("select DEPT_ID,DEPT_NAME from EMRDEPT order by DEPT_NAME "); //在配置里的可以看到所有的 } return(newdt); }