protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int nID = 0; if (Request.QueryString["nID"] != null && int.TryParse(Request.QueryString["nID"].ToString(), out nID) && nID > 0) { lblBigtitle.Text = "编辑数据"; BtnAdd.Visible = false; btnUpdate.Visible = true; DBLL.clsProductCategory clProductCategory = new DBLL.clsProductCategory(); DataTable dt = clProductCategory.Select_tb_ProductCategoryBynProductCategoryID(nID); if (dt != null && dt.Rows.Count > 0) { hfID.Value = dt.Rows[0]["nProductCategoryID"].ToString(); txtsProductCategoryNameCN.Text = dt.Rows[0]["sProductCategoryNameCN"].ToString(); txtsProductCategoryNameEN.Text = dt.Rows[0]["sProductCategoryNameEN"].ToString(); txtnSorting.Text = dt.Rows[0]["nSorting"].ToString(); //绑定数据 } } else { lblBigtitle.Text = "添加数据"; btnUpdate.Visible = false; BtnAdd.Visible = true; } } }
protected void lvProductList_ItemDataBound(object sender, ListViewItemEventArgs e) { try { DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL(); DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory(); if (e.Item.ItemType == ListViewItemType.DataItem) { int nType = 0; Label lblnProductCategoryID = (Label)e.Item.FindControl("lblnProductCategoryID"); if (int.TryParse(lblnProductCategoryID.Text, out nType)) { nType = int.Parse(lblnProductCategoryID.Text); string sTopicName = ProductCategory.Select_tb_ProductCategoryBynProductCategoryID(nType).Rows[0]["sProductCategoryNameCN"].ToString(); lblnProductCategoryID.Text = sTopicName; } } ImageButton imgDelete = (ImageButton)e.Item.FindControl("imgDelete"); imgDelete.OnClientClick = "javascript:if (confirm('" + option.GetOptionValue("FormatSetting", "CommandControl", "bIsDelete") + "')){$('#EntryForm').block({ message: null });}else{return false;}"; } catch (Exception) { } }
protected void lvProductCategoryList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { Label lblnID = (Label)lvProductCategoryList.Items[e.NewSelectedIndex].FindControl("lblnProductCategoryID"); int _nID = 0; DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory(); if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Model.dsProduct.tb_ProductCategoryDataTable ProductList = new Model.dsProduct.tb_ProductCategoryDataTable(); ProductList.Merge(dbcom.selectNormalTableofAll(false, "tb_ProductCategory")); ddlProductCateTreelist1.ProductList = ProductList; ddlProductCateTreelist1.Fresh(); MultiView1.ActiveViewIndex = 1; DataTable dt = ProductCategory.Select_tb_ProductCategoryBynProductCategoryID(_nID); txtsProductCategoryNameCN.Text = dt.Rows[0]["sProductCategoryNameCN"].ToString(); txtsProductCategoryNameEN.Text = dt.Rows[0]["sProductCategoryNameEN"].ToString(); CKEditorControl1.Text = dt.Rows[0]["sContentCN"].ToString(); CKEditorControl2.Text = dt.Rows[0]["sContentEN"].ToString(); lblPCID.Text = dt.Rows[0]["nParentCategoryID"].ToString(); //ddlProductCateTreelist1.nSelectProductCategoryID = int.Parse(dt.Rows[0]["nParentCategoryID"].ToString()); ddlProductCateTreelist1.setnSelectID(int.Parse(dt.Rows[0]["nParentCategoryID"].ToString())); ddlnSorting.SelectedValue = dt.Rows[0]["nSorting"].ToString(); hfProductCategoryUpdateID.Value = _nID.ToString(); } }
public void setnSelectID(int nSelectPCID) { nSelectProductCategoryID = nSelectPCID; DBLL.clsProductCategory clspc = new DBLL.clsProductCategory(); Model.dsProduct.tb_ProductCategoryDataTable pcdt = new Model.dsProduct.tb_ProductCategoryDataTable(); if (pcdt != null && pcdt.Rows.Count > 0) { pcdt.Merge(clspc.Select_tb_ProductCategoryBynProductCategoryID(nSelectPCID)); txtProducCateID.Text = pcdt.Rows[0]["sProductCategoryNameCN"].ToString(); } else { txtProducCateID.Text = "没有上级产品类"; } }
public void setnSelectID(int nSelectPCID) { nSelectProductCategoryID = nSelectPCID; DBLL.clsProductCategory clspc = new DBLL.clsProductCategory(); DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable pcdt = new DataTable(); pcdt = DBc.selectNormalTableofAll(false, "tb_ProductCategory"); if (pcdt != null && pcdt.Rows.Count > 0) { pcdt.Merge(clspc.Select_tb_ProductCategoryBynProductCategoryID(nSelectPCID)); txtProducCateID.Text = pcdt.Rows[0]["sProductCategoryNameCN"].ToString(); } else { txtProducCateID.Text = "没有上级产品类"; } }
public void Bind(int nProductID) { DBLL.clsProduct clspro = new DBLL.clsProduct(); DBLL.clsProductCategory clsprocate = new DBLL.clsProductCategory(); DataTable dtpro = clspro.Select_tb_ProductBynProductID(nProductID); if (dtpro != null && dtpro.Rows.Count > 0) { Panel1.Visible = false; Panel2.Visible = true; DataRow dtprorow = dtpro.Rows[0]; DataTable dtprocate = clsprocate.Select_tb_ProductCategoryBynProductCategoryID(int.Parse(dtprorow["nProductCategoryID"].ToString())); if (Session["languageGlobal"] == "en") { lblProductName.Text = dtprorow["sProductNameEN"].ToString(); lblProductCate.Text = dtprocate.Rows[0]["sProductCategoryNameEN"].ToString(); lblsBrandName.Text = dtprorow["sBrandNameEN"].ToString(); divProductInfo.InnerHtml = dtprorow["sIntroEN"].ToString(); divProductCate.InnerHtml = dtprorow["sSummaryEN"].ToString(); IMGbig.ImageUrl = dtprorow["sPImagePath"].ToString(); //lblSensitivity.Text = dtprorow["sEnsitivityCN"].ToString(); //lblchannelbalance.Text = dtprorow["sChannelBalanceCN"].ToString(); //lblimpedance.Text = dtprorow["sImpedanceCN"].ToString(); //lblfrequencyrange.Text = dtprorow["sFrequencyCN"].ToString(); //lblratedpower.Text = dtprorow["sRatedPowerCN"].ToString(); //lblmaximumpower.Text = dtprorow["sMaximumPowerCN"].ToString(); } else { lblProductName.Text = dtprorow["sProductNameCN"].ToString(); lblProductCate.Text = dtprocate.Rows[0]["sProductCategoryNameCN"].ToString(); lblsBrandName.Text = dtprorow["sBrandNameCN"].ToString(); divProductInfo.InnerHtml = dtprorow["sIntroCN"].ToString(); divProductCate.InnerHtml = dtprorow["sSummaryCN"].ToString(); IMGbig.ImageUrl = dtprorow["sPImagePath"].ToString(); //lblSensitivity.Text = dtprorow["sEnsitivityEN"].ToString(); //lblchannelbalance.Text = dtprorow["sChannelBalanceEN"].ToString(); //lblimpedance.Text = dtprorow["sImpedanceEN"].ToString(); //lblfrequencyrange.Text = dtprorow["sFrequencyEN"].ToString(); //lblratedpower.Text = dtprorow["sRatedPowerEN"].ToString(); //lblmaximumpower.Text = dtprorow["sMaximumPowerEN"].ToString(); } } }