protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataPager1.PageSize = 10; DataPager2.PageSize = 10; DBLL.clsJob clsjob = new DBLL.clsJob(); DBLL.DBcommon dbcon = new DBLL.DBcommon(); DataTable dt = dbcon.selectNormalTableofAll(false, "tb_Jobs"); DataTablejob = dt; lvJobs.DataSource = DataTablejob; lvJobs.DataBind(); PgeInfo(); Panel1.Visible = true; Panel2.Visible = false; if (DataTablejob == null || DataTablejob.Rows.Count < 1) { Label14.Visible = true; } else { Label14.Visible = false; } } OnSetLanguage(); }
protected void lvNews_ItemDataBound(object sender, ListViewItemEventArgs e) { try { DBLL.DBcommon DBc = new DBLL.DBcommon(); DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL(); if (e.Item.ItemType == ListViewItemType.DataItem) { Label lblsTitle = (Label)e.Item.FindControl("lblsTitle"); if (lblsTitle.Text.Length > 10) { lblsTitle.Text = lblsTitle.Text.Substring(0, 10).ToString() + "...."; } //Label lblsProductNameEN = (Label)e.Item.FindControl("lblsProductNameEN"); //if (lblsProductNameEN.Text.Length > 10) //{ // lblsProductNameEN.Text = lblsProductNameEN.Text.Substring(0, 10).ToString() + "...."; //} } Button btnDelete = (Button)e.Item.FindControl("btnDelete"); btnDelete.OnClientClick = "javascript:if (confirm('" + option.GetOptionValue("FormatSetting", "CommandControl", "bIsDelete") + "')){$('#EntryForm').block({ message: null });}else{return false;}"; } catch (Exception) { } }
public void Clear() { cbbHot.Checked = false; txtsProductNameCN.Text = ""; txtsProductNameEN.Text = ""; txtsSummaryCN.Text = ""; txtsSummaryEN.Text = ""; txtsPlaceoforiginCN.Text = ""; txtsPlaceoforiginEN.Text = ""; txtsModelNoCN.Text = ""; txtsModelNoEN.Text = ""; txtsPriceTermsCN.Text = ""; txtsPriceTermsEN.Text = ""; txtsPaymentTermsCN.Text = ""; txtsPaymentTermsEN.Text = ""; txtsPackageCN.Text = ""; txtsPackageEN.Text = ""; txtsMinimumOrderCN.Text = ""; txtsMinimumOrderEN.Text = ""; txtsDeliveryTimeCN.Text = ""; txtsDeliveryTimeEN.Text = ""; txtsBrandNameCN.Text = ""; txtsBrandNameEN.Text = ""; CKEditorControl1.Text = ""; CKEditorControl2.Text = ""; ddlnSorting.SelectedIndex = 0; DBLL.DBcommon dbcom = new DBLL.DBcommon(); Model.dsProduct.tb_ProductCategoryDataTable ProductList = new Model.dsProduct.tb_ProductCategoryDataTable(); ProductList.Merge(dbcom.selectNormalTableofAll(false, "tb_ProductCategory")); ddlProductCateTreelist2.ProductList = ProductList; ddlProductCateTreelist2.Fresh(); }
public void ReBindPageList() { DBLL.DBcommon dbcom = new DBLL.DBcommon(); DBLL.clsTopicCategory TopicCategory = new DBLL.clsTopicCategory(); DataTable TopicCategorydt = TopicCategory.sp_selectNormalTableOfAllByTopicCategoryAndnType(false, 2); ddlnTCategoryID.DataSource = TopicCategorydt; ddlnTCategoryID.DataValueField = "nTCategoryID"; ddlnTCategoryID.DataTextField = "sTCategoryNameCN"; ddlnTCategoryID.DataBind(); AlbumList.Clear(); DBLL.clsAlbum Album = new DBLL.clsAlbum(); DataTable dt = new DataTable(); dt = Album.sp_selectNormalTableOfAllByAlbum(false, int.Parse(ddlnTCategoryID.SelectedValue)); if (dt != null) { AlbumList.Merge(dt); lvAlbumList.DataSource = AlbumList; lvAlbumList.DataBind(); } else { lvAlbumList.DataSource = null; lvAlbumList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnSetLanguage(); DBLL.DBcommon com = new DBLL.DBcommon(); DataTable dt = new DataTable(); if (Session["languageGlobal"] == "en") { dt = com.GetDataTable(" select top 1 * from tb_News where nLangType=2 order by nSorting desc,dUpdatedTime desc"); } else { dt = com.GetDataTable(" select top 1 * from tb_News where nLangType=1 order by nSorting desc,dUpdatedTime desc"); } if (dt != null && dt.Rows.Count > 0) { lbltitle.Text = dt.Rows[0]["sTitle"].ToString(); lbltime.Text = dt.Rows[0]["dUpdatedTime"].ToString(); string content = common.StripHTML(dt.Rows[0]["sContent"].ToString()); if (content.Length > 100) { lblContent.Text = content.Substring(0, 100) + "..."; } else { lblContent.Text = content; } } } }
public void Clear() { cbbHot.Checked = false; txtsProductNameCN.Text = ""; txtsProductNameEN.Text = ""; //txtsEnsitivityCN.Text = ""; //txtsEnsitivityEN.Text = ""; //txtsChannelBalanceCN.Text = ""; //txtsChannelBalanceEN.Text = ""; //txtsImpedanceCN.Text = ""; //txtsImpedanceEN.Text = ""; //txtsFrequencyCN.Text = ""; //txtsFrequencyEN.Text = ""; //txtsRatedPowerCN.Text = ""; //txtsRatedPowerEN.Text = ""; //txtsMaximumPowerCN.Text = ""; //txtsMaximumPowerEN.Text = ""; CKEditorControl3.Text = ""; CKEditorControl4.Text = ""; txtsBrandNameCN.Text = ""; txtsBrandNameEN.Text = ""; CKEditorControl1.Text = ""; CKEditorControl2.Text = ""; DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable dtProductCate = new DataTable(); dtProductCate = DBc.selectNormalTableofAll(false, "tb_ProductCategory"); if (dtProductCate != null) { ddlProductCateTreelist21.ProductList = dtProductCate; } txtnSorting.Text = "1"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnSetLanguage(); DBLL.OptionSysDBLL sys = new DBLL.OptionSysDBLL(); DBLL.DBcommon dbcom = new DBLL.DBcommon(); DBLL.clsProduct clspro = new DBLL.clsProduct(); DataTable dtProduct = clspro.Select_tb_ProductBybHot(true); DataList1.DataSource = dtProduct; DataList1.DataBind(); if (Session["languageGlobal"] == "en") { DataTable dtNews = dbcom.GetDataTable("select top 5 * from tb_News where bEnable=1 and nLangType=1 order by nSorting desc,dCreatedTime desc"); GridView1.DataSource = dtNews; GridView1.DataBind(); } else { DataTable dtNews = dbcom.GetDataTable("select top 5 * from tb_News where bEnable=1 and nLangType=0 order by nSorting desc,dCreatedTime desc"); GridView1.DataSource = dtNews; GridView1.DataBind(); } } }
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(); } }
protected void lvJob_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Label lblnID = (Label)lvJob.Items[e.ItemIndex].FindControl("lblnJobID"); dbcom.sp_DeleteNormalTableByID(int.Parse(lblnID.Text), "tb_Jobs"); ReBindPageList(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { 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; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnSetLanguage(); DBLL.clsFAQs clsfaqs = new DBLL.clsFAQs(); DBLL.DBcommon dbcom = new DBLL.DBcommon(); DataTable dt = dbcom.GetDataTable("select top 1 * from tb_FAQs order by nSorting desc,dCreatedTime desc"); gvFAQS.DataSource = dt; gvFAQS.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); DataTable Topicdt = dbcom.selectNormalTableofAll(false, "tb_Topic"); ddlnTopicID.DataSource = Topicdt; ddlnTopicID.DataValueField = "nTopicID"; ddlnTopicID.DataTextField = "sTopicNameCN"; ddlnTopicID.DataBind(); } }
protected void lvTopicList_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Label lblnID = (Label)lvTopicList.Items[e.ItemIndex].FindControl("lblnTopicID"); int _nID = 0; if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { hfTopicUpdateID.Value = _nID.ToString(); } dbcom.sp_DeleteNormalTableByID(int.Parse(hfTopicUpdateID.Value), "tb_Topic"); }
protected void lvFAQ_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Label lblnID = (Label)lvFAQ.Items[e.ItemIndex].FindControl("lblnFAQID"); int _nID = 0; if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { dbcom.sp_DeleteNormalTableByID(_nID, "tb_FAQs"); ReBindPageList(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); DBLL.clsTopicCategory TopicCategory = new DBLL.clsTopicCategory(); DataTable TopicCategorydt = TopicCategory.sp_selectNormalTableOfAllByTopicCategoryAndnType(false, 3); ddlnTCategoryID.DataSource = TopicCategorydt; ddlnTCategoryID.DataValueField = "nTCategoryID"; ddlnTCategoryID.DataTextField = "sTCategoryNameCN"; ddlnTCategoryID.DataBind(); } }
public void ReBindPageList() { DBLL.DBcommon dbcom = new DBLL.DBcommon(); DataTable dt = new DataTable(); dt = dbcom.selectNormalTableofAll(false, "tb_Topic"); if (dt != null) { TopicList.Merge(dt); lvTopicList.DataSource = TopicList; lvTopicList.DataBind(); } }
protected void lvProductList_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Label lblnID = (Label)lvProductList.Items[e.ItemIndex].FindControl("lblnProductID"); int _nID = 0; if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { hfProductUpdateID.Value = _nID.ToString(); } dbcom.sp_DeleteNormalTableByID(int.Parse(hfProductUpdateID.Value), "tb_Product"); ProductList.Rows.RemoveAt(e.ItemIndex); ReBindPageList(); }
protected void btnSearch_Click(object sender, EventArgs e) { string sSearch = txtSearch.Text; DBLL.clsProduct clspdc = new DBLL.clsProduct(); DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable dtpdc = new DataTable(); if (ddlProductCateTreelist21.nSelectProductCategoryID > 0) { dtpdc = clspdc.Select_tb_ProductBynParentCategoryID(ddlProductCateTreelist21.nSelectProductCategoryID); } else { dtpdc = DBc.selectNormalTableofAll(false, "tb_Product"); } if (dtpdc != null && dtpdc.Rows.Count > 0) { DataTable dtSearchpdc = new DataTable(); string cmd = "sProductNameCN like '%" + sSearch + "%' "; cmd += " or "; cmd += "sProductNameEN like '%" + sSearch + "%' "; //cmd += "sSummaryCN like '%" + sSearch + "%' "; //cmd += " or "; //cmd += "sSummaryEN like '%" + sSearch + "%' "; DataRow[] rows = dtpdc.Select(cmd); foreach (DataColumn col in dtpdc.Columns) { dtSearchpdc.Columns.Add(col.ColumnName.ToString()); } foreach (DataRow row in rows) { dtSearchpdc.Rows.Add(row.ItemArray); } //ProductList = new Model.dsProduct.tb_ProductDataTable(); //ProductList.Merge(dtSearchpdc); lvProduct.DataSource = dtSearchpdc; lvProduct.DataBind(); } //else //{ //dtpdc = DBc.selectNormalTableofAll(false, "tb_Product"); //if (dtpdc != null && dtpdc.Rows.Count > 0) //{ //lvProduct.DataSource = null; //lvProduct.DataBind(); //} //} }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLL.clsJob clsjob = new DBLL.clsJob(); DBLL.DBcommon dbcon = new DBLL.DBcommon(); BindData(); lblcur.Text = (lvNews.PageIndex + 1).ToString(); lbltotal.Text = lvNews.PageCount.ToString(); int nNewsID = 0; if (Request.QueryString["nNewsID"] != null && int.TryParse(Request.QueryString["nNewsID"].ToString(), out nNewsID) && nNewsID > 0) { DBLL.clsNews clsnews = new DBLL.clsNews(); DataTable dtnewsone = clsnews.Select_tb_NewsBynNewsID(nNewsID); if (dtnewsone != null && dtnewsone.Rows.Count > 0) { Panel1.Visible = false; Panel2.Visible = true; Label1.Text = dtnewsone.Rows[0]["sTitle"].ToString(); lblsAuthor.Text = dtnewsone.Rows[0]["sAuthor"].ToString(); lblsCreatedBy.Text = dtnewsone.Rows[0]["dCreatedTime"].ToString(); Image1.ImageUrl = dtnewsone.Rows[0]["sImagePath"].ToString(); if (Image1.ImageUrl == "") { Image1.Visible = false; } divNewsdetail.InnerHtml = dtnewsone.Rows[0]["sContent"].ToString(); } } else { Panel1.Visible = true; Panel2.Visible = false; } if (DataTableNews == null || DataTableNews.Rows.Count < 1) { Label14.Visible = true; } else { Label14.Visible = false; } } OnSetLanguage(); }
public void ReBindPageList() { DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable dt = new DataTable(); dt = DBc.selectNormalTableofAll(false, "tb_User"); if (dt != null) { lvUser.DataSource = dt; lvUser.DataBind(); } else { lvUser.DataSource = null; lvUser.DataBind(); } }
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 ReBindPageList() { DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable dt = new DataTable(); dt = DBc.selectNormalTableofAll(false, "tb_Partners"); if (dt != null) { DataTablePartners.Merge(dt); lvPartners.DataSource = dt; lvPartners.DataBind(); } else { lvPartners.DataSource = null; lvPartners.DataBind(); } }
protected void lvNewsList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { Label lblnID = (Label)lvNewsList.Items[e.NewSelectedIndex].FindControl("lblnNewsID"); int _nID = 0; DBLL.clsNews News = new DBLL.clsNews(); if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { MultiView1.ActiveViewIndex = 1; DBLL.DBcommon dbcom = new DBLL.DBcommon(); DataTable TopicCategorydt = dbcom.selectNormalTableofAll(false, "tb_TopicCategory"); ddlnTCategoryID.DataSource = TopicCategorydt; ddlnTCategoryID.DataValueField = "nTCategoryID"; ddlnTCategoryID.DataTextField = "sTCategoryNameCN"; ddlnTCategoryID.DataBind(); DataTable dt = News.Select_tb_NewsBynNewsID(_nID); ddlnTCategoryID.SelectedValue = dt.Rows[0]["nTCategoryID"].ToString(); txtsTitle.Text = dt.Rows[0]["sTitle"].ToString(); txtsAuthor.Text = dt.Rows[0]["sAuthor"].ToString(); rblnLangType.SelectedValue = dt.Rows[0]["nLangType"].ToString(); Image3.ImageUrl = dt.Rows[0]["sImagePath"].ToString(); if (Image3.ImageUrl != "") { lblsImagePath.Visible = false; MutileUploaderUserControl3.Visible = false; Label2.Visible = true; Button1.Visible = true; Image3.Visible = true; } else { lblsImagePath.Visible = true; MutileUploaderUserControl3.Visible = true; Label2.Visible = false; Button1.Visible = false; Image3.Visible = false; } CKEditorControl1.Text = dt.Rows[0]["sContent"].ToString(); ddlnSorting.SelectedValue = dt.Rows[0]["nSorting"].ToString(); MutileUploaderUserControl3.Refresh(); hfNewsUpdateID.Value = _nID.ToString(); } }
public void BindData() { DBLL.DBcommon dbcon = new DBLL.DBcommon(); if (Session["languageGlobal"] == "en") { DataTable dtNews = dbcon.GetDataTable("select * from tb_News where bEnable=1 and nLangType=1 order by nSorting desc,dCreatedTime desc"); DataTableNews = dtNews; lvNews.DataSource = DataTableNews; lvNews.PageSize = 12; lvNews.DataBind(); } else { DataTable dtNews = dbcon.GetDataTable("select * from tb_News where bEnable=1 and nLangType=0 order by nSorting desc,dCreatedTime desc"); DataTableNews = dtNews; lvNews.DataSource = DataTableNews; lvNews.PageSize = 12; lvNews.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnSetLanguage(); DBLL.DBcommon dbcon = new DBLL.DBcommon(); DataTable dt = dbcon.selectNormalTableofAll(false, "tb_Partners"); DataList1.DataSource = dt; DataList1.DataBind(); if (dt == null || dt.Rows.Count < 1) { Label14.Visible = true; } else { Label14.Visible = false; } } }
protected void lvProduct_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); DBLL.clsPartners clPartners = new DBLL.clsPartners(); DBLL.clsProduct clProduct = new DBLL.clsProduct(); Label lblnID = (Label)lvProduct.Items[e.ItemIndex].FindControl("lblnProductID"); int _nID = 0; if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { bool Result = dbcom.sp_DeleteNormalTableByID2(int.Parse(lblnID.Text), "tb_Product"); if (Result) { //判断文件是不是存在 DataTable dsPro = clProduct.Select_tb_ProductBynProductIDEnable(_nID); if (dsPro.Rows.Count > 0) { //Image ImsImagePath = (Image)lvProduct.Items[e.ItemIndex].FindControl("sPImagePath"); //string sSaveFolderFullPath = Server.MapPath(ImsImagePath.ImageUrl); string sSaveFolderFullPath = Server.MapPath(dsPro.Rows[0]["sPImagePath"].ToString()); if (File.Exists(sSaveFolderFullPath)) { //如果存在则删除 File.Delete(sSaveFolderFullPath); } //Image ImsImagePath2 = (Image)lvProduct.Items[e.ItemIndex].FindControl("sThumbPath"); //string sSaveFolderFullPath2 = Server.MapPath(ImsImagePath2.ImageUrl); string sSaveFolderFullPath2 = Server.MapPath(dsPro.Rows[0]["sThumbPath"].ToString()); if (File.Exists(sSaveFolderFullPath2)) { //如果存在则删除 File.Delete(sSaveFolderFullPath2); } } } ReBindPageList(); } }
public void ReBindPageList() { DBLL.clsProduct Product = new DBLL.clsProduct(); DataTable dt = new DataTable(); dt = Product.sp_selectNormalTableOfAllByProduct(false); if (dt != null) { ProductList.Merge(dt); lvProductList.DataSource = ProductList; lvProductList.DataBind(); } else { lvProductList.DataSource = null; lvProductList.DataBind(); } DBLL.DBcommon dbcom = new DBLL.DBcommon(); Model.dsProduct.tb_ProductCategoryDataTable ProductCategoryList = new Model.dsProduct.tb_ProductCategoryDataTable(); ProductCategoryList.Merge(dbcom.selectNormalTableofAll(false, "tb_ProductCategory")); ddlProductCateTreelist1.ProductList = ProductCategoryList; }
protected void lvTopicCategoryList_ItemDeleting(object sender, ListViewDeleteEventArgs e) { DBLL.DBcommon dbcom = new DBLL.DBcommon(); Label lblnID = (Label)lvTopicCategoryList.Items[e.ItemIndex].FindControl("lblnTCategoryID"); int _nID = 0; if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { hfTopicCategoryUpdateID.Value = _nID.ToString(); } if (hfTopicCategoryUpdateID.Value == "18" || hfTopicCategoryUpdateID.Value == "19" || hfTopicCategoryUpdateID.Value == "20") { ShowMsg1.InnerContent = "此栏目不能删除!"; ShowMsg1.Show(); ReBindPageList(); } else { dbcom.sp_DeleteNormalTableByID(int.Parse(hfTopicCategoryUpdateID.Value), "tb_TopicCategory"); TopicCategoryList.Rows.RemoveAt(e.ItemIndex); ReBindPageList(); } }
protected void lvTopicCategoryList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { Label lblnID = (Label)lvTopicCategoryList.Items[e.NewSelectedIndex].FindControl("lblnTCategoryID"); int _nID = 0; DBLL.clsTopicCategory TopicCategory = new DBLL.clsTopicCategory(); if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { MultiView1.ActiveViewIndex = 1; DBLL.DBcommon dbcom = new DBLL.DBcommon(); DataTable Topicdt = dbcom.selectNormalTableofAll(false, "tb_Topic"); ddlnTopicID.DataSource = Topicdt; ddlnTopicID.DataValueField = "nTopicID"; ddlnTopicID.DataTextField = "sTopicNameCN"; ddlnTopicID.DataBind(); DataTable dt = TopicCategory.Select_tb_TopicCategoryBynTCategoryID(_nID); ddlnTopicID.SelectedValue = dt.Rows[0]["nTopicID"].ToString(); txtsTCategoryNameCN.Text = dt.Rows[0]["sTCategoryNameCN"].ToString(); txtsTCategoryNameEN.Text = dt.Rows[0]["sTCategoryNameEN"].ToString(); rblnType.SelectedValue = dt.Rows[0]["nType"].ToString(); if (rblnType.SelectedValue == "1") { CKEditorControl1.Enabled = true; CKEditorControl2.Enabled = true; } else { CKEditorControl1.Enabled = false; CKEditorControl2.Enabled = false; } CKEditorControl1.Text = dt.Rows[0]["sContentCN"].ToString(); CKEditorControl2.Text = dt.Rows[0]["sContentEN"].ToString(); ddlnSorting.SelectedValue = dt.Rows[0]["nSorting"].ToString(); hfTopicCategoryUpdateID.Value = _nID.ToString(); } }
public void ReBindPageList() { DBLL.DBcommon DBc = new DBLL.DBcommon(); DataTable dt = new DataTable(); DataTable dtProductCate = new DataTable(); dtProductCate = DBc.selectNormalTableofAll(false, "tb_ProductCategory"); if (dtProductCate != null) { ddlProductCateTreelist21.ProductList = dtProductCate; } dt = DBc.selectNormalTableofAll(false, "tb_Product"); if (dt != null) { DataTableProduct.Merge(dt); lvProduct.DataSource = dt; lvProduct.DataBind(); } else { lvProduct.DataSource = null; lvProduct.DataBind(); } }