private void BindProjects() { ddlProjects.DataSource = ProjectsDBManager.GetAllProjects(); ddlProjects.DataTextField = "Name"; ddlProjects.DataValueField = "ProjectId"; ddlProjects.DataBind(); ddlProjects.Items.Insert(0, new ListItem("Изберете проект", "-1")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlProjects.DataSource = ProjectsDBManager.GetAllProjects(); ddlProjects.DataTextField = "Name"; ddlProjects.DataValueField = "ProjectId"; ddlProjects.DataBind(); if (Page.Request.QueryString["projectId"] != null) { ddlProjects.Items.FindByValue(Page.Request.QueryString["projectId"].ToString()).Selected = true; } var priorityList = Enum.GetValues(typeof(Priority)).Cast <Priority>(); List <EnumValues> priorityData = new List <EnumValues>(); foreach (var l in priorityList) { EnumValues v = new EnumValues(EnumStringValue.StringValue((Priority)Enum.Parse(typeof(Priority), l.ToString())), l.ToString()); priorityData.Add(v); } ddlPriority.DataSource = priorityData; ddlPriority.DataTextField = "Name"; ddlPriority.DataValueField = "Value"; ddlPriority.DataBind(); var statusList = Enum.GetValues(typeof(Status)).Cast <Status>(); List <EnumValues> statusData = new List <EnumValues>(); foreach (var l in statusList) { EnumValues v = new EnumValues(EnumStringValue.StringValue((Status)Enum.Parse(typeof(Status), l.ToString())), l.ToString()); statusData.Add(v); } ddlStatus.DataSource = statusData; ddlStatus.DataTextField = "Name"; ddlStatus.DataValueField = "Value"; ddlStatus.DataBind(); header.InnerHtml = "Нова грешка"; if (OldBug != null) { header.InnerHtml = "Редакция на грешка"; LoadContent(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlProjects.DataSource = ProjectsDBManager.GetAllProjects(); ddlProjects.DataTextField = "Name"; ddlProjects.DataValueField = "ProjectId"; ddlProjects.DataBind(); if (Page.Request.QueryString["projectId"] != null) { ddlProjects.Items.FindByValue(Page.Request.QueryString["projectId"]).Selected = true; } BindBugs(); BuildPager(); } }