Exemplo n.º 1
0
        public void UpdateUser(UserWrapper user)
        {
            UserTableAdapter adapter=new UserTableAdapter();
            adapter.Update(user.UserID, user.FirstName, user.LastName, user.BirthDate, user.Role,
                           user.UserName, user.Password);

            DiciplineTableAdapter da = new DiciplineTableAdapter();

            foreach (var diciplineWrapper in user.Dicipline)
            {
                da.InsertInterest(user.UserID, diciplineWrapper.DiciplineId);
            }

            SubscriptionTableAdapter sa = new SubscriptionTableAdapter();

            foreach (var subWrapper in user.Subscriptions)
            {
                sa.Insert(subWrapper.UnitCode, subWrapper.UserId);
            }
        }
Exemplo n.º 2
0
        public void AddUser(UserWrapper user)
        {
            UserTableAdapter adapter=new UserTableAdapter();
            adapter.Insert(user.FirstName, user.LastName, user.BirthDate, user.Role, user.UserName, user.Password,
                           user.Salt);

            DBDataSet.UserDataTable res = adapter.GetData(user.UserName);

            DiciplineTableAdapter da=new DiciplineTableAdapter();
            foreach (var diciplineWrapper in user.Dicipline)
            {
                da.InsertInterest(res.FirstOrDefault().UserID, diciplineWrapper.DiciplineId);
            }

            SubscriptionTableAdapter sa=new SubscriptionTableAdapter();
            foreach (var subWrapper in user.Subscriptions)
            {
                sa.Insert(subWrapper.UnitCode, subWrapper.UserId);
            }
        }
Exemplo n.º 3
0
        public void AddSubscription(SubscriptionWrapper sub)
        {
            SubscriptionTableAdapter adapter = new SubscriptionTableAdapter();

            adapter.Insert(sub.UnitCode, sub.UserId);
        }