示例#1
0
 public ActionResult Insert(Cliente newModel)
 {
     if (ModelState.IsValid)
     {
         newModel.InsertCliente();
         return RedirectToAction("Index");
     }
     else
     {
         return View(newModel);
     }
 }
示例#2
0
 public ActionResult Edit(Cliente newModel)
 {
     if (ModelState.IsValid)
     {
         newModel.UpdateCliente();
         return RedirectToAction("Index");
     }
     else
     {
         //newModel.listaTiposProducto = Producto.GetListaTiposProducto();
         return View(newModel);
     }
 }
示例#3
0
 //GET: Producto/Insert/
 public ActionResult Insert()
 {
     Cliente newModel = new Cliente();
     return View(newModel);
 }
示例#4
0
 // GET: Cliente/Edit/5
 public ActionResult Edit(int idCliente)
 {
     Cliente newModel = new Cliente(idCliente);
     //newModel.listaTiposProducto = Producto.GetListaTiposProducto();
     return View(newModel);
 }
示例#5
0
 // GET: Cliente/Details/5
 public ActionResult Details(int idCliente)
 {
     Cliente newModel = new Cliente(idCliente);
     return View(newModel);
 }
示例#6
0
 public ActionResult Delete(int idCliente, Cliente newModel)
 {
     Cliente.DeleteCliente(idCliente);
     return RedirectToAction("Index");
 }
示例#7
0
        /// <summary>
        /// Genera la lista de productos de la DB
        /// </summary>
        /// <returns></returns>
        public static List<Cliente> GetListaClientes()
        {
            List<Cliente> listaClientes = new List<Cliente>();
            Data.dsClienteTableAdapters.ClienteTableAdapter Adapter = new Data.dsClienteTableAdapters.ClienteTableAdapter();
            Data.dsCliente.ClienteDataTable dt = Adapter.SelectListaClientes();

            foreach (var dr in dt)
            {
                Cliente item = new Cliente();
                item.idCliente = dr.idCliente;
                if (!dr.IscRepresentanteNull())
                    item.cRepresentante = dr.cRepresentante;
                if (!dr.IscEmpresaNull())
                    item.cEmpresa = dr.cEmpresa;
                if (!dr.IscEmailNull())
                    item.cEmail = dr.cEmail;
                if (!dr.IscTelefonoNull())
                    item.cTelefono = dr.cTelefono;
                if (!dr.IsnDescuentoNull())
                    item.nDescuento = dr.nDescuento;
                if (!dr.IscRNCNull())
                    item.cRNC = dr.cRNC;

                listaClientes.Add(item);
            }

            return listaClientes;
        }
示例#8
0
 //GET: Producto/Insert/
 public ActionResult Insert()
 {
     Cliente newModel = new Cliente();
     //newModel.listaTiposProducto = Producto.GetListaTiposProducto();
     return View(newModel);
 }
示例#9
0
 // GET: Cliente/Delete/5
 public ActionResult Delete(int id)
 {
     Cliente newModel = new Cliente(id);
     return View(newModel);
 }