Ejemplo n.º 1
0
 public void Delete(RedirectionUrl url)
 {
     using (var session = sessionManager.OpenSession())
     using (var tx = session.BeginTransaction(IsolationLevel.ReadCommitted))
     {
         session.Delete(url);
         tx.Commit();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     UrlId = Int32.Parse(Request.QueryString["FileId"]);
     if (UrlId > 0)
     {
         Url = RedirectionModule.GetbyId(UrlId);
         if (!IsPostBack)
             BindUrl();// I HATE WebForms
         btnDelete.Visible = true;
         btnDelete.Attributes.Add("onclick", "return confirm('Are you sure?');");
     }
     else
     {
         Url = new RedirectionUrl
         {
             Section = RedirectionModule.Section
         };
         calDatePublished.SelectedDate = DateTime.Now;
         btnDelete.Visible = false;
     }
 }