Ejemplo n.º 1
0
        public int login(entidad obj)
        {
            int    n;
            string user, pass;

            user = obj.usuario;
            pass = obj.pasword;
            if (user == "charly")
            {
                if (pass == "paredes")
                {
                    n = 1;
                }
                else
                {
                    n = 2;
                }
            }
            else
            {
                n = 2;
            }

            return(n);
        }
        public void Modify(entidad entidad)
        {
            var unityOfW = _entityRepository.UoW;

            _entityRepository.Modify(entidad);
            unityOfW.Save();
        }
Ejemplo n.º 3
0
        public int login(entidad obj)

        {
            int    n;
            string usuario, contraseña;

            usuario    = obj.usuario;
            contraseña = obj.contraseña;

            if (usuario == "zule")
            {
                if (contraseña == "believe")
                {
                    n = 1;
                }
                else
                {
                    n = 2;
                }
            }
            else
            {
                n = 2;
            }

            return(n);
        }
        public void Remove(entidad entidad)
        {
            var unityOfW = _entityRepository.UoW;

            _entityRepository.Remove(entidad);
            unityOfW.Save();
        }
        /*public EntityService()
         * {
         *  _entityRepository = null;
         * }*/


        public void Add(entidad entidad)
        {
            //Create a transaction context for this operation
            TransactionOptions txSettings = new TransactionOptions()
            {
                Timeout        = TransactionManager.DefaultTimeout,
                IsolationLevel = IsolationLevel.Serializable
            };

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, txSettings))
            {
                var unityOfW = _entityRepository.UoW;
                _entityRepository.Add(entidad);
                unityOfW.Save();
                scope.Complete();
            }
        }
Ejemplo n.º 6
0
        public ActionResult AddConfirmed(EntidadViewModel model, IEntityService entityService)
        {
            var entidad = new entidad()
            {
                Nombre             = model.Name,
                Apellidos          = model.LastName,
                CodId              = model.CodId,
                IdPais             = 1,
                Direccion          = "dkd",
                IdAdminPropiedades = 1,
                UserCreated        = 1,
                DateCreated        = DateTime.Now
            };

            entityService.Add(entidad);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 7
0
        public int login(entidad obj)
        {
            int    n;
            string user, pass;

            user = obj.usuario;
            pass = obj.pasword;
            if (user == "alumno")
            {
                if (pass == "123456")
                {
                    n = 1;
                }
                else
                {
                    n = 2;
                }
            }
            else
            {
                n = 2;
            }
            return(n);
        }
Ejemplo n.º 8
0
        public int login(entidad obj)
        {
            int    n;
            string user, pass;

            user = obj.usuario;
            pass = obj.pasword;
            if (user == "profesor")
            {
                if (pass == "computron")
                {
                    n = 1;
                }
                else
                {
                    n = 2;
                }
            }
            else
            {
                n = 2;
            }
            return(n);
        }
Ejemplo n.º 9
0
 public int N_login(entidad obj)
 {
     return(dts.login(obj));
 }