protected void submitEditWalkType(object sender, EventArgs e) { WalkTypeBusiness business = new WalkTypeBusiness(); string previousWalkType = (string)Session["EditWalk"]; string newWalkType = walkType.Text; bool activated = CheckBox1.Checked; int valueCheckBox; if (activated) { valueCheckBox = 1; } else { valueCheckBox = 0; } string error = business.editWalkType(previousWalkType, newWalkType, valueCheckBox); if (error != null) { Errors.Text = error; } else { Response.Redirect("WalkType.aspx"); } }
protected void deleteWalkType(object sender, EventArgs e) { WalkTypeBusiness business = new WalkTypeBusiness(); string walkTypeToDelete = (string)Session["EditWalk"];; business.deleteWalkType(walkTypeToDelete); Response.Redirect("WalkType.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WalkTypeBusiness business = new WalkTypeBusiness(); List <string> walkTypeList = business.getWalkTypes(); showWalkTypes(walkTypeList); Session["WalkTypesList"] = walkTypeList; } else { List <string> walkTypeList = (List <string>)Session["WalkTypesList"]; showWalkTypes(walkTypeList); } }
protected void CreateWalkType(object sender, EventArgs e) { WalkTypeBusiness business = new WalkTypeBusiness(); string newWalkType = walkType.Text; int state = 1; string error = business.insertWalkType(newWalkType, state); if (error != null) { Errors.Text = error; } else { Response.Redirect("Walktype.aspx"); } }