/// <summary> /// 获取本地配置 /// </summary> /// <returns></returns> public List <EntityAppConfig> GetAppConfig(EntityPC pc) { using (BizLogin biz = new BizLogin()) { return(biz.GetAppConfig(pc)); } }
/// <summary> /// 本地参数配置 /// </summary> /// <param name="pc"></param> /// <returns></returns> public List <EntityAppConfig> GetAppConfig(EntityPC pc) { string SQL = string.Empty; List <EntityAppConfig> lstSetting = new List <EntityAppConfig>(); SqlHelper objSvc = new SqlHelper(EnumBiz.onlineDB); DataTable dt = null; try { string SQL1 = @"select t.typeid, t.setting from sysLocalsetting t where t.status = 1 "; IDataParameter[] objParamArr = null; if (!string.IsNullOrEmpty(pc.EmpNo)) { SQL += SQL1 + @"and t.typeid = 3 and t.empno = ?"; objParamArr = objSvc.CreateParm(1); objParamArr[0].Value = pc.EmpNo; dt = objSvc.GetDataTable(SQL, objParamArr); // 个人.优先 GetSetingArr(ref lstSetting, dt); } SQL = SQL1 + @"and t.typeid = 2 and (t.machinename = ? or t.ipaddr = ? or t.macaddr = ?)"; objParamArr = objSvc.CreateParm(3); objParamArr[0].Value = pc.MachineName; objParamArr[1].Value = pc.IpAddr; objParamArr[2].Value = pc.MacAddr; dt = objSvc.GetDataTable(SQL, objParamArr); // 本机.其次 GetSetingArr(ref lstSetting, dt); SQL = SQL1 + @"and t.typeid = 1"; dt = objSvc.GetDataTable(SQL); // 公用.再次 GetSetingArr(ref lstSetting, dt); } catch (Exception e) { ExceptionLog.OutPutException(e); } finally { objSvc = null; } return(lstSetting); }
/// <summary> /// 本地配置 /// </summary> /// <param name="empNo"></param> /// <returns></returns> List <EntityAppConfig> GetAppConfig(string empNo) { EntityPC pc = new EntityPC(); pc.MachineName = Function.LocalHostName(); pc.IpAddr = Function.LocalIP(); pc.MacAddr = Function.LocalMac(); pc.EmpNo = empNo; using (ProxyLogin proxy = new ProxyLogin()) { return(proxy.Service.GetAppConfig(pc)); } }