public CreateOrderOut CreateOrder(CreateOrderIn input) { CreateOrderOut response = new CreateOrderOut() { ResponseCode = Entities.Client.General.ResponseCode.Error }; using (IDbConnection connection = new SqlConnection(connectionString)) { connection.Open(); DynamicParameters param = new DynamicParameters(); param.Add("@OrderId", input.order.OrderId); param.Add("@ClientId", input.order.ClientId); param.Add("@Total", input.order.Total); param.Add("@Operation", 1); param.Add("@RESULT", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue); var data = connection.Execute("SP_Crud_Order", param, commandType: CommandType.StoredProcedure); if (param.Get <int>("@RESULT") > 0) { response.ResponseCode = Entities.Client.General.ResponseCode.Success; response.OrderId = param.Get <int>("@RESULT"); } } return(response); }
public IHttpActionResult CreateOrder(CreateOrderIn input) { var response = client.CreateOrder(input); return(Ok(response)); }
public CreateOrderOut CreateOrder(CreateOrderIn input) { return(orderDA.CreateOrder(input)); }