public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "sessionresourceid": // Int return SessionResourceId.ToString(strFormat, formatProvider); case "sessionid": // Int return SessionId.ToString(strFormat, formatProvider); case "resourcelink": // NVarChar return PropertyAccess.FormatString(ResourceLink, strFormat); case "resourcedescription": // NVarChar if (ResourceDescription == null) { return ""; }; return PropertyAccess.FormatString(ResourceDescription, strFormat); case "resourcetype": // Int return ResourceType.ToString(strFormat, formatProvider); case "visibility": // Int return Visibility.ToString(strFormat, formatProvider); default: propertyNotFound = true; break; } return Null.NullString; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "userid": // Int return UserId.ToString(strFormat, formatProvider); case "status": // Int return Status.ToString(strFormat, formatProvider); case "receivenotifications": // Bit return ReceiveNotifications.ToString(); case "company": // NVarChar if (Company == null) { return ""; }; return PropertyAccess.FormatString(Company, strFormat); case "attcode": // NVarChar if (AttCode == null) { return ""; }; return PropertyAccess.FormatString(AttCode, strFormat); default: propertyNotFound = true; break; } return Null.NullString; }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "title": // NVarChar if (Title == null) { return ""; }; return PropertyAccess.FormatString(Title, strFormat); case "sessionattendeename": // NVarChar return PropertyAccess.FormatString(SessionAttendeeName, strFormat); case "createdbyuser": // NVarChar if (CreatedByUser == null) { return ""; }; return PropertyAccess.FormatString(CreatedByUser, strFormat); case "lastmodifiedbyuser": // NVarChar if (LastModifiedByUser == null) { return ""; }; return PropertyAccess.FormatString(LastModifiedByUser, strFormat); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "commentid": // Int return CommentId.ToString(strFormat, formatProvider); case "userid": // Int return UserId.ToString(strFormat, formatProvider); case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "sessionid": // Int return SessionId.ToString(strFormat, formatProvider); case "datime": // DateTime return Datime.ToString(strFormat, formatProvider); case "remarks": // NVarCharMax return PropertyAccess.FormatString(Remarks, strFormat); case "visibility": // Int return Visibility.ToString(strFormat, formatProvider); default: propertyNotFound = true; break; } return Null.NullString; }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "nrsessions": // Int if (NrSessions == null) { return ""; }; return ((int)NrSessions).ToString(strFormat, formatProvider); case "nrvotes": // Int if (NrVotes == null) { return ""; }; return ((int)NrVotes).ToString(strFormat, formatProvider); case "createdbyuser": // NVarChar if (CreatedByUser == null) { return ""; }; return PropertyAccess.FormatString(CreatedByUser, strFormat); case "lastmodifiedbyuser": // NVarChar if (LastModifiedByUser == null) { return ""; }; return PropertyAccess.FormatString(LastModifiedByUser, strFormat); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "code": // NVarChar return PropertyAccess.FormatString(Code, strFormat); case "name": // NVarChar return PropertyAccess.FormatString(Name, strFormat); case "description": // NVarChar if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "points": // Int return Points.ToString(strFormat, formatProvider); case "coords": // VarChar return PropertyAccess.FormatString(Coords, strFormat); case "latitude": // Float return Latitude.ToString(strFormat, formatProvider); case "longitude": // Float return Longitude.ToString(strFormat, formatProvider); case "altitude": // Int return Altitude.ToString(strFormat, formatProvider); case "region": // Int return Region.ToString(strFormat, formatProvider); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "displayname": // NVarChar return PropertyAccess.FormatString(DisplayName, strFormat); case "email": // NVarChar if (Email == null) { return ""; }; return PropertyAccess.FormatString(Email, strFormat); case "firstname": // NVarChar return PropertyAccess.FormatString(FirstName, strFormat); case "lastname": // NVarChar return PropertyAccess.FormatString(LastName, strFormat); case "conferencename": // NVarChar return PropertyAccess.FormatString(ConferenceName, strFormat); case "sessiontitle": // NVarChar if (SessionTitle == null) { return ""; }; return PropertyAccess.FormatString(SessionTitle, strFormat); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "portalid": // Int return PortalId.ToString(strFormat, formatProvider); case "name": // NVarChar return PropertyAccess.FormatString(Name, strFormat); case "description": // NVarCharMax if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "startdate": // DateTime if (StartDate == null) { return ""; }; return ((DateTime)StartDate).ToString(strFormat, formatProvider); case "enddate": // DateTime if (EndDate == null) { return ""; }; return ((DateTime)EndDate).ToString(strFormat, formatProvider); case "maxcapacity": // Int if (MaxCapacity == null) { return ""; }; return ((int)MaxCapacity).ToString(strFormat, formatProvider); case "sessionvoting": // Bit return SessionVoting.ToString(); case "attendeerole": // Int return AttendeeRole.ToString(strFormat, formatProvider); case "speakerrole": // Int return SpeakerRole.ToString(strFormat, formatProvider); case "location": // NVarChar if (Location == null) { return ""; }; return PropertyAccess.FormatString(Location, strFormat); case "url": // NVarChar if (Url == null) { return ""; }; return PropertyAccess.FormatString(Url, strFormat); default: propertyNotFound = true; break; } return Null.NullString; }
public SecurityGrid(DotNetNuke.Entities.Portals.PortalSettings ps, bool isReadOnly, string imgPath, PermissionInfo sec, int permId) { PortalSettings = ps; ReadOnly = isReadOnly; ImagePath = imgPath; Security = sec; PermissionsId = permId; }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "company": // NVarChar if (Company == null) { return ""; }; return PropertyAccess.FormatString(Company, strFormat); case "description": // NVarCharMax if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "descriptionshort": // NVarCharMax if (DescriptionShort == null) { return ""; }; return PropertyAccess.FormatString(DescriptionShort, strFormat); case "url": // NVarChar if (Url == null) { return ""; }; return PropertyAccess.FormatString(Url, strFormat); case "displayname": // NVarChar return PropertyAccess.FormatString(DisplayName, strFormat); case "firstname": // NVarChar return PropertyAccess.FormatString(FirstName, strFormat); case "lastname": // NVarChar return PropertyAccess.FormatString(LastName, strFormat); case "email": // NVarChar if (Email == null) { return ""; }; return PropertyAccess.FormatString(Email, strFormat); case "username": // NVarChar return PropertyAccess.FormatString(Username, strFormat); case "createdbyuser": // NVarChar if (CreatedByUser == null) { return ""; }; return PropertyAccess.FormatString(CreatedByUser, strFormat); case "lastmodifiedbyuser": // NVarChar if (LastModifiedByUser == null) { return ""; }; return PropertyAccess.FormatString(LastModifiedByUser, strFormat); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
/// <summary> /// /// </summary> /// <param name="objScheduleHistoryItem"></param> /// <param name="controller"></param> public Emailer(DotNetNuke.Services.Scheduling.ScheduleHistoryItem objScheduleHistoryItem, IDnnqaController controller) { if (controller == null) { throw new ArgumentException(@"Controller is nothing.", "controller"); } Controller = controller; ScheduleHistoryItem = objScheduleHistoryItem; }
public UrlRewiterSettings(DotNetNuke.Framework.Providers.Provider objProvider) { if (objProvider.Attributes["fileExtension"] != null) { _fileExtension = objProvider.Attributes["fileExtension"]; } else { _fileExtension = ".aspx"; } }
/// ----------------------------------------------------------------------------- /// <summary> /// GetSearchItems implements the ISearchable Interface /// </summary> /// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param> /// ----------------------------------------------------------------------------- public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) { var items = new SearchItemInfoCollection(); // Add the devices to the search index. foreach (var item in Factory.ActiveProvider.Devices) { string guid = String.Format("DeviceID={0}", item.DeviceId); var device = new Device(item); items.Add(new SearchItemInfo( device.HardwareCaption, String.Format("{0} running {1} with browser {2}", device.HardwareCaption, device.SoftwareCaption, device.BrowserCaption), ModInfo.CreatedByUserID, Factory.ActiveProvider.PublishedDate, ModInfo.ModuleID, device.DeviceID, device.Content, guid)); } // Add the properties to the search. foreach (var property in Factory.ActiveProvider.Properties) { items.Add(new SearchItemInfo( property.Name, property.Description, ModInfo.CreatedByUserID, Factory.ActiveProvider.PublishedDate, ModInfo.ModuleID, property.Name, property.Description)); foreach (var value in property.Values) { string name = String.Format("{0} - {1}", property.Name, value.Name); items.Add(new SearchItemInfo( name, value.Description, ModInfo.CreatedByUserID, Factory.ActiveProvider.PublishedDate, ModInfo.ModuleID, name, value.Description)); } } return items; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "sessionid": // Int return SessionId.ToString(strFormat, formatProvider); case "userid": // Int return UserId.ToString(strFormat, formatProvider); default: propertyNotFound = true; break; } return Null.NullString; }
/// ----------------------------------------------------------------------------- /// <summary> /// GetSearchItems implements the ISearchable Interface /// </summary> /// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param> /// ----------------------------------------------------------------------------- public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) { //SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); //List<Ourspace_SubmittedProposalsInfo> colOurspace_SubmittedProposalss = GetOurspace_SubmittedProposalss(ModInfo.ModuleID); //foreach (Ourspace_SubmittedProposalsInfo objOurspace_SubmittedProposals in colOurspace_SubmittedProposalss) //{ // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objOurspace_SubmittedProposals.Content, objOurspace_SubmittedProposals.CreatedByUser, objOurspace_SubmittedProposals.CreatedDate, ModInfo.ModuleID, objOurspace_SubmittedProposals.ItemId.ToString(), objOurspace_SubmittedProposals.Content, "ItemId=" + objOurspace_SubmittedProposals.ItemId.ToString()); // SearchItemCollection.Add(SearchItem); //} //return SearchItemCollection; throw new System.NotImplementedException("The method or operation is not implemented."); }
/// ----------------------------------------------------------------------------- /// <summary> /// GetSearchItems implements the ISearchable Interface /// </summary> /// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param> /// ----------------------------------------------------------------------------- public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) { //SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); //List<HallOfFameInfo> colHallOfFames = GetHallOfFames(ModInfo.ModuleID); //foreach (HallOfFameInfo objHallOfFame in colHallOfFames) //{ // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objHallOfFame.Content, objHallOfFame.CreatedByUser, objHallOfFame.CreatedDate, ModInfo.ModuleID, objHallOfFame.ItemId.ToString(), objHallOfFame.Content, "ItemId=" + objHallOfFame.ItemId.ToString()); // SearchItemCollection.Add(SearchItem); //} //return SearchItemCollection; throw new System.NotImplementedException("The method or operation is not implemented."); }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "displayname": // NVarChar if (DisplayName == null) { return ""; }; return PropertyAccess.FormatString(DisplayName, strFormat); case "takeofftime": // DateTime return TakeoffTime.ToString(strFormat, formatProvider); case "takeoffdescription": // NVarChar return PropertyAccess.FormatString(TakeoffDescription, strFormat); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "title": // NVarChar if (Title == null) { return ""; }; return PropertyAccess.FormatString(Title, strFormat); case "tagname": // NVarChar return PropertyAccess.FormatString(TagName, strFormat); case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); default: return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound); } }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "tagid": // Int return TagId.ToString(strFormat, formatProvider); case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "tagname": // NVarChar return PropertyAccess.FormatString(TagName, strFormat); default: propertyNotFound = true; break; } return Null.NullString; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "userid": // Int return UserId.ToString(strFormat, formatProvider); case "sort": // Int if (Sort == null) { return ""; }; return ((int)Sort).ToString(strFormat, formatProvider); case "url": // NVarChar if (Url == null) { return ""; }; return PropertyAccess.FormatString(Url, strFormat); case "description": // NVarCharMax if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "descriptionshort": // NVarCharMax if (DescriptionShort == null) { return ""; }; return PropertyAccess.FormatString(DescriptionShort, strFormat); case "company": // NVarChar if (Company == null) { return ""; }; return PropertyAccess.FormatString(Company, strFormat); default: propertyNotFound = true; break; } return Null.NullString; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "slotid": // Int return SlotId.ToString(strFormat, formatProvider); case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "start": // Time return Start.ToString(strFormat, formatProvider); case "durationmins": // Int return DurationMins.ToString(strFormat, formatProvider); case "slottype": // Int return SlotType.ToString(strFormat, formatProvider); case "title": // NVarChar if (Title == null) { return ""; }; return PropertyAccess.FormatString(Title, strFormat); case "description": // NVarCharMax if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "daynr": // Int if (DayNr == null) { return ""; }; return ((int)DayNr).ToString(strFormat, formatProvider); case "locationid": // Int if (LocationId == null) { return ""; }; return ((int)LocationId).ToString(strFormat, formatProvider); default: propertyNotFound = true; break; } return Null.NullString; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "locationid": // Int return LocationId.ToString(strFormat, formatProvider); case "conferenceid": // Int return ConferenceId.ToString(strFormat, formatProvider); case "name": // NVarChar if (Name == null) { return ""; }; return PropertyAccess.FormatString(Name, strFormat); case "description": // NVarCharMax if (Description == null) { return ""; }; return PropertyAccess.FormatString(Description, strFormat); case "capacity": // Int if (Capacity == null) { return ""; }; return ((int)Capacity).ToString(strFormat, formatProvider); case "sort": // Int if (Sort == null) { return ""; }; return ((int)Sort).ToString(strFormat, formatProvider); case "backgroundcolor": // NVarChar if (BackgroundColor == null) { return ""; }; return PropertyAccess.FormatString(BackgroundColor, strFormat); default: propertyNotFound = true; break; } return Null.NullString; }
public override List<SitemapUrl> GetUrls(int portalId, DotNetNuke.Entities.Portals.PortalSettings ps, string version) { var listOfUrls = new List<SitemapUrl>(); foreach (var a in Article.GetAllArticlesList(portalId)) { var pageUrl = new SitemapUrl { Url = Utility.GetItemLinkUrl(a.ItemId, portalId), Priority = (float)0.5, LastModified = Convert.ToDateTime(a.LastUpdated), ChangeFrequency = SitemapChangeFrequency.Daily }; listOfUrls.Add(pageUrl); } return listOfUrls; }
public DataTable ASP_nsQLTT(DotNetNuke.Entities.Users.UserInfo info, int moduleID) { SqlParameter[] para = new SqlParameter[1]; para[0] = new SqlParameter("@UserID", info.UserID); DataTable dt; if (info.IsInRole("DuyetTin")) dt = CMD_SELECT(SQL_nsQLTT_ALL, para).Tables[0]; else dt = CMD_SELECT(SQL_nsQLTT, para).Tables[0]; DataColumn dc = new DataColumn("NewsLink"); dt.Columns.Add(dc); dc = new DataColumn("NewsEdit"); dt.Columns.Add(dc); dt.AcceptChanges(); foreach (DataRow dr in dt.Rows) { dr.BeginEdit(); dr["NewsLink"] = DotNetNuke.Common.Globals.NavigateURL(Convert.ToInt32(dr[5].ToString()), "", "id/" + dr[0].ToString()); dr["NewsEdit"] = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "nsNEWS", "mid/" + moduleID, "id/" + dr[0].ToString()); dr.EndEdit(); } return dt; }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "flightid": // Int return FlightId.ToString(strFormat, formatProvider); case "beaconid": // Int return BeaconId.ToString(strFormat, formatProvider); case "passeddistance": // Int if (PassedDistance == null) { return ""; }; return ((int)PassedDistance).ToString(strFormat, formatProvider); case "passorder": // Int return PassOrder.ToString(strFormat, formatProvider); default: propertyNotFound = true; break; } return Null.NullString; }
public DataImportScheduler(DotNetNuke.Services.Scheduling.ScheduleHistoryItem scheduleHistoryItem) { ScheduleHistoryItem = scheduleHistoryItem; }
public void ParseCSV(DotNetNuke.Services.FileSystem.FileInfo fileInfo, int startIndex) { using (CsvReader reader = new CsvReader(new StreamReader(fileInfo.PhysicalPath), true)) { int tabModuleId = DataProvider.Instance().GetTabModuleIdByFileId(fileInfo.FileId); int lineNumber = 0; if (startIndex == 0) { DataProvider.Instance().ClearTempLocations(); } else { lineNumber = startIndex; reader.MoveTo(startIndex - 1); } try { while (reader.ReadNextRecord()) { lineNumber++; Location location = new Location(); location.LocationId = Convert.ToInt32(GetValue(reader, "UNIQUE_KEY"), CultureInfo.InvariantCulture); location.ExternalIdentifier = GetValue(reader, "EXTERNAL_IDENTIFIER"); location.Name = GetValue(reader, "LOCATION_NAME"); string address1 = GetValue(reader, "ADDRESS1"); string address2 = GetValue(reader, "ADDRESS2"); location.City = GetValue(reader, "CITY"); string state = GetValue(reader, "STATE"); location.PostalCode = GetValue(reader, "ZIP"); location.Phone = GetValue(reader, "PHONE_NUMBER"); location.LocationDetails = GetValue(reader, "LOCATION_DETAILS"); location.Website = GetValue(reader, "WEBSITE"); location.PortalId = this.portalId; string locationType = GetValue(reader, "TYPE_OF_LOCATION"); if (locationType == string.Empty) { locationType = "Default"; } string country = GetValue(reader, "COUNTRY"); DataTable dt = DataProvider.Instance().GetLocationTypes(); int locationTypeId = -1; foreach (DataRow dr in dt.Rows) { if (Convert.ToString(dr["LocationTypeName"], CultureInfo.InvariantCulture) == locationType) { locationTypeId = Convert.ToInt32(dr["LocationTypeID"], CultureInfo.InvariantCulture); location.LocationTypeId = locationTypeId; } } if (locationTypeId == -1) { locationTypeId = DataProvider.Instance().InsertLocationType(locationType); location.LocationTypeId = locationTypeId; } location.RegionId = ResolveState(state); if (location.RegionId < 1) { location.RegionId = Convert.ToInt32(null, CultureInfo.InvariantCulture); } location.CountryId = ResolveCountry(country); if (location.CountryId < 1) { ModuleController objModules = new ModuleController(); location.CountryId = Dnn.Utility.GetIntSetting(objModules.GetTabModuleSettings(tabModuleId), "DefaultCountry").Value; } location.CsvLineNumber = lineNumber; location.Address = address1; // Address2 is informational only - See Pat Renner. location.Address2 = address2; GeocodeResult geocodeResult = GetGeoCoordinates(tabModuleId, address1, location.City, location.RegionId, location.PostalCode, location.CountryId); if (geocodeResult.Successful) { location.Latitude = geocodeResult.Latitude; location.Longitude = geocodeResult.Longitude; } location.Approved = true; try { location.SaveTemp(geocodeResult.Successful); } catch (SqlException ex) { Exceptions.LogException(ex); } } } catch (ArgumentException exc) { Exceptions.LogException(exc); this.FileMove(false); } if (lineNumber == 0) { this.FileMove(false); } } }
public List<MenuNode> ManipulateNodes(List<MenuNode> nodes, DotNetNuke.Entities.Portals.PortalSettings portalSettings) { // jump out if we don't have [CAT] token in nodes if (nodes.Count(x => x.Text.ToUpper() == "[CAT]") == 0) return nodes; var nameValueCollection = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query); _catid = nameValueCollection["catid"]; _catguidkey = nameValueCollection["category"]; _tabid = PortalSettings.Current.ActiveTab.TabID.ToString(""); var defaultListPage = ""; defaultListPage = StoreSettings.Current.Get("productlisttab"); var catNodeList = GetCatNodeXml(_tabid, 0, true, 0, null, defaultListPage); // [TODO: We want to cache this data, but doing so brakes the menu, becuase the cache is by Reference to the object, which is changed on display to fit into the menu. We can't easily clone the object because MenuNode doesn't support IClone, need to find a way around this.] //const string cacheListKey = "catnodesxml_list"; // keep a list of menu nodes so we can remove them //var cacheKey = "catnodesxml_" + _tabid; //var catNodeList = (List<MenuNode>)Utils.GetCache(cacheKey); //if (catNodeList == null) //{ // catNodeList = GetCatNodeXml(_tabid); // Utils.SetCache(cacheKey, catNodeList); // var keylist = (List<String>)Utils.GetCache(cacheListKey) ?? new List<string>(); // keylist.Add(cacheKey); // Utils.SetCache(cacheListKey, keylist); //} //if (catNodeList.Count >= 1) catNodeList[0].Parent = null; //Utils.RemoveCache(cacheKey); // see if we need to merge into the current pages, by searching for marker page [cat] int idx = 0; var catNods = new Dictionary<int,MenuNode>(); foreach (var n in nodes) { if (n.Text.ToLower() == "[cat]") { catNods.Add(idx,n); break; } idx += 1; } if (catNods.Count > 0) { foreach (var catNod in catNods) { // remove marker page [cat] nodes.Remove(catNod.Value); } var insidx = idx; foreach (var n2 in catNodeList) { if (n2.Parent == null) { nodes.Insert(insidx, n2); } insidx += 1; } } return nodes; }
public static string Tokenize(string strContent, DotNetNuke.Entities.Modules.ModuleInfo modInfo, UserInfo user, bool forceDebug, bool bRevertToDnn) { string cacheKey_Installed = "avt.MyTokens2.Installed"; string cacheKey_MethodReplace = "avt.MyTokens2.MethodReplace"; string bMyTokensInstalled = "no"; System.Reflection.MethodInfo methodReplace = null; bool bDebug = forceDebug; if (!bDebug) { try { bDebug = DotNetNuke.Common.Globals.IsEditMode(); } catch { } } lock (typeof(DotNetNuke.Services.Tokens.TokenReplace)) { // first, determine if MyTokens is installed if (HttpRuntime.Cache.Get(cacheKey_Installed) == null) { // check again, maybe current thread was locked by another which did all the work if (HttpRuntime.Cache.Get(cacheKey_Installed) == null) { // it's not in cache, let's determine if it's installed try { Type myTokensRepl = DotNetNuke.Framework.Reflection.CreateType("avt.MyTokens.MyTokensReplacer", true); if (myTokensRepl == null) throw new Exception(); // handled in catch bMyTokensInstalled = "yes"; // we now know MyTokens is installed, get ReplaceTokensAll methods methodReplace = myTokensRepl.GetMethod( "ReplaceTokensAll", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static, null, System.Reflection.CallingConventions.Any, new Type[] { typeof(string), typeof(DotNetNuke.Entities.Users.UserInfo), typeof(bool), typeof(DotNetNuke.Entities.Modules.ModuleInfo) }, null ); if (methodReplace == null) { // this shouldn't really happen, we know MyTokens is installed throw new Exception(); } } catch { bMyTokensInstalled = "no"; } // cache values so next time the funciton is called the reflection logic is skipped HttpRuntime.Cache.Insert(cacheKey_Installed, bMyTokensInstalled); if (bMyTokensInstalled == "yes") { HttpRuntime.Cache.Insert(cacheKey_MethodReplace, methodReplace); } } } } bMyTokensInstalled = HttpRuntime.Cache.Get(cacheKey_Installed).ToString(); if (bMyTokensInstalled == "yes") { methodReplace = (System.Reflection.MethodInfo)HttpRuntime.Cache.Get(cacheKey_MethodReplace); if (methodReplace == null) { HttpRuntime.Cache.Remove(cacheKey_Installed); return Tokenize(strContent, modInfo, user, forceDebug, bRevertToDnn); } } else { // if it's not installed return string or tokenize with DNN replacer if (!bRevertToDnn) { return strContent; } else { DotNetNuke.Services.Tokens.TokenReplace dnnTknRepl = new DotNetNuke.Services.Tokens.TokenReplace(); dnnTknRepl.AccessingUser = user ?? DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo(); dnnTknRepl.DebugMessages = bDebug; if (modInfo != null) dnnTknRepl.ModuleInfo = modInfo; // MyTokens is not installed, execution ends here return dnnTknRepl.ReplaceEnvironmentTokens(strContent); } } // we have MyTokens installed, proceed to token replacement return (string)methodReplace.Invoke( null, new object[] { strContent, user ?? DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo(), bDebug, modInfo } ); }
public Hashtable GetUserProperties(DotNetNuke.Entities.Users.UserInfo dnnUser) { Hashtable ht = new Hashtable(); foreach (DotNetNuke.Entities.Profile.ProfilePropertyDefinition up in dnnUser.Profile.ProfileProperties) { ht.Add(up.PropertyName, up.PropertyValue); } return ht; }