Example #1
0
        public void SetIngredient(Set_Ingredients ingredient)
        {
            string sqlexpression = "ingredients_insert";

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                SqlCommand command = new SqlCommand(sqlexpression, connection);
                command.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter IngredientIdParam = new SqlParameter
                {
                    ParameterName = "@id",
                    Value         = ingredient.Id
                };
                command.Parameters.Add(IngredientIdParam);

                SqlParameter IngredientNameParam = new SqlParameter
                {
                    ParameterName = "@ingredient",
                    Value         = ingredient.Ingredient
                };
                command.Parameters.Add(IngredientNameParam);

                SqlParameter InfoParam = new SqlParameter
                {
                    ParameterName = "@info",
                    Value         = ingredient.Info
                };
                command.Parameters.Add(InfoParam);

                try
                {
                    command.ExecuteNonQuery();
                }
                catch
                {
                }
            }
        }
Example #2
0
 public void SetIngredient(Set_Ingredients ingredient)
 {
     dal.SetIngredient(ingredient);
 }
Example #3
0
 public ActionResult SetIngredient(Set_Ingredients ingredient)
 {
     bis_log.SetIngredient(ingredient);
     return(RedirectToAction("GetIngredietns"));
 }
Example #4
0
        public ActionResult SetIngredient()
        {
            Set_Ingredients ingredient = new Set_Ingredients();

            return(View(ingredient));
        }