Пример #1
0
        public ActionResult CreateVetura(VeturaCreate vetura)
        {
            if (ModelState.IsValid)
            {
                DAL_Vetura.AddVetura(vetura);
            }

            return(RedirectToAction("Index", "Brendis"));
        }
Пример #2
0
        public static void AddVetura(VeturaCreate vetura)
        {
            using (SqlConnection con = new SqlConnection(ConnectionWithDB.GetConnection()))
            {
                SqlCommand cmd = new SqlCommand("usp_AddVetura", con);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                con.Open();

                cmd.Parameters.AddWithValue("@BrendiID", vetura.BrendiID);
                cmd.Parameters.AddWithValue("@Emri", vetura.Emri);

                cmd.ExecuteNonQuery();
            }
        }