예제 #1
0
        private void BindBag(long?awbId)
        {
            ViewBag.AwbId = awbId;

            ViewBag.Brokers = _brokers.GetAll().ToDictionary(x => (long?)x.Id, x => x.Name);
            ViewBag.Senders = _senders.GetAll().ToDictionary(x => (long?)x.UserId, x => x.Name);
        }
예제 #2
0
        private void BindBag(long?applicationId, ClientData client)
        {
            ViewBag.ClientNic = client.Nic;

            ViewBag.ClientId = client.ClientId;

            ViewBag.ApplicationId = applicationId;

            if (applicationId.HasValue)
            {
                var data = _applications.Get(applicationId.Value);

                ViewBag.ApplicationNumber = data.DisplayNumber;
            }

            ViewBag.Countries = _countries.All(_identity.Language).ToDictionary(x => x.Id, x => x.Name);

            ViewBag.Senders = _senders.GetAll().OrderBy(x => x.Name).ToDictionary(x => (long?)x.EntityId, x => x.Name);

            ViewBag.Forwarders = _forwarders.GetAll().OrderBy(x => x.Name).ToDictionary(x => (long?)x.Id, x => x.Name);

            ViewBag.Carriers = _carriers.GetAll().OrderBy(x => x.Name).ToDictionary(x => (long?)x.Id, x => x.Name);
        }
예제 #3
0
        public UserListItem[] List(RoleType role)
        {
            switch (role)
            {
            case RoleType.Manager:
                return(_managers.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.EntityId,
                    UserId = x.UserId
                }).ToArray());

            case RoleType.Admin:
                return(_admins.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.EntityId,
                    UserId = x.UserId
                }).ToArray());

            case RoleType.Broker:
                return(_brokers.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.Id,
                    UserId = x.UserId
                }).ToArray());

            case RoleType.Forwarder:
                return(_forwarders.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.Id,
                    UserId = x.UserId
                }).ToArray());

            case RoleType.Carrier:
                return(_carriers.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.Id,
                    UserId = x.UserId
                }).ToArray());

            case RoleType.Sender:
                return(_senders.GetAll().Select(
                           x => new UserListItem
                {
                    Name = x.Name,
                    EntityId = x.EntityId,
                    UserId = x.UserId
                }).ToArray());

            default:
                throw new ArgumentOutOfRangeException("role");
            }
        }
예제 #4
0
 private void BindBag(long?clientId)
 {
     ViewBag.ClientId = clientId;
     ViewBag.Senders  = _senders.GetAll().ToDictionary(x => (long?)x.EntityId, x => x.Name);
 }