private void BindingGenre() { GenerBiz pBiz = new GenerBiz(); rptGenre.DataSource = pBiz.GetListGenre(); rptGenre.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { GenerBiz pBiz = new GenerBiz(); lwg_Genre p; if (string.IsNullOrEmpty(hdfID.Value)) { p = new lwg_Genre(); lblNote.Text = "Insert error, please try again"; } else { p = pBiz.GetByID(int.Parse(hdfID.Value)); lblNote.Text = "Update error, please try again"; } if (p != null) { p.Name = txtName.Text; if (pBiz.SaveGenre(p)) { BindingGenre(); txtName.Text = string.Empty; pnEditGenre.Visible = false; pnListGenre.Visible = true; return; } } lblNote.Visible = true; }
protected void rptGenre_ItemCommand(object source, RepeaterCommandEventArgs e) { GenerBiz pBiz = new GenerBiz(); lwg_Genre p = pBiz.GetByID(int.Parse(e.CommandArgument.ToString())); if (e.CommandName.Equals("EDIT")) { if (p != null) { btnAdd.Text = "Update"; txtTitle.Text = "Update Genre"; hdfID.Value = e.CommandArgument.ToString(); pnEditGenre.Visible = true; pnListGenre.Visible = false; txtName.Text = p.Name; } } else if (e.CommandName.Equals("DELETE")) { if (p != null) { if (pBiz.DeleteGenre(p)) { BindingGenre(); } } } }
//protected void gvCatalogInstrTitle_RowDataBound(object sender, GridViewRowEventArgs e) //{ // if (e.Row.DataItem == null) // { // return; // } // lwg_CatalogTitle lg = (lwg_CatalogTitle)e.Row.DataItem; // if (lg != null) // { // Literal ltrProductName = (Literal)e.Row.FindControl("ltrProductName"); // ltrProductName.Text = lg.lwg_Catalog.TitleDisplay; // Literal ltrInstrTitleName = (Literal)e.Row.FindControl("ltrInstrTitleName"); // ltrInstrTitleName.Text = lg.lwg_InstrTitle.Name; // Literal ltrTitleTypeName = (Literal)e.Row.FindControl("ltrTitleTypeName"); // ltrTitleTypeName.Text = lg.lwg_InstrTitle.lwg_TitleType.Name; // LinkButton lnkbtnRemove = (LinkButton)e.Row.FindControl("lnkbtnRemove"); // lnkbtnRemove.CommandArgument = lg.InstrTitleId.ToString(); // } //} //protected void gvCatalogInstrTitle_RowCommand(object sender, GridViewCommandEventArgs e) //{ // if (e.CommandName.Equals("REMOVE")) // { // CatalogBiz cBiz = new CatalogBiz(); // int id = int.Parse(e.CommandArgument.ToString()); // if (cBiz.DeleteCatalogTitle(id,ProductId)) // { // BindingCatalogInstrTitle(); // } // } //} //protected void btnAddInstrTitle_Click(object sender, EventArgs e) //{ // CatalogBiz pBiz = new CatalogBiz(); // if (drpInstrTitle.Items.Count > 0) // { // if (pBiz.SaveCatalogTitle(ProductId, int.Parse(drpInstrTitle.SelectedValue))) // { // BindingCatalogInstrTitle(); // } // } //} //protected void drpTitleType_SelectedIndexChanged(object sender, EventArgs e) //{ // CatalogTitleTypeBiz cttBiz = new CatalogTitleTypeBiz(); // if (drpTitleType.Items.Count > 0) // { // drpInstrTitle.DataSource = cttBiz.GetListInstrTitle(int.Parse(drpTitleType.SelectedValue)); // drpInstrTitle.DataBind(); // } //} //private void BindingCatalogInstrTitle() //{ // CatalogTitleTypeBiz ctBiz = new CatalogTitleTypeBiz(); // gvCatalogInstrTitle.DataSource = ctBiz.GetListCatalogTitleByCatalogID(ProductId); // gvCatalogInstrTitle.DataBind(); //} #endregion private void InitDropdownList() { CatalogTitleTypeBiz cttBiz = new CatalogTitleTypeBiz(); GenerBiz gBiz = new GenerBiz(); PeriodBiz pBiz = new PeriodBiz(); ReprintSourceBiz rBiz = new ReprintSourceBiz(); SeriesBiz sBiz = new SeriesBiz(); drpCatalogGenre.DataSource = gBiz.GetListGenre(); drpCatalogGenre.DataBind(); //drpTitleType.DataSource = cttBiz.GetListTitleType(); //drpTitleType.DataBind(); //if (drpTitleType.Items.Count > 0) //{ // drpInstrTitle.DataSource = cttBiz.GetListInstrTitle(int.Parse(drpTitleType.SelectedValue)); // drpInstrTitle.DataBind(); //} drpPeriod.DataSource = pBiz.GetListPeriod(); drpPeriod.DataBind(); drpReprintSource.DataSource = rBiz.GetListReprintSource(); drpReprintSource.DataBind(); grdReprintsource.DataSource = null; grdReprintsource.DataBind(); drpSeries.DataSource = sBiz.GetListSeries(); drpSeries.DataBind(); grdSeries.DataSource = null; grdSeries.DataBind(); }
private void BindData() { GenerBiz genreService = new GenerBiz(); List <lwg_Genre> listGenre = genreService.GetListGenre(); this.dlGenre.DataSource = listGenre; this.dlGenre.DataBind(); }
private void BindingGenre() { //TODO: binding Genre GenerBiz gBiz = new GenerBiz(); gvGenre.DataSource = gBiz.GetListCatalogGenre(ProductId); gvGenre.DataBind(); }
protected void gvGenre_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("REMOVE")) { GenerBiz gBiz = new GenerBiz(); int id = int.Parse(e.CommandArgument.ToString()); if (gBiz.DeleteCatalogGenre(id, ProductId)) { BindingGenre(); } } }
private void BindGenre() { GenerBiz gService = new GenerBiz(); List <lwg_Genre> listGenre = gService.GetListGenre(); if (listGenre != null) { this.drpGenre.DataSource = listGenre; this.drpGenre.DataTextField = "Name"; this.drpGenre.DataValueField = "GerneId"; this.drpGenre.DataBind(); this.drpGenre.Items.Insert(0, new ListItem("-All Genres -", "0")); } }