Ejemplo n.º 1
0
        public static string InsTipoEvento(string Nombre, double Precio, string Descripcion, string UrlFoto, string Clave)
        {
            try
            {
                List <TipoEventoVO> LstTipoEventos = DALTipoEventos.GetListTipoEvento(null);//Se llena lista
                bool Existe = false;

                foreach (TipoEventoVO item in LstTipoEventos)//Recorre lista
                {
                    if (item.Clave == Clave)
                    {
                        Existe = true;
                    }
                }

                if (Existe)
                {
                    return("El tipo de evento ya fue utilizado con anterioridad");
                }
                else
                {
                    DALTipoEventos.InsTipoEvento(Nombre, Precio, Descripcion, UrlFoto, Clave);
                    return("Tipo de evento agregado");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }// del InsertTipoEvento
Ejemplo n.º 2
0
        }// del InsertTipoEvento

        public static string UpdTipoEvento(int idTipoEvento, string Nombre, double Precio, string Descripcion, string UrlFoto, bool Disponibilidad, string Clave)
        {
            try
            {
                List <TipoEventoVO> LstTipoEventos = DALTipoEventos.GetListTipoEvento(null);//Se llena lista
                bool Existe = false;

                foreach (TipoEventoVO item in LstTipoEventos)//Recorre lista
                {
                    if ((item.IdTipoEvento != idTipoEvento) && (item.Clave == Clave))
                    {
                        Existe = true;
                    }
                }

                if (Existe)
                {
                    return("La clave del tipo de evento ya fue utilizada con anterioridad");
                }
                else
                {
                    DALTipoEventos.UpdTipoEvento(idTipoEvento, Nombre, Precio, Descripcion, UrlFoto, Disponibilidad, Clave);
                    //DALCamiones.UpdCamion(idCamion, Matricula, TipoCamion, Modelo, Marca, Capacidad, Kilometraje, Disponibilidad, UrlFoto);
                    return("Tipo Evento actualizado correctamente");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }// del UpdTipoEvento
Ejemplo n.º 3
0
        } //del GetTipoEventoId

        public static List <TipoEventoVO> GetLstTipoEventos(bool?Disponibilidad)
        {
            List <TipoEventoVO> LstTipoEventos = new List <TipoEventoVO>();

            try
            {
                return(DALTipoEventos.GetListTipoEvento(Disponibilidad));
            }
            catch (Exception)
            {
                return(LstTipoEventos);
            }
        } // del GetLstTipoEventos