Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                string strKnowledgeID = Request.QueryString.Get("knowledgeId");
                if (strKnowledgeID != null && strKnowledgeID != string.Empty)
                {
                    hfKnowledgeID.Value = strKnowledgeID;
                    KnowledgeBLL             objBll = new KnowledgeBLL();
                    RailExam.Model.Knowledge obj    = objBll.GetKnowledge(Convert.ToInt32(strKnowledgeID));
                    txtKnowledgeName.Text      = txtKnowledgeName.Text + GetKnowledgeName("/" + obj.KnowledgeName, obj.ParentId);
                    ImgSelectKnowledge.Visible = false;
                }

                ArrayList objOrgList = new ArrayList();
                if (PrjPub.CurrentLoginUser.SuitRange == 0)
                {
                    OrganizationBLL orgBll = new OrganizationBLL();
                    txtPublishOrgName.Text = orgBll.GetOrganization(PrjPub.CurrentLoginUser.StationOrgID).ShortName;
                    hfPublishOrgID.Value   = PrjPub.CurrentLoginUser.StationOrgID.ToString();

                    IList <Organization> objOrganizationList =
                        orgBll.GetOrganizationsByWhereClause("ID_Path || '/' like '/1/" + PrjPub.CurrentLoginUser.StationOrgID + "/%' ");
                    foreach (Organization organization in objOrganizationList)
                    {
                        objOrgList.Add(organization.OrganizationId);
                    }
                }

                //txtPublishOrgName.Text = PrjPub.CurrentLoginUser.OrgName;
                //hfPublishOrgID.Value = PrjPub.CurrentLoginUser.OrgID.ToString();
                BindOrganizationTree(objOrgList);

                ArrayList objList = new ArrayList();
                if (!string.IsNullOrEmpty(Request.QueryString.Get("PostId")))
                {
                    objList.Add(Convert.ToInt32(Request.QueryString.Get("PostId")));
                }
                BindPostTree(objList);
            }
        }
Ejemplo n.º 2
0
        private string GetKnowledgeName(string strName, int nID)
        {
            string str = "";

            if (nID != 0)
            {
                KnowledgeBLL             objBll = new KnowledgeBLL();
                RailExam.Model.Knowledge obj    = objBll.GetKnowledge(nID);

                if (obj.ParentId != 0)
                {
                    str = GetKnowledgeName("/" + obj.KnowledgeName, obj.ParentId) + strName;
                }
                else
                {
                    str = obj.KnowledgeName + strName;
                }
            }

            return(str);
        }