public DomainEntityUser FindUserForLogin(string username, string password)
        {
            DbEntityUser dbEntity = DaoLogin.FindByUsernamePassword(username, password);

            return((dbEntity == null)
                ? null
                : dbEntity.DbEntityToDomainEntity());
        }
        public static void Update(int id, DbEntityUser dbEntityUser)
        {
            string columnsAndValues =
                $"Dni='{dbEntityUser.Dni}',Name='{dbEntityUser.Name}',Lastname='{dbEntityUser.Lastname}'," +
                $"BirthDate='{dbEntityUser.BirthDate}',Address='{dbEntityUser.Address}',PhoneNumber='{dbEntityUser.PhoneNumber}'," +
                $"Email='{dbEntityUser.Email}',Username='******',Password='******',UpdatedBy='{dbEntityUser.UpdatedBy}'";

            SqlCommandUpdate <DbEntityUser> .Execute(dbEntityUser, tableName, id, columnsAndValues);
        }
        public static void Create(DbEntityUser dbEntityUser)
        {
            string columns = "Dni,Name,Lastname,BirthDate,Address,PhoneNumber,Email,Username,Password,CreatedBy";
            string values  = $"'{dbEntityUser.Dni}','{dbEntityUser.Name}','{dbEntityUser.Lastname}'," +
                             $"'{dbEntityUser.BirthDate}','{dbEntityUser.Address}','{dbEntityUser.PhoneNumber}'," +
                             $"'{dbEntityUser.Email}','{dbEntityUser.Username}','{dbEntityUser.Password}','{dbEntityUser.CreatedBy}'";

            SqlCommandInsert <DbEntityUser> .Execute(dbEntityUser, tableName, columns, values);
        }
Ejemplo n.º 4
0
        public void Update(int id, DomainEntityUser domainEntity)
        {
            DbEntityUser dbEntity = DbEntityUser.DomainEntityToDbEntity(domainEntity);

            DaoUser.Update(id, dbEntity);
        }
Ejemplo n.º 5
0
        public void Create(DomainEntityUser domainEntity)
        {
            DbEntityUser dbEntity = DbEntityUser.DomainEntityToDbEntity(domainEntity);

            DaoUser.Create(dbEntity);
        }