Beispiel #1
0
        public static List <Cotizaciones> GetList(Expression <Func <Cotizaciones, bool> > filter)
        {
            List <Cotizaciones> Lista = null;

            try
            {
                ContextoCot dbase = new ContextoCot();
                Lista = dbase.Co.Where(filter).ToList();
            }
            catch (Exception)
            {
                throw;
            }
            return(Lista);
        }
Beispiel #2
0
        public static Cotizaciones Buscar(int Id)
        {
            Cotizaciones cotizacion = new Cotizaciones();

            try
            {
                ContextoCot dbase = new ContextoCot();
                cotizacion = dbase.Co.Find(Id);
            }
            catch (Exception)
            {
                throw;
            }

            return(cotizacion);
        }
Beispiel #3
0
        public static bool Modificar(Cotizaciones Co)
        {
            bool paso = false;

            try
            {
                ContextoCot dbase = new ContextoCot();

                dbase.Entry(Co).State = EntityState.Modified;
                dbase.SaveChanges();
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }
Beispiel #4
0
        public static bool Guardar(Cotizaciones Co)
        {
            bool paso = false;

            try
            {
                ContextoCot dbase = new ContextoCot();

                dbase.Co.Add(Co);
                dbase.SaveChanges();
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }
Beispiel #5
0
        public static bool Eliminar(int Id)
        {
            bool paso = false;

            try
            {
                ContextoCot  dbase = new ContextoCot();
                Cotizaciones Cot   = dbase.Co.Find(Id);

                dbase.Co.Remove(Cot);
                dbase.SaveChanges();
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }