Example #1
0
        public virtual PartialViewResult EditByClient(long?clientId)
        {
            ViewData.TemplateInfo.HtmlFieldPrefix = "Transit";

            ViewBag.Cities = _cities.All(_identity.Language).ToDictionary(x => x.Id, x => x.Name);

            return(!clientId.HasValue
                                ? PartialView()
                                : GetEditPartialView(() => _transits.GetByClient(clientId.Value)));
        }
Example #2
0
        private void Add(ApplicationEditData application, long clientId, long senderId)
        {
            var transit = _transits.GetByClient(clientId);

            transit.Id = 0;
            var transitId = _transits.Add(transit);

            application.TransitId   = transitId;
            application.ForwarderId = _forwarders.GetByCityOrAny(transit.CityId, null);
            application.Class       = null;
            application.SenderId    = senderId;
            application.ClientId    = clientId;

            _editor.Add(application);
        }