protected void lvFAQs_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { try { Label lblnID = (Label)lvFAQs.Items[e.NewSelectedIndex].FindControl("lblnID"); int nID = 0; if (int.TryParse(lblnID.Text.Trim(), out nID) && nID > 0) { DBLL.clsFAQs clsnews = new DBLL.clsFAQs(); DataTable dtnews = clsnews.Select_tb_FAQsBynFAQID(nID); if (dtnews != null && dtnews.Rows.Count > 0) { if (Session["languageGlobal"] == "en") { lblFAQsDetailtitle.Text = dtnews.Rows[0]["sQuestionEN"].ToString(); lblFAQsDetailTime.Text = dtnews.Rows[0]["dCreatedTime"].ToString(); divFAQsDetail.InnerHtml = dtnews.Rows[0]["sAnswerEN"].ToString(); } else { lblFAQsDetailtitle.Text = dtnews.Rows[0]["sQuestionCN"].ToString(); lblFAQsDetailTime.Text = dtnews.Rows[0]["dCreatedTime"].ToString(); divFAQsDetail.InnerHtml = dtnews.Rows[0]["sAnswerCN"].ToString(); } PnlFAQsDetail.Visible = true; lvFAQs.Visible = false; } } } catch (Exception) { throw; } }
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.clsFAQs clFAQ = new DBLL.clsFAQs(); DataTable dt = clFAQ.Select_tb_FAQsBynFAQID(nID); if (dt != null && dt.Rows.Count > 0) { hfID.Value = dt.Rows[0]["nFAQID"].ToString(); txtsQuestionCN.Text = dt.Rows[0]["sQuestionCN"].ToString(); txtsQuestionEN.Text = dt.Rows[0]["sQuestionEN"].ToString(); txtsAnswerCN.Text = dt.Rows[0]["sAnswerCN"].ToString(); txtsAnswerEN.Text = dt.Rows[0]["sAnswerEN"].ToString(); txtnSorting.Text = dt.Rows[0]["nSorting"].ToString(); //绑定数据 } } else { lblBigtitle.Text = "添加数据"; btnUpdate.Visible = false; BtnAdd.Visible = true; } } }
protected void lvFAQList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { Label lblnID = (Label)lvFAQList.Items[e.NewSelectedIndex].FindControl("lblnFAQID"); int _nID = 0; DBLL.clsFAQs FAQ = new DBLL.clsFAQs(); if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0) { MultiView1.ActiveViewIndex = 1; DataTable dt = FAQ.Select_tb_FAQsBynFAQID(_nID); txtsQuestionCN.Text = dt.Rows[0]["sQuestionCN"].ToString(); txtsQuestionEN.Text = dt.Rows[0]["sQuestionEN"].ToString(); txtsAnswerCN.Text = dt.Rows[0]["sAnswerCN"].ToString(); txtsAnswerEN.Text = dt.Rows[0]["sAnswerEN"].ToString(); ddlnSorting.SelectedValue = dt.Rows[0]["nSorting"].ToString(); hfFAQUpdateID.Value = _nID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnSetLanguage(); MultiView1.ActiveViewIndex = 0; DBLL.clsTopicCategory clsTopicCate = new DBLL.clsTopicCategory(); int _nTCategoryID = 0; if (Request.QueryString["nTCategoryID"] != null && int.TryParse(Request.QueryString["nTCategoryID"], out _nTCategoryID)) { DataTable dttc = clsTopicCate.Select_tb_TopicCategoryBynTCategoryID(_nTCategoryID); if (dttc != null && dttc.Rows.Count > 0) { int nType = int.Parse(dttc.Rows[0]["nType"].ToString()); switch (nType) { case 1: { if (Session["languageGlobal"] == "en") { SetType1DivContent(dttc.Rows[0]["sTCategoryNameEN"].ToString(), dttc.Rows[0]["sContentEN"].ToString()); } else { SetType1DivContent(dttc.Rows[0]["sTCategoryNameCN"].ToString(), dttc.Rows[0]["sContentCN"].ToString()); } break; } case 2: { if (Session["languageGlobal"] == "en") { SetTyp2Ablum(dttc.Rows[0]["sTCategoryNameEN"].ToString(), _nTCategoryID); } else { SetTyp2Ablum(dttc.Rows[0]["sTCategoryNameCN"].ToString(), _nTCategoryID); } break; } case 3: { if (Session["languageGlobal"] == "en") { SetTyp3News(dttc.Rows[0]["sTCategoryNameEN"].ToString(), _nTCategoryID, 2); } else { SetTyp3News(dttc.Rows[0]["sTCategoryNameCN"].ToString(), _nTCategoryID, 1); } break; } case 4: { if (Session["languageGlobal"] == "en") { SetTyp4FAQs(dttc.Rows[0]["sTCategoryNameEN"].ToString(), _nTCategoryID); } else { SetTyp4FAQs(dttc.Rows[0]["sTCategoryNameCN"].ToString(), _nTCategoryID); } break; } default: break; } int nFAQsID = 0; if (Session["nFAQsRidectSet"] != null && int.TryParse(Session["nFAQsRidectSet"].ToString(), out nFAQsID) && nFAQsID > 0) { Session["nFAQsRidectSet"] = ""; DBLL.clsFAQs clsnews = new DBLL.clsFAQs(); DataTable dtnews = clsnews.Select_tb_FAQsBynFAQID(nFAQsID); if (dtnews != null && dtnews.Rows.Count > 0) { if (Session["languageGlobal"] == "en") { lblFAQsDetailtitle.Text = dtnews.Rows[0]["sQuestionEN"].ToString(); lblFAQsDetailTime.Text = dtnews.Rows[0]["dCreatedTime"].ToString(); divFAQsDetail.InnerHtml = dtnews.Rows[0]["sAnswerEN"].ToString(); } else { lblFAQsDetailtitle.Text = dtnews.Rows[0]["sQuestionCN"].ToString(); lblFAQsDetailTime.Text = dtnews.Rows[0]["dCreatedTime"].ToString(); divFAQsDetail.InnerHtml = dtnews.Rows[0]["sAnswerCN"].ToString(); } PnlFAQsDetail.Visible = true; lvFAQs.Visible = false; } } } } } }