Beispiel #1
0
        public DeleteProductOut DeleteProduct(DeleteProductIn input)
        {
            DeleteProductOut response = new DeleteProductOut()
            {
                ResponseCode = Entities.Client.General.ResponseCode.Error
            };

            using (IDbConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                DynamicParameters param = new DynamicParameters();

                param.Add("@ProductId", input.ProductId);
                param.Add("@Name", null);
                param.Add("@Quantity", null);
                param.Add("@Price", null);
                param.Add("@Operation", 2);
                param.Add("@RESULT", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);


                var data = connection.Execute("SP_Crud_Product", param, commandType: CommandType.StoredProcedure);

                if (param.Get <int>("@RESULT") == 1)
                {
                    response.ResponseCode = Entities.Client.General.ResponseCode.Success;
                }
            }

            return(response);
        }
        public IHttpActionResult DeleteProduct(DeleteProductIn input)
        {
            var response = Product.DeleteProduct(input);

            return(Ok(response));
        }
Beispiel #3
0
 public DeleteProductOut DeleteProduct(DeleteProductIn input)
 {
     return(productDA.DeleteProduct(input));
 }