Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var repository = TaskRepository.Instance;

        GridViewTasks.DataSource = repository.GetCompletedTasks().Where(task => task.UserName == User.Identity.Name);
        GridViewTasks.DataBind();
    }
Exemple #2
0
    protected void DropDownListCategories_SelectedIndexChanged(object sender, EventArgs e)
    {
        var repository = TaskRepository.Instance;

        GridViewTasks.DataSource = repository.GetTasksByCategory(DropDownListCategories.SelectedValue);
        GridViewTasks.DataBind();
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var repository = TaskRepository.Instance;

        GridViewTasks.DataSource = repository.GetPendingTasks();
        GridViewTasks.DataBind();
    }
Exemple #4
0
 private void GetData()
 {
     using (SqlConnection con = new SqlConnection(conString))
     {
         SqlCommand cmd = new SqlCommand("Select * from tbltaskdata where username='******'", con);
         con.Open();
         GridViewTasks.DataSource = cmd.ExecuteReader();
         GridViewTasks.DataBind();
     }
 }
Exemple #5
0
 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();
     }
 }
Exemple #6
0
 private void GetCategoryData()
 {
     using (SqlConnection con = new SqlConnection(conString))
     {
         SqlCommand cmd = new SqlCommand("Select * from tbltaskdata where Category='" + DropDownList1.SelectedValue + "' AND username='******' ", con);
         con.Open();
         SqlDataAdapter sda = new SqlDataAdapter(cmd);
         DataTable      dt  = new DataTable();
         sda.Fill(dt);
         GridViewTasks.DataSource = dt;
         GridViewTasks.DataBind();
     }
 }