예제 #1
0
 protected void DeleteRecord(object sender, EventArgs e)
 {
     try
     {
         int id      = int.Parse((sender as Button).CommandArgument);
         int success = 0;
         success = local_video.DeleteVideo(id);
         if (success != 0)
         {
             BindgvVideos();
             lblmessage1.ForeColor = Color.Green;
             lblmessage1.Text      = "Video Deleted Successfully!";
         }
         else
         {
             lblmessage1.ForeColor = Color.Red;
             lblmessage1.Text      = "Video Delete Failed?";
         }
     }
     catch (Exception ex)
     {
         lblmessage1.ForeColor = Color.Red;
         lblmessage1.Text      = ex.Message;
     }
 }