public ActionResult productadd(ProductDto product)
 {
     var list=new List<ProductDto>();
     list.Add(product);
     _productServiceImp.CreateProducts(list);
     return Alert("添加成功", "/shangpintianjia");
 }
 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");//需要跳转到待付款界面吧?
 }
Exemple #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;
 }