Пример #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         SLIDER rec = DALSlider.Get(Int32.Parse(Request.QueryString["ID"]));
         if (rec != null)
         {
             DALSlider.Delete(rec.ID);
         }
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ClosePage", "CloseModal(true);", true);
         NotificationAdd(NotificationType.success, "Kayıt Silindi.");
     }
     catch (Exception ex)
     {
         if (ex is SqlException)
         {
             if ((ex as SqlException).Number == 547)
             {
                 NotificationAdd(NotificationType.error, "Kayıt başka yerlerde kullanıdı.");
             }
         }
         else
         {
             throw ex;
         }
     }
 }