示例#1
0
 public void FunEditArbolAccion(SoftCob_ARBOL_ACCION _datos)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             SoftCob_ARBOL_ACCION _original = _db.SoftCob_ARBOL_ACCION.Where(x => x.CPCE_CODIGO == _datos.CPCE_CODIGO &&
                                                                             x.ARAC_CODIGO == _datos.ARAC_CODIGO).FirstOrDefault();
             _db.SoftCob_ARBOL_ACCION.Attach(_original);
             _original.arac_descripcion = _datos.arac_descripcion;
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        public string FunDelAccion(int _codigo, int _codigocpce)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    SoftCob_ARBOL_ACCION _arbol = _db.SoftCob_ARBOL_ACCION.SingleOrDefault(x => x.CPCE_CODIGO == _codigocpce &&
                                                                                           x.ARAC_CODIGO == _codigo);

                    if (_arbol != null)
                    {
                        _db.Entry(_arbol).State = System.Data.Entity.EntityState.Deleted;
                        _db.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                _mensaje = ex.ToString();
            }
            return(_mensaje = "");
        }