Esempio n. 1
0
        protected void JPSSubmit_Click(object sender, EventArgs e)
        {
            JPSService.JPSServiceSoapClient     jpsopap = new JPSService.JPSServiceSoapClient();
            UserTableAdapters.UsersTableAdapter uta     = new UserTableAdapters.UsersTableAdapter();
            var result = uta.GetUserById(jpsidbox.Text);

            if (result[0] == null)
            {
                return;
            }
            if (result[0].Password == jpspassword.Text)
            {
                jpsopap.Register(result[0].Id, result[0].Name, result[0].Email, result[0].Password);
                JPSLogin_Click(sender, e);
            }
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        protected void JPSLogin_Click(object sender, EventArgs e)
        {
            JPSService.JPSServiceSoapClient jpsopap = new JPSService.JPSServiceSoapClient();

            if (jpsopap.Login(user.Id, user.Password))
            {
                jpsUser["name"]    = jpsopap.GetUsername();
                jpsUser["id"]      = jpsopap.GetUserId();
                jpsUser["email"]   = jpsopap.GetUserEmail();
                jpsUser["balance"] = jpsopap.GetUserBalance();
                jpsUser["linked"]  = jpsopap.GetUserLinkedStatus();
                user.Jps           = true;
                UserTableAdapters.UsersTableAdapter uta = new UserTableAdapters.UsersTableAdapter();
                uta.UpdateJps(user.Jps, user.Id);
                GV.JpsUser = jpsUser;
            }
        }
Esempio n. 4
0
        protected void checkBtn_Click(object sender, EventArgs e)
        {
            UserTableAdapters.UsersTableAdapter uta = new UserTableAdapters.UsersTableAdapter();
            var result = uta.GetUserById(IdBox.Text);

            if (result[0] == null)
            {
                return;
            }
            if (result.Rows.Count <= 0)
            {
                return;
            }
            if (result[0].Password == passwordBox.Text)
            {
                NWCServices.NWCServiceSoapClient nwcsoap = new NWCServices.NWCServiceSoapClient();
                JPSService.JPSServiceSoapClient  jpsopap = new JPSService.JPSServiceSoapClient();
                var lbl1 = new Label();
                var lbl2 = new Label();
                if (nwcsoap.Login(result[0].Id, result[0].Password))
                {
                    lbl1.Text      = "NWC Account Linked";
                    lbl1.CssClass += "alert-success p-2";
                }
                else
                {
                    lbl1.Text      = "NWC Account Not Linked";
                    lbl1.CssClass += "alert-danger p-2";
                }

                if (jpsopap.Login(result[0].Id, result[0].Password))
                {
                    lbl2.Text      = "JPS Account Linked";
                    lbl2.CssClass += "alert-success p-2";
                }
                else
                {
                    lbl2.Text      = "JPS Account Not Linked";
                    lbl2.CssClass += "alert-danger p-2";
                }

                statusText.Controls.Add(lbl1);
                statusText.Controls.Add(lbl2);
            }
        }