Esempio n. 1
0
 // GET: Buildings
 public ActionResult Index()
 {
     using (MaterialsEntities MDB = new MaterialsEntities())
     {
         return(View(MDB.Buildings.ToList()));
     }
 }
        // GET: Customers/Create
        public ActionResult Create()
        {
            Customers CustList = new Customers();

            using (MaterialsEntities MELS = new MaterialsEntities())
            {
                CustList.BuildingsCol = MELS.Buildings.ToList <Buildings>();
            }
            return(View(CustList));
        }
        // GET: PartNumbers/Create
        public ActionResult Create()
        {
            PartNumbers PartNList = new PartNumbers();

            using (MaterialsEntities MELS = new MaterialsEntities())
            {
                PartNList.CustomersCol = MELS.Customers.ToList <Customers>();
            }
            return(View(PartNList));
        }
Esempio n. 4
0
        public ActionResult Create(Buildings DataBuilding)
        {
            try
            {
                using (MaterialsEntities MEDB = new MaterialsEntities())
                {
                    MEDB.InsertBuildings(DataBuilding.Building, DataBuilding.Available);
                    MEDB.SaveChanges();
                }

                return(RedirectToAction("/Home/Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(Customers DataCustomers)
        {
            try
            {
                using (MaterialsEntities MEDB = new MaterialsEntities())
                {
                    MEDB.InsertCustomers(DataCustomers.Customer, DataCustomers.Prefix,
                                         DataCustomers.FKBuilding, DataCustomers.Available);
                    MEDB.SaveChanges();
                }

                return(RedirectToAction("/Home/Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(PartNumbers DataPartNumbers)
        {
            try
            {
                using (MaterialsEntities MEDB = new MaterialsEntities())
                {
                    MEDB.InsertPartNumber(DataPartNumbers.PartNumber, DataPartNumbers.FKCustomer,
                                          DataPartNumbers.Available);
                    MEDB.SaveChanges();
                }

                return(RedirectToAction("/Home/Index"));
            }
            catch
            {
                return(View());
            }
        }
        // GET: Consulta
        public ActionResult Index(String partNumber, String Customer)
        {
            using (MaterialsEntities MDB = new MaterialsEntities())

                return(View(MDB.consultaP(partNumber, Customer).ToList()));
        }