//function to load categories based on company private void LoadCategoriesByCompany() { BLL obj = new BLL(); DataTable tabCategories = new DataTable(); try { tabCategories = obj.GetCategoriesByCompany(DropDownListCompanies.SelectedValue); if (tabCategories.Rows.Count > 0) { DropDownListCategories.Items.Clear(); DropDownListCategories.DataSource = tabCategories; DropDownListCategories.DataTextField = "CategoryName"; DropDownListCategories.DataValueField = "CategoryId"; DropDownListCategories.DataBind(); DropDownListCategories.Items.Insert(0, "All"); } else { DropDownListCategories.Items.Clear(); DropDownListCategories.DataSource = null; DropDownListCategories.DataBind(); DropDownListCategories.Items.Insert(0, "Input Companies"); } } catch { } }
protected void Page_Load(object sender, EventArgs e) { string taskName = Request.QueryString["Task"]; TaskList taskList = Session[typeof(TaskList).Name] as TaskList; Task task = taskList.GetTask(taskName); if (task == null) { LabelCannotFindTask.Text = string.Format("Cannot find task with name '{0}'", taskName); ButtonEditTask.Enabled = false; } else { TextBoxName.Text = taskName; if (!IsPostBack) { DropDownListCategories.DataSource = Application["Categories"]; DropDownListCategories.DataBind(); DropDownListCategories.SelectedValue = task.Category; bool isTaskCompleted = task.TaskStatus == Task.Status.Completed; CheckBoxIsCompleted.Checked = isTaskCompleted; ButtonEditTask.Enabled = !isTaskCompleted; } } }
protected void LoadDropDownListCategories() { NorthWindCS cat = new NorthWindCS(); DropDownListCategories.DataSource = cat.GetCategories(); DropDownListCategories.DataTextField = "CategoryName"; DropDownListCategories.DataValueField = "CategoryID"; DropDownListCategories.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListCategories.DataSource = Application.Get("Categories"); DropDownListCategories.DataBind(); DropDownListCategories.Items.Insert(0, "Select"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListCategories.DataSource = Repository.GetCategories(); DropDownListCategories.DataValueField = "Name"; DropDownListCategories.DataBind(); UpdateGridViewProducts(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var repository = TaskRepository.Instance; DropDownListCategories.DataSource = repository.GetCategories(); DropDownListCategories.DataValueField = "Value"; DropDownListCategories.DataBind(); GridViewTasks.DataSource = repository.GetTasksByCategory(DropDownListCategories.SelectedValue); GridViewTasks.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var repository = TaskRepository.Instance; DropDownListCategories.DataSource = repository.GetCategories(); DropDownListCategories.DataTextField = "Value"; DropDownListCategories.DataValueField = "Key"; DropDownListCategories.DataBind(); CalendarStartTime.SelectedDate = CalendarStartTime.TodaysDate; CalendarDueDate.SelectedDate = CalendarDueDate.TodaysDate; } LabelResults.Text = string.Empty; }
private void CategoryListShow() { if (!IsPostBack) { KategoriDb db = new KategoriDb(); DropDownListCategories.DataSource = db.CategoriesShow(); DropDownListCategories.DataValueField = "Kategori_ID"; DropDownListCategories.DataTextField = "Kategori_Ad"; DropDownListCategories.DataBind(); DropDownListCategoryforSubCategory.DataSource = db.CategoriesShow(); DropDownListCategoryforSubCategory.DataValueField = "Kategori_ID"; DropDownListCategoryforSubCategory.DataTextField = "Kategori_Ad"; DropDownListCategoryforSubCategory.DataBind(); DropDownListCategorySelect.DataSource = db.CategoriesShow(); DropDownListCategorySelect.DataValueField = "Kategori_ID"; DropDownListCategorySelect.DataTextField = "Kategori_Ad"; DropDownListCategorySelect.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { int taskId = Convert.ToInt32(Request["taskId"]); var repository = TaskRepository.Instance; Task task = repository.GetTask(taskId); if (task == null || task.UserName != User.Identity.Name) { LabelResults.Text = string.Format("Cannot find task with id '{0}' or this task does not belong to you", taskId); ButtonEditTask.Enabled = false; } else { TextBoxName.Text = task.Name; if (!IsPostBack) { DropDownListCategories.DataSource = repository.GetCategories(); DropDownListCategories.DataTextField = "Value"; DropDownListCategories.DataValueField = "Key"; DropDownListCategories.DataBind(); CalendarStartTime.SelectedDate = task.StartDate; CalendarDueDate.SelectedDate = task.DueDate; DropDownListPriority.DataSource = TaskRepository.GetValidPriorities(); DropDownListPriority.DataBind(); TextBoxPercentComplete.Text = task.PercentComplete.ToString(); bool isCompleted = task.Completed; CheckBoxIsCompleted.Checked = isCompleted; ButtonEditTask.Enabled = !isCompleted; } TextBoxStartDate.Text = CalendarStartTime.SelectedDate.ToLongDateString(); TextBoxDueDate.Text = CalendarDueDate.SelectedDate.ToLongDateString(); } }
/// <summary> /// Method that get called on Page Load Event /// </summary> /// <param name="sender">Event Source</param> /// <param name="eventArgument">Event Data</param> protected void Page_Load(object sender, EventArgs eventArgument) { DataProvider.AuthorizeUser(); MasterPage masterPage = this.Page.Master; Header headerPage = (Header)masterPage; headerPage.DisplayDataFromMasterPage(Session["UserName"].ToString()); Session["EnableProductSelection"] = true; //Session["AddAllOption"] = "yes"; GetMasterPage().FindControl("PanelActionMessage").Visible = false; if (!Page.IsPostBack) { GetCategories(); GetRoles(); GetFields(); } else { // Register the event for Product DropDownList in Master Page. DropDownList dropDownListProducts = (DropDownList)headerPage.FindControl("DropDownListProducts"); dropDownListProducts.SelectedIndexChanged += new EventHandler(DropDownListProductsInMasterPage_SelectedIndexChanged); } DropDownListCategories.Focus(); }