Exemplo n.º 1
0
 public ActionResult productadd(ProductDto product)
 {
     var list=new List<ProductDto>();
     list.Add(product);
     _productServiceImp.CreateProducts(list);
     return Alert("添加成功", "/shangpintianjia");
 }
Exemplo n.º 2
0
 public ActionResult CreateOrders(ProductDto porduct, int? count)
 {
     var currentUser = CurrentOperator;
     var userDto = new UserDto()
     {
         Id = CurrentOperator.UserID.ToString()
     };
     _orderServiceImp.CreateOrderDirect(userDto, porduct, count ?? 0);
     return Alert("下单成功","/zhongzhuan?note=下单成功!立即支付?&url=/lijizhifu");//需要跳转到待付款界面吧?
 }
Exemplo n.º 3
0
 public OrderDto CreateOrderDirect(UserDto userDto, ProductDto productDto, int quantity)
 {
     var user = _userRepository.GetByKey(new Guid(userDto.Id));
     var product=_productRepository.GetByKey(new Guid(productDto.Id));
     if (user!=null)
     {
         var order = _domainService.CreateOrderDirect(user, product,quantity);
         return Mapper.Map<OrderDto>(order);
     }
     return null;
 }