protected void Widthdrawl_Click(object sender, EventArgs e) { UserTableAdapters.UsersTableAdapter utp = new UserTableAdapters.UsersTableAdapter(); var result = utp.GetUserById(user.Id); var newBalance = result[0].Balance - int.Parse(WithdrawlBox.Text); utp.UpdateBalance(newBalance, user.Id); user.Balance = newBalance; Response.Redirect("Default.aspx"); }
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; }
protected void jpsPaymentButton_Click(object sender, EventArgs e) { var amount = int.Parse(jpsPayment.Text); UserTableAdapters.UsersTableAdapter uta = new UserTableAdapters.UsersTableAdapter(); var result = uta.GetUserById(user.Id); var newBalance = result[0].Balance - amount; JPSService.JPSServiceSoapClient jpsopap = new JPSService.JPSServiceSoapClient(); var jpsnewBalance = jpsopap.GetUserBalance() + amount; jpsopap.updateBalance(user.Id, jpsnewBalance); uta.UpdateBalance(newBalance, user.Id); user.Balance = newBalance; GV.JpsUser["balance"] = jpsnewBalance; }