protected void btnDelete_Click(object sender, EventArgs e) { int familyID = (int)Session["familyID"]; string listType = ddlListType.SelectedValue; string listName = ddlItem.SelectedValue; ListDA.DeleteList(familyID, listType, listName); Response.Redirect("~/Views/DeleteList.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { int familyID = (int)Session["familyID"]; ToDoItems t = new ToDoItems(); t.FamilyID = familyID; t.ListItem = txtItemName.Text; t.DueDate = Convert.ToDateTime(txtDate.Text); t.IsComplete = "N"; t.ListType = "todo"; try { ListDA.addToDoItem(t); Response.Redirect("~/Views/ToDo.aspx"); lblError.Text = "List item added Successfully"; } catch { Response.Redirect("~/Views/ToDo.aspx"); lblError.Text = "There was an error adding the list item"; } }
protected void btnAdd_Click(object sender, EventArgs e) { int familyID = (int)Session["familyID"]; GroceryItems g = new GroceryItems(); g.FamilyID = familyID; g.ListItem = txtItem.Text; g.StoreName = txtStore.Text; g.StorePrice = Convert.ToDouble(txtPrice.Text); g.IsComplete = "N"; g.ListType = "grocery"; try { ListDA.addGroceryItem(g); lblError.Text = "List item added Successfully"; Response.Redirect("~/Views/GroceryList.aspx"); } catch { lblError.Text = "There was an error adding the list item"; Response.Redirect("~/Views/GroceryList.aspx"); } }