Exemple #1
0
 public MeetingDtb(IDbContext context, UserBus userBus, MeetingBus meetingBus, AttachmentBus attachmentBus)
     : base(context)
 {
     _userBus = userBus;
     _meetingBus = meetingBus;
     _attachmentBus = attachmentBus;
 }
Exemple #2
0
        private static void Main(string[] args)
        {
            using (var db = new EfContext())
            {
                var roleBus = new RoleBus(db);
                var meetingBus = new MeetingBus(db);
                var userBus = new UserBus(db);

                //var permissions = new List<Permissions>
                //{
                //    Permissions.CreateMeeting,
                //    Permissions.UploadDocument
                //};
                //roleBus.Create(new Role
                //{
                //    Name = "Admin",
                //    Description = "Admin",
                //    IsActivated = true,
                //    PermissionList = permissions
                //});

                //userBus.Create(new User
                //{
                //    FullName = "Phạm Quang",
                //    Account = "quangp",
                //    Password = "******",
                //    RoleId = 2
                //});

                var meeting = new Meeting
                {
                    Name = "Quang",
                    Message = "Quang",
                    StartDate = DateTime.Now,
                    EndDate = DateTime.Now.AddDays(1),
                    UserCreatedId = 3,
                };
                //meetingBus.Create(meeting);
                //var u = userBus.Get(3);
                var m = meetingBus.Get(3);
                meetingBus.AddUsers(3, new List<int> { 3 });
            }

            Console.ReadKey();
        }