Пример #1
0
        public string ShoppingPays(ShoppingPay shoppingPays)
        {
            string codOperation = string.Empty;

            using (SqlConnection db = new SqlConnection(conn))
            {
                try
                {
                    var parameters = new DynamicParameters();
                    parameters.Add("@Id_Trolley", shoppingPays.Id_Trolley);
                    parameters.Add("@Id_User", shoppingPays.Id_User);
                    parameters.Add("@Id_State", shoppingPays.Id_State);
                    parameters.Add("@Id_Method_Pay", shoppingPays.Id_Method_Pay);
                    parameters.Add("@AddressClient", shoppingPays.AddressClient);
                    parameters.Add("@Telephone", shoppingPays.Telephone);
                    parameters.Add("@Neighborhood", shoppingPays.Neighborhood);
                    db.Open();
                    db.Execute("SavePaysShopping", parameters, commandType: CommandType.StoredProcedure);

                    return(codOperation = "accept");
                }
                catch (Exception ex)
                {
                    codOperation = "cancel" + ex.ToString();
                    throw;
                }
            }
        }
        public void Post([FromBody] ShoppingPay shoppingPays)
        {
            string             result     = string.Empty;
            ShoppingRepository repository = new ShoppingRepository();

            result = repository.ShoppingPays(shoppingPays);
        }