コード例 #1
0
        public static bool __UpdateType(TipoProcedimentoCcp tipo)
        {
            if (tipo == null)
            {
                return(false);
            }

            try
            {
                SuchDBContext _context = new SuchDBContext();
                _context.Update(tipo);
                //_context.SaveChanges();

                if (tipo.FundamentoLegalTipoProcedimentoCcp != null && tipo.FundamentoLegalTipoProcedimentoCcp.Count > 0)
                {
                    foreach (var f in tipo.FundamentoLegalTipoProcedimentoCcp)
                    {
                        _context.Update(f);
                    }
                }
                _context.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
コード例 #2
0
        public static bool __UpdateReason(FundamentoLegalTipoProcedimentoCcp fundamento)
        {
            if (fundamento == null)
            {
                return(false);
            }

            try
            {
                using (var _context = new SuchDBContext())
                {
                    _context.Update(fundamento);
                    _context.SaveChanges();
                }

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