Exemplo n.º 1
0
        private void PropertySave()
        {
            PropertiesController pc = new PropertiesController();
            PropertiesInfo       pi = new PropertiesInfo();

            pi.PropertyId = -1;
            pi.PortalId   = PortalId;
            pi            = (PropertiesInfo)(Utilities.ConvertFromHashTableToObject(Params, pi));
            pi.Name       = Utilities.CleanName(pi.Name);
            if (!(string.IsNullOrEmpty(pi.ValidationExpression)))
            {
                pi.ValidationExpression = HttpUtility.UrlDecode(HttpUtility.HtmlDecode(pi.ValidationExpression));
            }
            if (pi.PropertyId == -1)
            {
                string            lbl     = Params["Label"].ToString();
                LocalizationUtils lcUtils = new LocalizationUtils();
                lcUtils.SaveResource("[RESX:" + pi.Name + "].Text", lbl, PortalId);
            }
            else
            {
                if (Utilities.GetSharedResource("[RESX:" + pi.Name + "]").ToLowerInvariant().Trim() != Params["Label"].ToString().ToLowerInvariant().Trim())
                {
                    LocalizationUtils lcUtils = new LocalizationUtils();
                    lcUtils.SaveResource("[RESX:" + pi.Name + "].Text", Params["Label"].ToString(), PortalId);
                }
            }
            pc.SaveProperty(pi);
            ForumController fc = new ForumController();
            Forum           fi = fc.GetForum(PortalId, ModuleId, pi.ObjectOwnerId, true);

            fi.HasProperties = true;
            fc.Forums_Save(PortalId, fi, false, false);
        }
Exemplo n.º 2
0
        private void UpdateSort()
        {
            int propertyId          = -1;
            int sortOrder           = -1;
            PropertiesController pc = new PropertiesController();
            string props            = Params["props"].ToString();

            props = props.Remove(props.LastIndexOf("^"));
            foreach (string s in props.Split('^'))
            {
                if (!(string.IsNullOrEmpty(props)))
                {
                    propertyId = Convert.ToInt32(s.Split('|')[0]);
                    sortOrder  = Convert.ToInt32(s.Split('|')[1]);
                    PropertiesInfo pi = pc.GetProperty(propertyId, PortalId);
                    if (pi != null)
                    {
                        pi.SortOrder = sortOrder;
                        pc.SaveProperty(pi);
                    }
                }
            }
        }
Exemplo n.º 3
0
		private void UpdateSort()
		{

			int propertyId = -1;
			int sortOrder = -1;
			PropertiesController pc = new PropertiesController();
			string props = Params["props"].ToString();
			props = props.Remove(props.LastIndexOf("^"));
			foreach (string s in props.Split('^'))
			{
				if (! (string.IsNullOrEmpty(props)))
				{
					propertyId = Convert.ToInt32(s.Split('|')[0]);
					sortOrder = Convert.ToInt32(s.Split('|')[1]);
					PropertiesInfo pi = pc.GetProperty(propertyId, PortalId);
					if (pi != null)
					{
						pi.SortOrder = sortOrder;
						pc.SaveProperty(pi);
					}
				}
			}
		}
Exemplo n.º 4
0
		private void PropertySave()
		{

			PropertiesController pc = new PropertiesController();
			PropertiesInfo pi = new PropertiesInfo();
			pi.PropertyId = -1;
			pi.PortalId = PortalId;
			pi = (PropertiesInfo)(Utilities.ConvertFromHashTableToObject(Params, pi));
			pi.Name = Utilities.CleanName(pi.Name);
			if (! (string.IsNullOrEmpty(pi.ValidationExpression)))
			{
				pi.ValidationExpression = HttpUtility.UrlDecode(HttpUtility.HtmlDecode(pi.ValidationExpression));
			}
			if (pi.PropertyId == -1)
			{
				string lbl = Params["Label"].ToString();
				LocalizationUtils lcUtils = new LocalizationUtils();
				lcUtils.SaveResource("[RESX:" + pi.Name + "].Text", lbl, PortalId);
			}
			else
			{
				if (Utilities.GetSharedResource("[RESX:" + pi.Name + "]").ToLowerInvariant().Trim() != Params["Label"].ToString().ToLowerInvariant().Trim())
				{
					LocalizationUtils lcUtils = new LocalizationUtils();
					lcUtils.SaveResource("[RESX:" + pi.Name + "].Text", Params["Label"].ToString(), PortalId);
				}

			}
			pc.SaveProperty(pi);
			ForumController fc = new ForumController();
			Forum fi = fc.GetForum(PortalId, ModuleId, pi.ObjectOwnerId, true);
			fi.HasProperties = true;
			fc.Forums_Save(PortalId, fi, false, false);

		}