public RoleModel(Role r)
 {
     this.Id = r.RoleId;
     this.Name = r.Name;
     this.Description = r.Description;
     this.Had = false;
 }
     public int AddRoleOutId(string name, string Description)
     {

         using (ChooseDishesEntities entities = new ChooseDishesEntities())
         {
             Role _Role = new Role();
             _Role.Name = name;
             _Role.Description = Description;
             _Role.CreateBy = SubjectUtils.GetAuthenticationId();
             _Role.CreateDateTime = DateTime.Now;
             entities.Role.Add(_Role);
             entities.SaveChanges();
             return _Role.RoleId;
         }

     }
Beispiel #3
0
        public Role CreateRole(RoleBean bean)
        {
            Role beanBack = new Role();
            beanBack.RoleId = bean.RoleId;
            beanBack.Name = bean.Name;
            beanBack.Deleted = bean.Deleted;
            beanBack.Description = bean.Description;
            beanBack.CreateDateTime = bean.CreateDateTime;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.UpdateDatetime = bean.UpdateDatetime;
            beanBack.UpdateBy = bean.UpdateBy;
            return beanBack;

        }
Beispiel #4
0
        public RoleBean CreateRoleBean(Role bean)
        {
            this.RoleId = bean.RoleId;
            this.Name = bean.Name;
            this.Deleted = bean.Deleted;
            this.Description = bean.Description;
            this.CreateDateTime = bean.CreateDateTime;
            this.CreateBy = bean.CreateBy;
            this.UpdateDatetime = bean.UpdateDatetime;
            this.UpdateBy = bean.UpdateBy;
            return this;

        }