//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 BindingSeries() { SeriesBiz pBiz = new SeriesBiz(); rptSeries.DataSource = pBiz.GetListSeries(); rptSeries.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { SeriesBiz pBiz = new SeriesBiz(); lwg_Series p; if (string.IsNullOrEmpty(hdfID.Value)) { p = new lwg_Series(); 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.SaveSeries(p)) { rptSeries.DataSource = pBiz.GetListSeries(); rptSeries.DataBind(); txtName.Text = string.Empty; pnEditSeries.Visible = false; pnListSeries.Visible = true; return; } } lblNote.Visible = true; }
private void BindSeries() { SeriesBiz sService = new SeriesBiz(); List <lwg_Series> listSeries = sService.GetListSeries(); if (listSeries != null) { this.drpSeries.DataSource = listSeries; this.drpSeries.DataTextField = "Name"; this.drpSeries.DataValueField = "SeriesId"; this.drpSeries.DataBind(); this.drpSeries.Items.Insert(0, new ListItem("-All Series -", "0")); } }