Пример #1
0
        public bool addNewUser(dto tv)
        {
            LinQBaseDataContext context = new LinQBaseDataContext(connection);
            tbl_user            course  = new tbl_user
            {
                name_user = tv.Name,
                user_name = tv.User,
                pass      = tv.Psw,
            };

            context.tbl_users.InsertOnSubmit(course);

            try {
                context.SubmitChanges();
                return(true);
            }
            catch
            {
            }
            return(false);
        }
Пример #2
0
        public bool UpdatePassword(dto tv)
        {
            LinQBaseDataContext context = new LinQBaseDataContext();
            var linq = from person in context.tbl_users
                       where person.user_name == tv.User
                       select person;

            foreach (var user in linq)
            {
                user.pass = tv.Psw;
            }
            try
            {
                context.SubmitChanges();
                return(true);
            }
            catch (Exception)
            {
            }

            return(false);
        }