Exemplo n.º 1
0
        /// <summary>
        /// 设置特殊属性的值,从模型到属性列表
        /// 有些属性的值是通过计算得来的,保存参数之前需要先调用一下此方法
        /// </summary>
        public virtual void SetBasicPropertyValues()
        {
            //默认XmlKey的值有ID决定
            int              xmlKey   = ID;
            long             xmlObjID = ObjectID;
            ResourceProperty propertyValue;

            for (int i = 0; i < mListProperties.Count; i++)
            {
                propertyValue = mListProperties[i];
                switch (propertyValue.PropertyID)
                {
                case S1110Consts.PROPERTYID_KEY:
                    propertyValue.Value = Key.ToString();
                    break;

                case S1110Consts.PROPERTYID_ID:
                    propertyValue.Value = ID.ToString();
                    break;

                case S1110Consts.PROPERTYID_PARENTOBJID:
                    propertyValue.Value = ParentID.ToString();
                    break;

                case S1110Consts.PROPERTYID_XMLKEY:
                    propertyValue.Value = xmlKey.ToString();
                    break;

                case S1110Consts.PROPERTYID_XMLOBJID:
                    propertyValue.Value = xmlObjID.ToString();
                    break;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get XmlNode containing the node.
        /// </summary>
        /// <param name="xDoc">XmlDocument object used to spawn node</param>
        /// <param name="full">If true, all possible attributes will be output.
        /// If false, only filled and appropriate attributes will be output.</param>
        public override XmlNode ToXml(XmlDocument xDoc, bool full = false)
        {
            XmlElement   xElem;
            XmlAttribute xAttr;

            xElem = xDoc.CreateElement("folder_arme");
            if (!HasDefaultName)
            {
                xAttr       = xDoc.CreateAttribute("name");
                xAttr.Value = Name;
                xElem.Attributes.Append(xAttr);
            }
            if (ID != null)
            {
                xAttr       = xDoc.CreateAttribute("id_arme");
                xAttr.Value = ID.ToString();
                xElem.Attributes.Append(xAttr);
            }
            if (ParentID != null)
            {
                xAttr       = xDoc.CreateAttribute("parent_id_arme");
                xAttr.Value = ParentID.ToString();
                xElem.Attributes.Append(xAttr);
            }
            foreach (string item in ExtraAttributes)
            {
                xAttr       = xDoc.CreateAttribute(item);
                xAttr.Value = "";
                xElem.Attributes.Append(xAttr);
            }

            return(xElem);
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("NodeEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string mParentID = base.Request.QueryString["ParentID"];
         int    ParentID;
         if (string.IsNullOrEmpty(mParentID))
         {
             ParentID = 0;
         }
         else
         {
             ParentID = DataConverter.CLng(mParentID);
         }
         if (ParentID == 0)
         {
             this.LblNodeName.Text = "根节点";
         }
         else
         {
             M_Node node = this.bll.GetNode(ParentID);
             if (node.IsNull)
             {
                 this.LblNodeName.Text = "根节点";
             }
             else
             {
                 this.LblNodeName.Text = node.NodeName;
             }
         }
         this.HdnParentId.Value = ParentID.ToString();
         this.HdnDepth.Value    = this.bll.GetDepth(ParentID).ToString();
         this.HdnOrderID.Value  = this.bll.GetOrder(ParentID).ToString();
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Get XmlNode containing the node.
        /// </summary>
        /// <param name="xDoc">XmlDocument object used to spawn node</param>
        /// <param name="full">If true, all possible attributes will be output.
        /// If false, only filled and appropriate attributes will be output.</param>
        public override XmlNode ToXml(XmlDocument xDoc, bool full = false)
        {
            XmlElement   xElem;
            XmlAttribute xAttr;

            xElem = xDoc.CreateElement(Enabled ? "event" : "disabled_event");
            if (!HasDefaultName || full)
            {
                xAttr       = xDoc.CreateAttribute("name");
                xAttr.Value = Name;
                xElem.Attributes.Append(xAttr);
            }
            if (ID != null)
            {
                xAttr       = xDoc.CreateAttribute("id_arme");
                xAttr.Value = ID.ToString();
                xElem.Attributes.Append(xAttr);
            }
            if (ParentID != null)
            {
                xAttr       = xDoc.CreateAttribute("parent_id_arme");
                xAttr.Value = ParentID.ToString();
                xElem.Attributes.Append(xAttr);
            }

            foreach (MissionStatement item in Conditions)
            {
                xElem.AppendChild(item.ToXml(xDoc, full));
            }
            foreach (MissionStatement item in Actions)
            {
                xElem.AppendChild(item.ToXml(xDoc, full));
            }

            return(xElem);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("NodeEdit"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                string mParentID = base.Request.QueryString["ParentID"];
                int    ParentID;
                if (string.IsNullOrEmpty(mParentID))
                {
                    ParentID = 0;
                }
                else
                {
                    ParentID = DataConverter.CLng(mParentID);
                }
                if (ParentID == 0)
                {
                    this.LblNodeName.Text = "根节点";
                }
                else
                {
                    M_Node node = this.bll.GetNode(ParentID);
                    if (node.IsNull)
                    {
                        this.LblNodeName.Text = "根节点";
                    }
                    else
                    {
                        this.LblNodeName.Text = node.NodeName;
                    }
                }
                this.HdnParentId.Value = ParentID.ToString();

                DataTable dt = this.bllmodel.GetList();
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();

                string ModelIDArr = "";
                foreach (DataRow dr in dt.Rows)
                {
                    if (string.IsNullOrEmpty(ModelIDArr))
                    {
                        ModelIDArr = dr["ModelID"].ToString();
                    }
                    else
                    {
                        ModelIDArr += "," + dr["ModelID"].ToString();
                    }
                }
                this.HdnModeID.Value = ModelIDArr;
                //this.ChkModelList.DataSource = dt;
                //this.ChkModelList.DataTextField = "ModelName";
                //this.ChkModelList.DataValueField = "ModelID";
                //this.ChkModelList.DataBind();
                this.HdnDepth.Value    = this.bll.GetDepth(ParentID).ToString();
                this.HdnOrderID.Value  = this.bll.GetOrder(ParentID).ToString();
                this.callBackReference = this.Page.ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context");
            }
        }
Exemplo n.º 6
0
        public void WriteXml(XmlWriter writer)
        {
            //------Always log these for reconstruction------------
            writer.WriteAttributeString("DisplayName", DisplayName);

            writer.WriteAttributeString("ID", ID.ToString());

            writer.WriteAttributeString("OriginalInstanceID", OriginalInstanceID.ToString());

            writer.WriteAttributeString("ParentID", ParentID.ToString());

            writer.WriteAttributeString("ServerID", ServerID.ToString());

            writer.WriteAttributeString("StateType", StateType.ToString());

            writer.WriteElementString("HasError", HasError.ToString());

            writer.WriteAttributeString("SessionID", SessionID.ToString());

            if (HasError)
            {
                writer.WriteElementString("ErrorMessage", ErrorMessage);
            }
            //-----------------------------

            var settings = WorkflowLoggger.LoggingSettings;

            //Version
            if (settings.IsVersionLogged && !string.IsNullOrWhiteSpace(Version))
            {
                writer.WriteElementString("Version", Version);
            }

            //Type
            if (settings.IsTypeLogged)
            {
                writer.WriteElementString("Name", Name);
                writer.WriteElementString("ActivityType", ActivityType.ToString());
            }

            //Duration
            if (settings.IsDurationLogged)
            {
                if (Duration != default(TimeSpan))
                {
                    writer.WriteElementString("Duration", DurationString);
                }
            }

            //DateTime
            if (settings.IsDataAndTimeLogged)
            {
                if (StartTime != DateTime.MinValue)
                {
                    writer.WriteElementString("StartTime", StartTime.ToString("G"));
                }
                if (EndTime != DateTime.MinValue)
                {
                    writer.WriteElementString("EndTime", EndTime.ToString("G"));
                }
            }


            //Input
            if (settings.IsInputLogged && Inputs.Count > 0)
            {
                writer.WriteStartElement("Inputs");
                writer.WriteAttributeString("Count", Inputs.Count.ToString(CultureInfo.InvariantCulture));

                var inputSer = new XmlSerializer(typeof(DebugItem));
                foreach (var other in Inputs)
                {
                    inputSer.Serialize(writer, other);
                }
                writer.WriteEndElement();
            }

            //Output
            if (settings.IsOutputLogged && Outputs.Count > 0)
            {
                writer.WriteStartElement("Outputs");
                writer.WriteAttributeString("Count", Outputs.Count.ToString(CultureInfo.InvariantCulture));

                var outputSer = new XmlSerializer(typeof(DebugItem));
                foreach (var other in Outputs)
                {
                    outputSer.Serialize(writer, other);
                }
                writer.WriteEndElement();
            }

            //StartBlock
            if (IsFirstStep())
            {
                if (ExecutionOrigin != ExecutionOrigin.Unknown)
                {
                    writer.WriteElementString("ExecutionOrigin", ExecutionOrigin.ToString());
                }
                if (!string.IsNullOrWhiteSpace(ExecutingUser))
                {
                    writer.WriteElementString("ExecutingUser", ExecutingUser);
                }
            }

            //EndBlock

            if (IsFinalStep())
            {
                writer.WriteElementString("NumberOfSteps", NumberOfSteps.ToString(CultureInfo.InvariantCulture));
            }
        }
Exemplo n.º 7
0
        public ActionResult Addpost(hx_td_web_type p)
        {
            ChuanglitouP2P.BLL.B_td_web_type   b1  = new BLL.B_td_web_type();
            ChuanglitouP2P.Model.M_td_web_type obj = new Model.M_td_web_type();

            int rootid   = DNTRequest.GetInt("rootid", 0);
            int isresult = 0;


            int    ClassID = 0;
            string ClassName;
            int    PrevOrderID;
            int    RootID = 0;
            int    ParentDepth;
            string ParentPath;
            string ParentName;

            int depath;

            int PrevID;

            int Child;
            int ParentID;


            PrevOrderID = 0;
            ParentPath  = "0";
            ParentName  = "";
            ParentDepth = 0;
            PrevID      = 0;

            Child      = 0;
            ParentPath = "";

            ParentID  = Convert.ToInt16(Request.Form["parentid"]);
            ClassName = DNTRequest.GetString("menu_name");

            ClassID = b1.GetMaxId();

            if (ParentID > 0)
            {
                SqlDataReader sdr = DbHelperSQL.Re_dr("select * From hx_td_web_type where menu_id=" + ParentID.ToString() + "");

                if (sdr.Read() == false)
                {
                    Response.Write("<script>alert(\"所属栏目已经被删除!\");history.back();</script>");
                }
                else
                {
                    RootID      = Convert.ToInt32(sdr["RootID"]);
                    ParentName  = sdr["menu_name"].ToString();
                    ParentDepth = Convert.ToInt32(sdr["Depath"]);
                    ParentPath  = sdr["ParentPath"].ToString();
                    Child       = Convert.ToInt32(sdr["Child"]);
                    // ParentPath = ParentPath + "," + ParentID;    //得到此栏目的父级栏目路径
                    PrevOrderID = Convert.ToInt32(sdr["OrderID"]);
                    sdr.Close();
                    sdr.Dispose();
                }
                sdr.Close();
                sdr.Dispose();
            }
            else
            {
                RootID = ClassID;
            }

            // p = (hx_td_web_type)Utils.ValidateModelClass(p);
            if (ParentID > 0)
            {
                depath = ParentDepth + 1;
            }
            else
            {
                depath = 0;
            }
            if (ParentPath == "")
            {
                ParentPath = "," + ClassID.ToString() + ",";
            }
            else
            {
                ParentPath += "," + ClassID.ToString() + ",";
            }

            try
            {
                obj.menu_id    = ClassID;   // +i;
                obj.menu_name  = ClassName; // +i.ToString();
                obj.parentid   = ParentID;
                obj.parentpath = ParentPath;
                obj.depath     = depath;
                obj.rootid     = rootid;
                obj.child      = 0;
                obj.previd     = PrevID;
                obj.nextid     = 0;

                obj.createtime = DateTime.Now;
                obj.orderid    = DNTRequest.GetInt("orderid", 1);
                obj.path1      = DNTRequest.GetString("path1");



                isresult = b1.Add(obj);
            }
            catch (Exception ee)
            {
                Response.Write(ee.Message.ToString());
            }

            if (ParentID > 0)
            {
                //更新其父类的子栏目数
                DbHelperSQL.RunSql("update hx_td_web_type set child=child+1 where menu_id=" + ParentID.ToString());
            }
            else if (ParentID == 0)
            {
                //DbHelperSQL.RunSql("update hx_td_web_type set rootid=" + isresult + ",parentpath='," + isresult + ",' where menu_id=" + isresult.ToString());
                DbHelperSQL.RunSql("update hx_td_web_type set parentpath='," + isresult + ",' where menu_id=" + isresult.ToString());
            }
            //Response.Write("<script>alert(\"添加成功\");location.href='Add_Edit_web_type.aspx?ParentID=" + ParentID.ToString() + "'</script>");

            //p.createtime = DateTime.Now;
            //p.menu_name = DNTRequest.GetString("menu_name");
            //p.path1 = DNTRequest.GetString("path1");
            //p.orderid = DNTRequest.GetInt("orderid", 0);


            //ef.hx_td_web_type.Add(p);
            //ef.SaveChanges();


            string str = "";

            if (rootid > 0)
            {
                str = StringAlert.Alert("网站分类添加成功!", "/Admin/WebType/index?rootid=" + rootid);
            }
            else
            {
                str = StringAlert.Alert("网站分类添加成功!", "/Admin/WebType/index?rootid=" + isresult);
            }


            return(Content(str, "text/html"));
        }
 public override bool PerformDelete()
 {
     LogHelper.Debug <dictionaryTasks>(TypeID.ToString() + " " + ParentID.ToString() + " deleting " + Alias);
     new cms.businesslogic.Dictionary.DictionaryItem(ParentID).delete();
     return(true);
 }