Пример #1
0
        public static bool GurdarPlan(PlanesSociales _planes)
        {
            bool exito = false;

            try
            {
                ValidarDatosPlanes(_planes);
                bool PlanExistente = ValidarPlanExistente(_planes);
                if (PlanExistente == true)
                {
                    const string message = "Ya existe un plan registrado con el nokbre ingresado.";
                    const string caption = "Error";
                    var          result  = MessageBox.Show(message, caption,
                                                           MessageBoxButtons.OK,
                                                           MessageBoxIcon.Exclamation);
                    throw new Exception();
                }
                else
                {
                    exito = PlanesDao.InsertPlan(_planes);
                }
            }
            catch (Exception ex)
            {
            }
            return(exito);
        }
Пример #2
0
        public static List <PlanesSociales> ConsultarPlan(PlanesSociales _planes)
        {
            List <PlanesSociales> _listaPlanes = new List <PlanesSociales>();

            try
            {
                _listaPlanes = PlanesDao.ConsultarPlan(_planes);
            }
            catch (Exception ex)
            {
            }
            return(_listaPlanes);
        }
Пример #3
0
        public static bool EliminarPlan(PlanesSociales _planes)
        {
            bool exito = false;

            try
            {
                exito = PlanesDao.BajaPlan(_planes);
            }
            catch (Exception ex)
            {
            }
            return(exito);
        }
Пример #4
0
        public static bool GuardarNuevoValor(PlanesSociales _planes)
        {
            bool exito = false;

            try
            {
                exito = PlanesDao.InsertNuevoValor(_planes);
            }
            catch (Exception ex)
            {
            }
            return(exito);
        }
Пример #5
0
        private static bool ValidarPlanExistente(PlanesSociales _planes)
        {
            bool existe = PlanesDao.ValidarPlanExistente(_planes.Nombre);

            return(existe);
        }