Exemplo n.º 1
0
        public override ReturnDefault <List <User> > ReturnValue(User oParameter)
        {
            ReturnDefault <List <User> > oReturn = new ReturnDefault <List <User> >();

            try
            {
                oReturn.Data       = this.ConvertDataTable(new UsuarioDAO().ReturnValue(oParameter));
                oReturn.ReturnType = Entity.Enums.EnumReturnType.Success;

                return(oReturn);
            }
            catch (Exception e)
            {
                oReturn.Data       = null;
                oReturn.ReturnType = Entity.Enums.EnumReturnType.Error;
                oReturn.Exception  = e;
                oReturn.Message    = e.Message;

                return(oReturn);
            }
        }
Exemplo n.º 2
0
        public override ReturnDefault <int> Insert(User oParameter)
        {
            ReturnDefault <int> oReturn = new ReturnDefault <int>();

            try
            {
                oReturn.Data       = new UsuarioDAO().Insert(oParameter);
                oReturn.ReturnType = Entity.Enums.EnumReturnType.Success;

                return(oReturn);
            }
            catch (Exception e)
            {
                oReturn.Data       = 0;
                oReturn.ReturnType = Entity.Enums.EnumReturnType.Error;
                oReturn.Exception  = e;
                oReturn.Message    = e.Message;

                return(oReturn);
            }
        }