Exemplo n.º 1
0
        public bool Delete()
        {
            try
            {
                DALC.Region region = Common.ModeloEntidad.Region.First(f => f.Region_ID == this.Region_ID);

                Common.ModeloEntidad.Region.Remove(region);
                Common.ModeloEntidad.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool Read()
        {
            try
            {
                DALC.Region region = Common.ModeloEntidad.Region.First(f => f.Region_ID == this.Region_ID);

                this.Region_ID = region.Region_ID;
                this.Nombre    = region.Nombre;

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public bool Update()
        {
            try
            {
                DALC.Region region = Common.ModeloEntidad.Region.First(f => f.Region_ID == this.Region_ID);

                region.Region_ID = this.Region_ID;
                region.Nombre    = this.Nombre;

                Common.ModeloEntidad.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public bool Create()
        {
            try
            {
                DALC.Region region = new DALC.Region();
                region.Region_ID = this.Region_ID;
                region.Nombre    = this.Nombre;

                Common.ModeloEntidad.Region.Add(region);
                Common.ModeloEntidad.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                Common.ModeloEntidad.Region.Local.Clear();
                return(false);
            }
        }