Ejemplo n.º 1
0
        public static int OCSiteColumn_Edit(string columnsname, int type, int OCID, int ColumnID, int ParentID)
        {
            string userid = IESCookie.GetCookieValue("ies");

            IES.JW.Model.User user = new IES.JW.Model.User {
                UserID = Int32.Parse(userid)
            };
            user = UserService.User_Get(user);
            OCSiteColumn column = new OCSiteColumn();

            column.ColumnID    = ColumnID;
            column.OCID        = OCID;
            column.Title       = columnsname;
            column.UserID      = user.UserID;
            column.ParentID    = ParentID;
            column.ContentType = type;
            ISiteBLL ocbll = new SiteBLL();

            return(ocbll.OCSiteColumn_Edit(column));
        }
Ejemplo n.º 2
0
        public static List <OCSiteColumn> OCSiteColumn_Tree(int OCID)
        {
            ISiteBLL ocbll  = new SiteBLL();
            string   userid = IESCookie.GetCookieValue("ies");

            if (userid != "-1")
            {
                IES.JW.Model.User user = new IES.JW.Model.User {
                    UserID = Int32.Parse(userid)
                };
                user = UserService.User_Get(user);
                List <OCSite> ocsitelist = ocbll.OCSite_Get(OCID, user.UserID);
                OCSite        ocsite     = null;
                if (ocsitelist != null && ocsitelist.Count > 0)
                {
                    ocsite = ocsitelist[0];
                }
                OCSiteColumn        ocsitecolumn = new OCSiteColumn();
                List <OCSiteColumn> listcolumn   = ocbll.OCSiteColumn_Tree(OCID, user.UserID);
                ForeachPropertyNode(listcolumn, ocsitecolumn, 0, ocsite);
                return(ocsitecolumn.Children);
            }
            else
            {
                List <OCSite> ocsitelist = ocbll.OCSite_Get(OCID, -1);
                OCSite        ocsite     = null;
                if (ocsitelist != null && ocsitelist.Count > 0)
                {
                    ocsite = ocsitelist[0];
                }
                OCSiteColumn        ocsitecolumn = new OCSiteColumn();
                List <OCSiteColumn> listcolumn   = ocbll.OCSiteColumn_Tree(OCID, -1);
                ForeachPropertyNode(listcolumn, ocsitecolumn, 0, ocsite);
                return(ocsitecolumn.Children);
            }
        }
Ejemplo n.º 3
0
        private static void ForeachPropertyNode(List <OCSiteColumn> ocsitecloumn, OCSiteColumn node, int pid, OCSite ocsite)
        {
            List <OCSiteColumn> dvDict = ocsitecloumn.FindAll(delegate(OCSiteColumn item) { return(item.ParentID == pid); });

            if (dvDict.Count > 0)
            {
                foreach (OCSiteColumn view in dvDict)
                {
                    OCSiteColumn childNodeItem = new OCSiteColumn()
                    {
                        ColumnID    = view.ColumnID,
                        OCID        = view.OCID,
                        UserID      = view.UserID,
                        ParentID    = view.ParentID,
                        Title       = view.Title,
                        Orde        = view.Orde,
                        CreateTime  = view.CreateTime,
                        Updatetime  = view.Updatetime,
                        ContentType = view.ContentType,
                        HasChild    = view.HasChild,
                        Conten      = view.Conten,
                        IsShow      = true
                    };
                    if (pid == 0)
                    {
                        if (childNodeItem.ContentType == 11)
                        {
                            if (ocsite.UseIndexPage)
                            {
                                childNodeItem.IsShow = true;
                            }
                            else
                            {
                                childNodeItem.IsShow = false;
                            }
                        }
                        else if (childNodeItem.ContentType == 13)
                        {
                            if (ocsite.UseResource)
                            {
                                childNodeItem.IsShow = true;
                            }
                            else
                            {
                                childNodeItem.IsShow = false;
                            }
                        }
                        else if (childNodeItem.ContentType == 14)
                        {
                            if (ocsite.UseLive)
                            {
                                childNodeItem.IsShow = true;
                            }
                            else
                            {
                                childNodeItem.IsShow = false;
                            }
                        }
                        else if (childNodeItem.ContentType == 12 || childNodeItem.ContentType == 15)
                        {
                            if (ocsite.UseMoocPlan)
                            {
                                childNodeItem.IsShow = true;
                            }
                            else
                            {
                                childNodeItem.IsShow = false;
                            }
                        }

                        childNodeItem.UseIndexPage = ocsite.UseIndexPage;
                        childNodeItem.UseResource  = ocsite.UseResource;
                        childNodeItem.UseLive      = ocsite.UseLive;
                        childNodeItem.UseMoocPlan  = ocsite.UseMoocPlan;
                    }
                    ForeachPropertyNode(ocsitecloumn, childNodeItem, childNodeItem.ColumnID, ocsite);
                    node.Children.Add(childNodeItem);
                }
            }
        }
Ejemplo n.º 4
0
 public static int OCSiteColumn_ADD(OCSiteColumn column)
 {
     return(1);
 }