private void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { int lineupId = new d.LineupData().Create(tbxDescription.Text.Trim(), tbxNotes.Text.Trim(), Convert.ToInt32(ddlCase.SelectedValue), Convert.ToInt32(ddlSuspect.SelectedValue), Identity.UserId); Response.Redirect("lineupAdd2.aspx?Id=" + lineupId); } }
private void BindDelete() { int suspectId = Convert.ToInt32(Request["Id"]); DataTable dtLineups = new d.LineupData().GetLockedLineupsBySuspect(suspectId); if (dtLineups.Rows.Count > 0) { btnDelete.Visible = false; ltrNoDelete.Text = "To delete this suspect, you must first find and delete all the associated <a href='lineups.aspx'>lineups</a>"; } else { btnDelete.Attributes["onclick"] = "javascript:return confirm('Are you sure you want to delete this suspect?')"; } }
private void BindLineups() { if (ddlCase.SelectedValue != "") { int caseId = Convert.ToInt32(ddlCase.SelectedValue); DataTable dtLineups = new d.LineupData().GetLockedLineupsByCase(caseId, dgrLineups.SortExpression); if (dtLineups.Rows.Count > 0) { pnlGrid.Visible = true; dgrLineups.Prefix = LinkPrefix; dgrLineups.DataSource = dtLineups; dgrLineups.DataBind(); } else { pnlGrid.Visible = false; } } }
private void btnSave_Click(object sender, EventArgs e) { if (!allPhotosSelected()) { lblError.Visible = true; } else { int suspectPosition = Convert.ToInt32(ddlPosition.SelectedValue); int lineupId = getLineupId(); d.LineupData ld = new d.LineupData(); d.LineupPhotoLink lpl = new d.LineupPhotoLink(); ld.Lock(lineupId, suspectPosition, Identity.UserId); if (suspectPosition != 0) { lpl.Create(lineupId, Convert.ToInt32(hdPos0.Value)); } if (suspectPosition != 1) { lpl.Create(lineupId, Convert.ToInt32(hdPos1.Value)); } if (suspectPosition != 2) { lpl.Create(lineupId, Convert.ToInt32(hdPos2.Value)); } if (suspectPosition != 3) { lpl.Create(lineupId, Convert.ToInt32(hdPos3.Value)); } if (suspectPosition != 4) { lpl.Create(lineupId, Convert.ToInt32(hdPos4.Value)); } if (suspectPosition != 5) { lpl.Create(lineupId, Convert.ToInt32(hdPos5.Value)); } Response.Redirect("default.aspx"); } }
private void btnDelete_Click(object sender, EventArgs e) { d.LineupData ld = new d.LineupData(); ld.Delete(Convert.ToInt32(Request["Id"])); Response.Redirect("lineups.aspx"); }