public void Save(UserGroupVeiwModel userGroupVeiwModel)
 {
     UserGroup usergroup = new UserGroup(userGroupVeiwModel.Id)
     {
         Name = userGroupVeiwModel.Name,
         Descripition = userGroupVeiwModel.Description,
        
     };
     _userGroupRepository.Save(usergroup);
 }
        private UserGroupVeiwModel Map(UserGroup userGroup)
        {
            UserGroupVeiwModel vm = new UserGroupVeiwModel
                                        {
                                            Description=userGroup.Descripition,
                                            Id=userGroup.Id,
                                            Name=userGroup.Name,
                                            IsActive = userGroup._Status == EntityStatus.Active ? true : false
                                        };
            return vm;

        }
예제 #3
0
 public UserGroupDTO Map(UserGroup group)
 {
     if (group == null) return null;
     return Mapper.Map<UserGroup, UserGroupDTO>(group);
 }
예제 #4
0
        //public static TargetPeriod Map (this tblTargetPeriod targetPeriod)
        //    {
        //    TargetPeriod period=new TargetPeriod(targetPeriod.Id )
        //    {
        //    Name=targetPeriod.Name ,
        //    StartDate=targetPeriod.StartDate,
        //    EndDate=targetPeriod.EndDate,
        //    };
        //    period._SetDateCreated(targetPeriod.IM_DateCreated );
        //    period._SetDateLastUpdated(targetPeriod.IM_DateLastUpdated );
        //    period._SetStatus(targetPeriod.IM_Status );

        //    return period;
        //}

        public static UserGroup Map(this tblUserGroup tblusergroup)
        {
            if (tblusergroup == null)
                return null;

            UserGroup usergroup = new UserGroup(tblusergroup.Id)
            {
                Descripition = tblusergroup.Description,
                Name = tblusergroup.Name,
            };
            usergroup._SetStatus((EntityStatus)tblusergroup.IM_Status);
            usergroup._SetDateCreated(tblusergroup.IM_DateCreated);
            usergroup._SetDateLastUpdated(tblusergroup.IM_DateLastUpdated);
            return usergroup;
        }
예제 #5
0
 protected Guid AddUserGroup(string name)
 {
     UserGroup dg = new UserGroup(Guid.NewGuid())
     {
         Name = name,
         Descripition = "Administrator"
     };
     Guid id = _userGroupRepository.Save(dg);
     return id;
 }