Пример #1
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        Link link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId));

        LinkRepository.Delete(link);
        Response.Redirect(Cancel.NavigateUrl);
    }
Пример #2
0
    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);
    }
Пример #3
0
 private void LoadEditMode()
 {
     PopulateControlsFromLink(LinkRepository.FindById(DataUtility.ParseInt(QsLinkId)));
     Submit.CommandName = CMD_UPDATE;
     Submit.Text        = "Save";
 }