Esempio n. 1
0
 public ActionResult AddEditCliente(AddEditClienteViewModel objViewModel)
 {
     if (!sessionOpen())
     {
         return(RedirectToAction("Login"));
     }
     if (ModelState.IsValid)
     {
         try
         {
             ClienteBusiness clienteDAO = new ClienteBusiness();
             clienteDAO.AddEditCliente(objViewModel.ClienteId, objViewModel.Apellido, objViewModel.Nombre, objViewModel.Dni, objViewModel.Sexo, objViewModel.Edad, objViewModel.Nivelestudios, objViewModel.Telefono);
             ViewBag.Success = "Cliente Agregado con Exito";
             ModelState.Clear();
             return(View(objViewModel));
         }
         catch (Exception)
         {
             Console.Write("Error");
             return(View(objViewModel));
         }
     }
     else
     {
         return(View(objViewModel));
     }
 }
Esempio n. 2
0
        public ActionResult AddEditCliente(int?ClienteId)
        {
            if (!sessionOpen())
            {
                return(RedirectToAction("Login"));
            }
            AddEditClienteViewModel objViewModel = new AddEditClienteViewModel();

            objViewModel.Fill(ClienteId);
            return(View(objViewModel));
        }