Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
C#
MenuItem mnItem;
            var menuObjects = (from m in context.MenuObjects
                               join r in context.UserRights on m.ID equals r.MenuObjectID
                               where m.ParentMenuObjectID == parentID && r.RoleID == roleID &&
                               (r.HasDelete == true || r.HasEdit == true || r.HasFullControl == true || r.HasNew == true || r.HasView == true)
                               orderby m.DisplayOrder
                               select m).Distinct();


C#
public  class Right
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column("ID", TypeName = "int")]
        public Int32 ID { get; set; }

        [Column("Role_ID", TypeName="int")]
        public Int32 RoleID { get; set; }

        [Column("Menu_Object_ID", TypeName = "int")]
        public Int32 MenuObjectID { get; set; }

        [Column("Is_New", TypeName = "bit")]
        [Display(Name = "Is New")]
        public Boolean HasNew { get; set; }

        [Column("Is_View", TypeName = "bit")]
        [Display(Name = "Is View")]
        public Boolean HasView { get; set; }

        [Column("Is_Edit", TypeName = "bit")]
        [Display(Name = "Is Edit")]
        public Boolean HasEdit { get; set; }

        [Column("Is_Delete", TypeName = "bit")]
        [Display(Name = "Is Delete")]
        public Boolean HasDelete { get; set; }

        [Column("Is_Full", TypeName = "bit")]
        [Display(Name = "Is Full")]
        public Boolean HasFullControl { get; set; }

        [Column("Created_On")]
        public DateTime CreatedOn { get; set; }

        [Column("Created_By",  TypeName="int")]
        public Int32 CreatedBy { get; set; }

        [Column("Modified_On")]
        public DateTime? ModifiedOn { get; set; }

        [Column("Modified_By", TypeName = "int")]
        public Int32? ModifiedBy { get; set; }

        [ForeignKey("MenuObjectID")]
        public virtual MenuObject MenuObject { get; set; }

        [ForeignKey("RoleID")]
        public virtual UserRole Role { get; set; }

    }
Posted
Updated 25-May-14 6:40am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900