Ejemplo n.º 1
0
        public ActionResult FirstStorageProcedure(Procedure1_AddCP proc, TContract_product v)
        {
            if (ModelState.IsValid)
            {
                using (var context = new EFDbContext())
                {
                    string   Name_customer       = proc.CustomerName;
                    string   Name_company        = proc.CompanyName;
                    int      KolProduct          = proc.Kolvo_Products;
                    float    PriceProduct        = proc.Price_Product;
                    DateTime DateDeliveryProduct = proc.Date_delivery_product;


                    var data = context.Database.ExecuteSqlCommand(" EXEC [dbo].[Add_Inf_in_the_Contract_Product] @Name_customer, @Name_company, @KolProduct," +
                                                                  "@PriceProduct, @DateDeliveryProduct",

                                                                  new SqlParameter("Name_customer", Name_customer),
                                                                  new SqlParameter("Name_company", Name_company),
                                                                  new SqlParameter("KolProduct", KolProduct),
                                                                  new SqlParameter("PriceProduct", PriceProduct),
                                                                  new SqlParameter("DateDeliveryProduct", DateDeliveryProduct));
                    return(RedirectToAction("Rez1StopP"));
                }
            }
            else
            {
                // Что-то не так со значениями данных
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult FirstStorageProcedure()
        {
            Procedure1_AddCP v = new Procedure1_AddCP();

            v.TypeOfCustomers = from var in repository.Customers select var.Name_Customer;
            v.TypeOfCompanies = from var in repository.Companies select var.Name_C;
            return(View(v));
        }