/// <summary> /// 通过ip地址获取,该城市对应的供应商信息 add by quxiaoshan 2015-4-17 /// </summary> /// <returns></returns> public Sys_Branch GetBranchCityByIp(string ip) { Ipinfo ipinfo = Address(ip); Sys_Branch branch = new Sys_Branch(); if (!string.IsNullOrEmpty(ipinfo.city)) { branch.LoadByCity(ipinfo.city); } else { branch.LoadByCity("北京"); } return(branch); }
/// <summary> /// 通过City获取其对应的Branch对象 add by quxiaoshan 2015-5-4 /// </summary> /// <param name="city"></param> public Sys_Branch SetBranchSessionByCity(string city) { Sys_Branch branch = new Sys_Branch(); if (branch.LoadByCity(city)) { return(branch); } return(null); }
/// <summary> /// 获取vip客户的branchId /// </summary> /// <param name="comId"></param> /// <returns></returns> public int GetVIPBranchId(string City, int ComId) { Customer customer = new Customer(ComId); int branchId = 0;//暂时这么处理 if (customer.IsNational == 1) { Sys_Branch branch = new Sys_Branch(); if (branch.LoadByCity(City)) { if (branch.IsUnable == 1) { branchId = branch.Id; } } } else { branchId = customer.BranchId; } return(branchId); }