예제 #1
0
        public bool Delete()
        {
            try
            {
                Modelo.AREA us = CommonBC.ModeloWfbs.AREA.First(b => b.ID_AREA == this.id_area);
                us.OBSOLETA = 1;

                CommonBC.ModeloWfbs.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
예제 #2
0
        public bool Update()
        {
            try
            {
                Modelo.AREA us = CommonBC.ModeloWfbs.AREA.First(b => b.ID_AREA == this.id_area);
                us.NOMBRE      = this.area;
                us.ID_AREA     = this.id_area;
                us.ABREVIACION = this.abreviacion;
                us.OBSOLETA    = this.obsoleta;

                CommonBC.ModeloWfbs.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
예제 #3
0
        public bool Read()
        {
            try
            {
                Modelo.AREA area = CommonBC.ModeloWfbs.AREA.First(b => b.ID_AREA == this.id_area);

                this.id_area     = Convert.ToInt32(area.ID_AREA);
                this.area        = area.NOMBRE;
                this.abreviacion = area.ABREVIACION;
                this.obsoleta    = Convert.ToInt32(area.OBSOLETA);

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }