示例#1
0
        public void NombreRepetido(EntGolden e)
        {
            DatGolden datos = new DatGolden();
            DataTable Dt    = datos.NombreRepetido(e.Nombre);

            if (Dt.Rows.Count > 0)
            {
                throw new ApplicationException(e.Nombre + " ya tiene agendada una cita! ");
            }
        }
示例#2
0
        public void Agregar(EntGolden e)
        {
            DatGolden datos = new DatGolden();
            int       filas = datos.Agregar(e.Nombre, e.Email, e.Telefono);

            if (filas != 1)
            {
                throw new ApplicationException("Error al agregar");
            }
        }
示例#3
0
 public ActionResult Create(EntGolden e)
 {
     try
     {
         BusGolden bus = new BusGolden();
         bus.NombreRepetido(e);
         bus.Agregar(e);
         TempData["msj"] = "Tu cita esta confirmada " + e.Nombre;
         return(View("Index"));
     }
     catch (Exception ex)
     {
         TempData["error"] = ex.Message;
         return(View("Index"));
     }
 }