public OrgLocation FromMpLocation(MpLocation loc) { return(new OrgLocation { LocationId = loc.LocationId, LocationName = loc.LocationName, Address = loc.Address, City = loc.City, State = loc.State, Zip = loc.Zip, ImageUrl = loc.ImageUrl }); }
public static MobileModel GetMobile(string mobile) { if (!string.IsNullOrEmpty(mobile)) { MobileModel slt = null; string key = "phone_" + mobile; object cache = CacheUtils.GetCache(key); if (cache == null) { if (RegexUtils.IsMobile(mobile)) { string filename = HttpContext.Current.Server.MapPath("~/App_Data/MpData.dat"); if (mobile.Length > 7) { mobile = mobile.Substring(0, 7); } MpLocation mpl = MpLocator.GetMpLocation(filename, mobile.ToInt32()); slt = new MobileModel() { start = mpl.NumStart.ToString(), end = mpl.NumEnd.ToString(), location = mpl.Location }; } if (slt != null) { CacheUtils.SetCache(key, slt, new TimeSpan(0, 30, 0)); } } else { slt = cache as MobileModel; } return(slt); } return(null); }