Example #1
0
        protected void btnCall_Click(object sender, EventArgs e)
        {
            if ("" == ddlClass.Text) return;
            if (!Core.Utils.IsNumber(txtLevel.Text.Trim())) return;
            int level = Core.MyConvert.GetInt32(txtLevel.Text.Trim());

            List<Model.XYClassInfo> infos = Business.XYClass.GetItemsAll(ddlClass.Text);

            System.Text.StringBuilder strHTML = new System.Text.StringBuilder("");

            foreach (Model.XYClassInfo info in infos)
            {
                strHTML.Append("<dl>" + ((char)10).ToString());
                strHTML.Append("<dt>");
                strHTML.Append("<h4>");

                strHTML.Append(SetHtmlUrl(info.ClassId.ToString(), info.ClassName));

                //strHTML = strHTML.Append("//");
                strHTML.Append("</h4>");
                strHTML.Append("</dt>");

                strHTML.Append(((char)10).ToString());

                if (info.HasSub)
                {
                    strHTML.Append(GetChildHTML(info.childList, 1, level));
                }

                strHTML.Append("</dl>"  +((char)10).ToString());
            }

            string labelName = this.txtLabelName.Text.Trim();

            XYECOM.Business.ClassLabel dal = new XYECOM.Business.ClassLabel();

            if (dal.IsExists("XY_CLS_" + labelName))
            {
                this.lblMsg.Text = "��ǩ�����ظ�����ѡ���������ƣ�";
                return;
            }

            Model.ClassLabelInfo clsLabelInfo = new XYECOM.Model.ClassLabelInfo();

            clsLabelInfo.Name = "XY_CLS_" + labelName;
            clsLabelInfo.CNName = this.txtCNName.Text.Trim();
            clsLabelInfo.Body = strHTML.ToString().Replace("///", "");
            clsLabelInfo.TableName = Business.XYClass.GetTableInfo(ddlClass.Text.ToLower()).TableName;

            new Business.ClassLabel().Insert(clsLabelInfo);
            Response.Redirect("ClassLabelList.aspx");
        }
Example #2
0
        protected void btnCall_Click(object sender, EventArgs e)
        {
            if ("" == ddlClass.Text) return;
            if (!Core.Utils.IsNumber(txtLevel.Text.Trim())) return;
            int level = Core.MyConvert.GetInt32(txtLevel.Text.Trim());

            List<Model.AreaInfo> infos = new Business.Area().GetItems(0);

            System.Text.StringBuilder strHTML = new System.Text.StringBuilder("");
            strHTML.Append("<ul>");
            foreach (Model.AreaInfo info in infos)
            {
                strHTML.Append("<li>");
                strHTML.Append("<span>");

                strHTML.Append(SetHtmlUrl(info.ID.ToString(), info.Name));

                //strHTML = strHTML.Append("//");
                strHTML.Append("</span>");

                if (info.HasSubArea)
                {
                    List<Model.AreaInfo> childList = new Business.Area().GetItems(info.ID);
                    strHTML.Append(GetChildHTML(childList, 1, level));
                }
                strHTML.Append("</li>");
            }
            strHTML.Append("</ul>");

            string labelName = this.txtLabelName.Text.Trim();

            XYECOM.Business.ClassLabel dal = new XYECOM.Business.ClassLabel();

            if (dal.IsExists("XY_CLS_" + labelName))
            {
                this.lblMsg.Text = "��ǩ�����ظ�����ѡ���������ƣ�";
                return;
            }

            Model.ClassLabelInfo clsLabelInfo = new XYECOM.Model.ClassLabelInfo();

            clsLabelInfo.Name = "XY_CLS_" + labelName;
            clsLabelInfo.CNName = this.txtCNName.Text.Trim();
            clsLabelInfo.Body = strHTML.ToString().Replace("///", "");
            clsLabelInfo.TableName = "XY_Area";

            new Business.ClassLabel().Insert(clsLabelInfo);
            Response.Redirect("ClassLabelList.aspx");
        }
Example #3
0
        /// <summary>
        /// ���HTML
        /// </summary>
        private bool CombinationHTML()
        {
            System.Text.StringBuilder strHTML = new System.Text.StringBuilder("");
            strHTML.Append("<ul>");
            //��λ
            string[] arrCom = hddValue.Value.Split('$');
            foreach (string com in arrCom)
            {
                strHTML.Append("<li>");

                string[] arrcls = com.Split('#');
                string[] arrcls1 = arrcls[0].Split(',');
                strHTML.Append("<span>");
                foreach (string cls in arrcls1)
                {
                    string[] obj = cls.Split('|');
                    strHTML.Append(SetHtmlUrl(obj[0], Core.Utils.JSunescape(obj[1])));
                }
                //strHTML = strHTML.Append("//");
                strHTML.Append("</span>");

                if ("" != arrcls[1])
                {
                    string[] arrcls2 = arrcls[1].Split(',');
                    strHTML.Append("<ol>");
                    foreach (string cls in arrcls2)
                    {
                        string[] obj = cls.Split('|');
                        strHTML.Append("<li>");
                        strHTML.Append(SetHtmlUrl(obj[0], Core.Utils.JSunescape(obj[1])));
                        strHTML.Append("</li>");
                    }
                    strHTML.Append("</ol>");
                }
                strHTML.Append("</li>");
            }
            strHTML.Append("</ul>");

            string labelName = this.txtLabelName.Text.Trim();

            XYECOM.Business.ClassLabel dal = new XYECOM.Business.ClassLabel();

            if (dal.IsExists("XY_CLS_" + labelName))
            {
                this.lblMsg.Text = "��ǩ�����ظ�����ѡ���������ƣ�";
                return false;
            }

            Model.ClassLabelInfo clsLabelInfo = new XYECOM.Model.ClassLabelInfo();

            clsLabelInfo.Name = "XY_CLS_" + labelName;
            clsLabelInfo.CNName = this.txtCNName.Text.Trim();
            clsLabelInfo.Body = strHTML.ToString().Replace("///", "");
            clsLabelInfo.TableName = "XY_Area";

            new Business.ClassLabel().Insert(clsLabelInfo);

            return true;
        }