Example #1
0
        public CONTROL ConsultarControl(int idControl)
        {
            CONTROL resultado = new CONTROL();

            try
            {
                using (var model = new Model.conexion())
                {
                    resultado = model.CONTROL.Where(x => x.IDCONTROL == idControl).FirstOrDefault();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Example #2
0
        public List <CONTROL> ConsultarControles(int idCita)
        {
            List <CONTROL> resultado = new List <CONTROL>();

            try
            {
                using (var model = new Model.conexion())
                {
                    resultado = model.CONTROL.Where(x => x.IDCITA == idCita).ToList();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Example #3
0
        public List <CLIENTE> ConsulatrCitas()
        {
            List <CLIENTE> resultado = new List <CLIENTE>();

            try
            {
                using (var model = new Model.conexion())
                {
                    resultado = model.CLIENTE.ToList();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Example #4
0
        public bool RegistrarControl(CONTROL control)
        {
            bool resultado = false;

            try
            {
                using (var model = new Model.conexion())
                {
                    model.CONTROL.Add(control);
                    model.SaveChanges();
                    resultado = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Example #5
0
        public bool RegistrarCita(CLIENTE cliente)
        {
            bool resultado = false;

            try
            {
                using (var model = new Model.conexion())
                {
                    model.CLIENTE.Add(cliente);
                    model.SaveChanges();
                    resultado = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Example #6
0
        public bool EliminarControl(CONTROL control)
        {
            bool resultado = false;

            try
            {
                using (var model = new Model.conexion())
                {
                    var Control = model.CONTROL.Single(o => o.IDCONTROL == control.IDCONTROL);
                    model.CONTROL.Remove(Control);
                    model.SaveChanges();
                    resultado = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(resultado);
        }