protected void uiGridViewSubCategories_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditVideo")
     {
         GeneralVideos objData = new GeneralVideos();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         uiTextBoxArName.Text = objData.ArTitle;
         uiTextBoxURL.Text = objData.URL;
         uiTextBoxArDesc.Text = objData.Description;
         uiDropDownListSubCats.SelectedValue = objData.SubCategoryID.ToString();
         uiPanelViewSubCategories.Visible = false;
         uiPanelEdit.Visible = true;
         CurrentVedio = objData;
         uiPanelEdit.Visible = true;
     }
     else if (e.CommandName == "DeleteVideo")
     {
         GeneralVideos objData = new GeneralVideos();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         objData.MarkAsDeleted();
         objData.Save();
         CurrentVedio = null;
         BindData();
     }
 }
 private void AddNewRecord()
 {
     GeneralVideos objData = new GeneralVideos();
     objData.AddNew();
     objData.ArTitle = uiTextBoxArName.Text;
     objData.Description = uiTextBoxArDesc.Text;
     objData.URL = uiTextBoxURL.Text;
     objData.SubCategoryID = Convert.ToInt32(uiDropDownListSubCats.SelectedValue);
     objData.Save();
 }