Exemple #1
0
        public bool Guardar(uFacturaEDatos.T_Apartados apartados)
        {
            bool resultado = false;

            try
            {
                var vFamiliar = from fami in _db.T_Apartados where fami.ApartaID == apartados.ApartaID select fami;
                if (vFamiliar.Count() == 0)
                {
                    _db.T_Apartados.InsertOnSubmit(apartados);
                }

                _db.SubmitChanges();

                resultado = true;
            }
            catch (Exception ex)
            {
                resultado            = false;
                _mensajeErrorSistema = ex.Message;
                GrabarLogError(ex);
                throw new Exception("No fué posible guardar Los dados del socio");
            }

            return(resultado);
        }
Exemple #2
0
        public uFacturaEDatos.T_Apartados ObtenS(uFacturaEDatos.T_Apartados familia)
        {
            try
            {
                var vCliente = from fami in _db.T_Apartados where fami.GrupoID == familia.GrupoID & fami.NoLista == familia.NoLista select fami;

                if (vCliente.Count() > 0)
                {
                    return(vCliente.First());
                }
                else
                {
                    _mensajeErrorUsuario = "El  no existe y no es posible obtener el registro.";
                    return(null);
                }
            }
            catch (Exception ex)
            {
                _mensajeErrorSistema = ex.Message;
                GrabarLogError(ex);
                return(null);
            }
        }