Exemplo n.º 1
0
		private static string BuildAdminConnectionString(BXParamsBag<object> data)
		{
			SqlConnectionStringBuilder sb = new SqlConnectionStringBuilder();
			sb.DataSource = data.GetString("ServerName");
			sb.ConnectTimeout = 1000;
			if (data.GetBool("AdminWindows"))
				sb.IntegratedSecurity = true;
			else
			{
				sb.UserID = data.GetString("AdminLogin", "");
				sb.Password = data.GetString("AdminPassword", "");
			}
			return sb.ConnectionString;
		}
Exemplo n.º 2
0
		private static string BuildUserConnectionString(BXParamsBag<object> data, bool setTimeout)
		{
			SqlConnectionStringBuilder sb = new SqlConnectionStringBuilder();
			sb.DataSource = data.GetString("ServerName");
			sb.InitialCatalog = data.GetString("DBName");
			if (setTimeout)
				sb.ConnectTimeout = 1000;
			if (data.GetString("CreateUser") == "Windows")
				sb.IntegratedSecurity = true;
			else
			{
				sb.UserID = data.GetString("UserLogin", "");
				sb.Password = data.GetString("UserPassword", "");
			}
			return sb.ConnectionString;
		}
Exemplo n.º 3
0
	public void SetSettings(BXParamsBag<object> settings)
	{
        string textType = (settings.GetString("TextType") ?? "").ToUpperInvariant();
        if (string.Equals(textType, "PATTERN", StringComparison.InvariantCulture))
        {
            PatternButton.Checked = true;
            PatternContainer.Style.Add(HtmlTextWriterStyle.Display, "");
        }
        else if (string.Equals(textType, "HTML", StringComparison.InvariantCulture))
            HtmlButton.Checked = true;
        else
            TextButton.Checked = true;

        Pattern.Text = settings.ContainsKey("Pattern") ? (string)settings["Pattern"] : String.Empty;
		DefaultValue.Text = settings.ContainsKey("DefaultValue") ? (string)settings["DefaultValue"] : String.Empty;
		TextBoxSize.Text = settings.ContainsKey("TextBoxSize") ? settings["TextBoxSize"].ToString() : String.Empty;
		RowsCount.Text = settings.ContainsKey("RowsCount") ? settings["RowsCount"].ToString() : String.Empty;
		MinLength.Text = settings.ContainsKey("MinLength") ? settings["MinLength"].ToString() : String.Empty;
		MaxLength.Text = settings.ContainsKey("MaxLength") ? settings["MaxLength"].ToString() : String.Empty;
		ValidationRegex.Text = settings.ContainsKey("ValidationRegex") ? (string)settings["ValidationRegex"] : String.Empty;
	}
Exemplo n.º 4
0
		public IndexerInfo(string id, BXParamsBag<object> info, Uri currentUrl)
		{
			Id = id;
			Title = info.GetString("title");
			CreateOptionsControl = info.Get<Delegate>("createOptionsControl");
			GetOptions = info.Get<Delegate>("getOptions");
			if (CreateOptionsControl != null)
				OptionsControl = (Control)CreateOptionsControl.DynamicInvoke();
			string icon = info.GetString("icon");
			if (!string.IsNullOrEmpty(icon))
			{
				Uri iconUri;
				if (Uri.TryCreate(currentUrl, icon.StartsWith("~/") ? VirtualPathUtility.ToAbsolute(icon) : icon, out iconUri))
					IconUrl = iconUri.AbsoluteUri;
			}
		}
		public EnumerationItem(BXParamsBag<object> data)
		{
			Id = data.GetInt("Id");
			Title = data.GetString("Title");
			XmlId = data.GetString("XmlId");
			IsDefault = data.GetBool("Default");
			IsNew = data.GetBool("New");
			Sort = data.GetInt("Sort");
			Delete = data.GetBool("Delete");
		}