コード例 #1
0
 private void Bindcats()
 {
     BLL.VedioCategories currentvcats = new BLL.VedioCategories();
     currentvcats.LoadAll();
     uiDataListSubCats.DataSource = currentvcats.DefaultView;
     uiDataListSubCats.DataBind();
 }
コード例 #2
0
        protected void uiButtonUpdate_Click(object sender, EventArgs e)
        {
            if (CurrentCategory != null)
            {
                UpdateRecord();
            }
            else
            {
                AddNewRecord();
            }

            uiPanelEdit.Visible = false;
            uiPanelViewCategories.Visible = true;
            BindData();
            Clearfields();
            CurrentCategory = null;
        }
コード例 #3
0
 protected void uiGridViewCategories_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditCategory")
     {
         VedioCategories objData = new VedioCategories();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         uiTextBoxEnName.Text = objData.EnName;
         uiTextBoxArName.Text = objData.ArName;
         uiTextBoxEnDesc.Text = objData.EnDescription;
         uiTextBoxArDesc.Text = objData.ArDescription;
         uiPanelViewCategories.Visible = false;
         uiPanelEdit.Visible = true;
         CurrentCategory = objData;
     }
     else if (e.CommandName == "DeleteCategory")
     {
         VedioCategories objData = new VedioCategories();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         objData.MarkAsDeleted();
         objData.Save();
         CurrentCategory = null;
         BindData();
     }
 }