protected void Delete_Click(object sender, EventArgs e) { Link link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId)); LinkRepository.Delete(link); Response.Redirect(Cancel.NavigateUrl); }
protected void Submit_Click(object sender, EventArgs e) { if (!IsValid) { return; } Link link; if (Submit.CommandName == CMD_UPDATE) { link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId)); PopulateLinkFromControls(link); LinkRepository.Update(link); } else if (Submit.CommandName == CMD_INSERT) { link = new Link(); PopulateLinkFromControls(link); LinkRepository.Save(link); } Response.Redirect(Cancel.NavigateUrl); }
private void LoadEditMode() { PopulateControlsFromLink(LinkRepository.FindById(DataUtility.ParseInt(QsLinkId))); Submit.CommandName = CMD_UPDATE; Submit.Text = "Save"; }