protected void uiButtonSearch_Click(object sender, EventArgs e) { VedioLib objData = new VedioLib(); objData.GetAllVediosLibByCategory(Convert.ToInt32(uiDropDownListAllCategories.SelectedValue)); uiGridViewSubCategories.DataSource = objData.DefaultView; uiGridViewSubCategories.DataBind(); }
protected void uiGridViewSubCategories_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditSubCategory") { VedioLib objData = new VedioLib(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.EnTitle; uiTextBoxArName.Text = objData.ArTitle; uiTextBoxURL.Text = objData.URL; uiDropDownListAllCategories.SelectedValue = objData.CategoryID.ToString(); uiPanelViewSubCategories.Visible = false; uiPanelEdit.Visible = true; CurrentVedio = objData; uiPanelViewSubCategories.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteSubCategory") { VedioLib objData = new VedioLib(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentVedio = null; BindData(); } }
private void BindData() { VedioLib objData = new VedioLib(); objData.GetAllVediosLibByCategory(Convert.ToInt32(uiDropDownListAllCategories.SelectedValue)); uiGridViewSubCategories.DataSource = objData.DefaultView; uiGridViewSubCategories.DataBind(); }
private void AddNewRecord() { VedioLib objData = new VedioLib(); objData.AddNew(); objData.EnTitle = uiTextBoxEnName.Text; objData.ArTitle = uiTextBoxArName.Text; objData.EnDescription = uiTextBoxEnDesc.Text; objData.ArDescription = uiTextBoxArDesc.Text; objData.URL = uiTextBoxURL.Text; string filepath = ""; if (uiFileUploadLogoPath.HasFile) { uiFileUploadLogoPath.SaveAs(Server.MapPath("~/FileUploads/VedioLogos" + "/" + uiFileUploadLogoPath.FileName)); filepath = "/Fileuploads/VedioLogos" + "/" + uiFileUploadLogoPath.FileName; } if (!string.IsNullOrEmpty(filepath)) { objData.IconPath = filepath; } objData.CategoryID = Convert.ToInt32(uiDropDownListAllCategories.SelectedValue); objData.Save(); }