Example #1
0
 protected void lblRemove_Click(object sender, EventArgs e)
 {
     try
     {
         SB.RemoveService(serviceId);
         if (Session["return"] == null)
         {
             Session.Add("return", "remove");
         }
         else
         {
             Session["return"] = "remove";
         }
         Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Service/Manage");
     }
     catch (Exception ex)
     {
         pnlRed.Visible       = true;
         lblError.Text        = ex.Message;
         hplnkRed.Text        = "Close and continue";
         hplnkRed.NavigateUrl = "";
     }
 }
    protected void imgbtnRemove_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            ImageButton ibRemove = (ImageButton)sender;
            HiddenField hf       = (HiddenField)ibRemove.FindControl("hfServiceId");

            SB.RemoveService(new Guid(hf.Value));

            pnlGreen.Visible       = true;
            lblSuccess.Text        = "A service has been removed successfully, this data could be restored from Trash.";
            hplnkGreen.Text        = "Go to trash.";
            hplnkGreen.NavigateUrl = WebHelper.Instance.GetURL() + "ManageService/Service/Trash";
            loadData();
        }
        catch (Exception ex)
        {
            pnlRed.Visible       = true;
            lblError.Text        = ex.Message;
            hplnkRed.Text        = "Close and continue.";
            hplnkRed.NavigateUrl = "";
        }
    }