public ActionResult Edit([Bind(Include = "crf_id,cbf_id,car_id")] CuerpoFactura cuerpoFactura)
 {
     if (ModelState.IsValid)
     {
         CuerpoFacturaBLL.Update(cuerpoFactura);
         return(RedirectToAction("Index"));
     }
     ViewBag.cbf_id = new SelectList(CabezaFacturaBLL.List(), "cbf_id", "cbf_id", cuerpoFactura.cbf_id);
     ViewBag.car_id = new SelectList(CarritoBLL.List(), "car_id", "car_tipo", cuerpoFactura.car_id);
     return(View(cuerpoFactura));
 }
 public IHttpActionResult Get()
 {
     try
     {
         List <CabezaFactura> todos = CabezaFacturaBLL.List();
         return(Content(HttpStatusCode.OK, todos));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
        // GET: CuerpoFacturas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CuerpoFactura cuerpoFactura = CuerpoFacturaBLL.Get(id);

            if (cuerpoFactura == null)
            {
                return(HttpNotFound());
            }
            ViewBag.cbf_id = new SelectList(CabezaFacturaBLL.List(), "cbf_id", "cbf_id", cuerpoFactura.cbf_id);
            ViewBag.car_id = new SelectList(CarritoBLL.List(), "car_id", "car_tipo", cuerpoFactura.car_id);
            return(View(cuerpoFactura));
        }
Esempio n. 4
0
 // GET: CabezaFacturas
 public ActionResult Index()
 {
     return(View(CabezaFacturaBLL.List()));
 }
 // GET: CuerpoFacturas/Create
 public ActionResult Create()
 {
     ViewBag.cbf_id = new SelectList(CabezaFacturaBLL.List(), "cbf_id", "cbf_id");
     ViewBag.car_id = new SelectList(CarritoBLL.List(), "car_id", "car_tipo");
     return(View());
 }