protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strBookID = Request.QueryString.Get("id"); ViewState["BookID"] = strBookID; hfMode.Value = Request.QueryString.Get("mode"); if (strBookID != null && strBookID != "") { FillPage(int.Parse(strBookID)); if (hfMode.Value == "ReadOnly") { SaveButton.Visible = false; CancelButton.Visible = true; SaveNextButton.Visible = false; SaveExitButton.Visible = false; } else if (hfMode.Value == "Edit") { btnChapter.Visible = true; SaveButton.Visible = true; CancelButton.Visible = false; SaveExitButton.Visible = false; SaveNextButton.Visible = false; } } else { SaveButton.Visible = false; SaveNextButton.Visible = true; SaveExitButton.Visible = true; CancelButton.Visible = false; datePublishDate.DateValue = DateTime.Today.ToString("yyyy-MM-dd"); string strKnowledgeID = Request.QueryString.Get("knowledgeId"); if (strKnowledgeID != null && strKnowledgeID != string.Empty) { hfKnowledgeID.Value = strKnowledgeID; AssistBookCategoryBLL objBll = new AssistBookCategoryBLL(); RailExam.Model.AssistBookCategory obj = objBll.GetAssistBookCategory(Convert.ToInt32(strKnowledgeID)); txtKnowledgeName.Text = txtKnowledgeName.Text + GetCategoryName("/" + obj.AssistBookCategoryName, obj.ParentId); ImgSelectKnowledge.Visible = false; } ArrayList objList = new ArrayList(); BindOrganizationTree(objList); BindPostTree(objList); } } }
private string GetCategoryName(string strName, int nID) { string str = ""; if (nID != 0) { AssistBookCategoryBLL objBll = new AssistBookCategoryBLL(); RailExam.Model.AssistBookCategory obj = objBll.GetAssistBookCategory(nID); if (obj.ParentId != 0) { str = GetCategoryName("/" + obj.AssistBookCategoryName, obj.ParentId) + strName; } else { str = obj.AssistBookCategoryName + strName; } } return(str); }