コード例 #1
0
 protected void newProjectButton_Click(object sender, EventArgs e)
 {
     if (newProject.Text != String.Empty)
     {
         string name = newProject.Text;
         newProject.Text = String.Empty;
         TaskList project = new TaskList();
         project.Title = name;
         projectsDb.Save(project);
         ProjectsMenuRepeater.DataBind();
     }
 }
コード例 #2
0
 protected void DeleteButton_Click(object sender, EventArgs e)
 {
     if (DeleteButton.BackColor == System.Drawing.Color.Green)
     {
         TaskList projectToDelete = projectsDb.Get(Int32.Parse(Request["id"]));
         if (projectToDelete != null)
         {
             projectsDb.Delete(projectToDelete);
             ProjectsMenuRepeater.DataBind();
             Response.Redirect("Projects.aspx");
         }
     }
     else
     {
         DeleteButton.BackColor = System.Drawing.Color.Green;
         DeleteButton.Text      = GetLocalResourceObject("ReallyButton").ToString();
     }
 }