public HttpResponseMessage PlaceOrder(PlaceOrderEntity PlaceOrderObj) { try { var result = _CartServices.PlaceOrder(PlaceOrderObj); if (result != null) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Something wrong! Please try again later.")); } catch (Exception ex) { throw; } }
public int?PlaceOrder(PlaceOrderEntity placeOrderObj) { SqlParameter[] sqlParameter = new SqlParameter[] { new SqlParameter("store_id", placeOrderObj.store_id) , new SqlParameter("customer_id", placeOrderObj.customer_id) , new SqlParameter("shipping_addressId", placeOrderObj.shipping_addressId) , new SqlParameter("ip", placeOrderObj.IpAddress != null? placeOrderObj.IpAddress:(object)DBNull.Value) , new SqlParameter("Comment", placeOrderObj.Comment != null?placeOrderObj.Comment:(object)DBNull.Value) , new SqlParameter("CartGroupId", placeOrderObj.CartGroupId) }; var result = objGenericRepository.ExecuteSQL <int>("PlaceOrderAfterConfirmation", sqlParameter).FirstOrDefault(); SendInvoiceMailToCustomer(result); return(result); }