Esempio n. 1
0
        public bool Read()
        {
            Datos.OnTourEntities1 bbdd = new Datos.OnTourEntities1();

            try
            {
                Datos.Contratos con = bbdd.Contratos.First(e => e.rut_rep == rut_rep);
                CommonBC.Syncronize(con, this);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 2
0
        public bool Delete()
        {
            Datos.OnTourEntities1 bbdd = new Datos.OnTourEntities1();

            try
            {
                Datos.Contratos con = bbdd.Contratos.First(e => e.rut_rep == rut_rep);
                bbdd.Contratos.Remove(con);
                bbdd.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 3
0
        public bool Update()
        {
            Datos.OnTourEntities1 bbdd = new Datos.OnTourEntities1();
            try
            {
                Datos.Contratos con = bbdd.Contratos.First(e => e.rut_rep == rut_rep);
                CommonBC.Syncronize(this, con);

                bbdd.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 4
0
        public bool Create()
        {
            Datos.OnTourEntities1 bbdd = new Datos.OnTourEntities1();
            Datos.Contratos       con  = new Datos.Contratos();

            try
            {
                CommonBC.Syncronize(this, con);

                bbdd.Contratos.Add(con);
                bbdd.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

                bbdd.Contratos.Remove(con);
                return(false);
            }
        }