Esempio n. 1
0
        protected void nwcPaymentButton_Click(object sender, EventArgs e)
        {
            var amount = int.Parse(nwcPayment.Text);

            UserTableAdapters.UsersTableAdapter uta = new UserTableAdapters.UsersTableAdapter();
            var result     = uta.GetUserById(user.Id);
            var newBalance = result[0].Balance - amount;

            NWCServices.NWCServiceSoapClient nwcsoap = new NWCServices.NWCServiceSoapClient();
            var nwcnewBalance = nwcsoap.GetUserBalance() + amount;

            nwcsoap.updateBalance(user.Id, nwcnewBalance);
            uta.UpdateBalance(newBalance, user.Id);
            user.Balance          = newBalance;
            GV.NwcUser["balance"] = nwcnewBalance;
        }
Esempio n. 2
0
        protected void NWCLogin_Click(object sender, EventArgs e)
        {
            NWCServices.NWCServiceSoapClient nwcsoap = new NWCServices.NWCServiceSoapClient();

            if (nwcsoap.Login(user.Id, user.Password))
            {
                nwcUser["name"]    = nwcsoap.GetUsername();
                nwcUser["id"]      = nwcsoap.GetUserId();
                nwcUser["email"]   = nwcsoap.GetUserEmail();
                nwcUser["balance"] = nwcsoap.GetUserBalance();
                nwcUser["linked"]  = nwcsoap.GetUserLinkedStatus();
                user.Nwc           = true;
                UserTableAdapters.UsersTableAdapter uta = new UserTableAdapters.UsersTableAdapter();
                uta.UpdateNwc(user.Nwc, user.Id);
                GV.NwcUser = nwcUser;
            }
        }