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); }
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); }
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"); } }
private void BindBag(long?clientId) { ViewBag.ClientId = clientId; ViewBag.Senders = _senders.GetAll().ToDictionary(x => (long?)x.EntityId, x => x.Name); }