예제 #1
0
        // GET: Shippers/Delete/5
        public ActionResult Delete(int id)
        {
            ShippersNegocio shippersNegocio = new ShippersNegocio();
            Shippers        shipper         = shippersNegocio.GetOne(id);

            return(View(shipper));
        }
예제 #2
0
        // GET: Shippers
        public ActionResult Index()
        {
            ShippersNegocio shippersNegocio = new ShippersNegocio();
            List <Shippers> shippers        = shippersNegocio.GetShippers();

            return(View(shippers));
        }
예제 #3
0
 static void Main(string[] args)
 {
     ShippersNegocio shippersNegocio = new ShippersNegocio();
     List<Shippers> shippers = shippersNegocio.GetShippers();
     foreach (Shippers shipper in shippers)
     {
         Console.WriteLine(shipper.CompanyName);
     }
     Console.ReadKey();
 }
예제 #4
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         ShippersNegocio shippersNegocio = new ShippersNegocio();
         shippersNegocio.DeleteShipper(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #5
0
 public ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         ShippersNegocio shippersNegocio = new ShippersNegocio();
         Shippers        shipper         = shippersNegocio.GetOne(id);
         shipper.CompanyName = collection["CompanyName"];
         shipper.Phone       = collection["Phone"];
         shippersNegocio.EditarShipper(shipper);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #6
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         Shippers shipper = new Shippers();
         shipper.CompanyName = collection["CompanyName"];
         shipper.Phone       = collection["Phone"];
         ShippersNegocio shippersNegocio = new ShippersNegocio();
         shippersNegocio.AddShipper(shipper);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }