示例#1
0
        public long Add(TransitEditModel transit, long?forsedCarrierId)
        {
            var data = new TransitData();

            TransitMapper.Map(transit, data, GetCarrier(forsedCarrierId, transit.CityId, null));

            var transitId = _transits.Add(data);

            return(transitId);
        }
示例#2
0
 public static void Map(TransitEditModel @from, TransitData to, long carrierId)
 {
     to.Address              = @from.Address;
     to.CarrierId            = carrierId;
     to.WarehouseWorkingTime = @from.WarehouseWorkingTime;
     to.CityId          = @from.CityId;
     to.DeliveryType    = @from.DeliveryType;
     to.MethodOfTransit = @from.MethodOfTransit;
     to.Phone           = @from.Phone;
     to.RecipientName   = @from.RecipientName;
 }
示例#3
0
 public static TransitEditModel Map(TransitData data)
 {
     return(new TransitEditModel
     {
         Address = data.Address,
         WarehouseWorkingTime = data.WarehouseWorkingTime,
         CityId = data.CityId,
         DeliveryType = data.DeliveryType,
         MethodOfTransit = data.MethodOfTransit,
         Phone = data.Phone,
         RecipientName = data.RecipientName
     });
 }
示例#4
0
        public long Add(TransitData transit)
        {
            if (transit.Id > 0)
            {
                throw new InvalidDataException("Id should be undefined");
            }

            return(_executor.Query <long>("[dbo].[Transit_Add]", new
            {
                transit.Address,
                transit.Phone,
                transit.CarrierId,
                transit.CityId,
                transit.DeliveryType,
                transit.MethodOfTransit,
                transit.RecipientName,
                transit.WarehouseWorkingTime
            }));
        }
示例#5
0
 public void Update(TransitData transit)
 {
     _executor.Execute("[dbo].[Transit_Update]", transit);
 }