Ejemplo n.º 1
0
        private void MemberAccount_Load(object sender, EventArgs e)
        {
            // Populate form labels and call getmemberbalance to populate transaction grid
            lbl_id.Text            = member.id.ToString();
            lbl_lastName.Text      = member.lastName;
            lbl_firstName.Text     = member.firstName;
            lbl_adusername.Text    = member.ad_username;
            lbl_contactemail.Text  = member.contact_email;
            lbl_paypalemail.Text   = member.paypal_email;
            lbl_paymentamount.Text = member.paymentAmount.ToString();
            lbl_phone.Text         = member.phoneNumber;
            lbl_phone2.Text        = member.businessNumber;

            try
            {
                var service = (GetMemberBalanceResponse)DenhacService.GetMemberBalanceService(member.id);
                if (service.transactionStatus)
                {
                    lbl_balance.Text            = service.balance.ToString();
                    bs_memberaccount.DataSource = service.rows;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
Ejemplo n.º 2
0
        private void btn_import_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you really, really, REALLY sure??", "Confirmation", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                try
                {
                    var service = (ImportPaypalDataResponse)DenhacService.ImportPaypalDataService(txt_filecontents.Text);
                    if (service.transactionStatus)
                    {
                        btn_import.Enabled            = false;
                        lbl_numPayments.Text          = service.numPayments.ToString();
                        lbl_numUnappliedPayments.Text = service.numUnapplied.ToString() + "<---******Enter into Member DB manually ******";
                        lbl_totalDues.Text            = service.totalDues.ToString();
                        lbl_paypalfees.Text           = service.totalFees.ToString() + " <--- ****** Enter into WaveApps manually ******";

                        Clipboard.SetText(service.response);

                        MessageBox.Show(service.response, "This text has been copied to the clipboard");
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
            }
        }
Ejemplo n.º 3
0
 private void txt_search_TextChanged(object sender, EventArgs e)
 {
     if (txt_search.Text.Length >= 2)
     {
         try
         {
             var service = (SearchMemberResponse)DenhacService.SearchMemberService(txt_search.Text);
             if (service.transactionStatus)
             {
                 bs_searchMemberResponse.DataSource = service.rows;
                 if (service.rows.Count == 0)
                 {
                     ClearSearchResults();
                 }
             }
         }
         catch (Exception exception)
         {
             MessageBox.Show(exception.ToString());
             ClearSearchResults();
         }
     }
     else
     {
         ClearSearchResults();
     }
 }
Ejemplo n.º 4
0
        private void MultiplePayments_Load(object sender, EventArgs e)
        {
            try
            {
                var service = (OpenBalanceResponse)DenhacService.GetOpenBalanceService();
                if (service.transactionStatus)
                {
                    bs_openBalanceResponse.DataSource = service.rows;

                    // Default to selecting the first row
                    if (service.rows.Count > 0)
                    {
                        member = (DenhacClientAPI.ResponseObjects.Member)dgv_openBalances.Rows[0].DataBoundItem;
                        btn_viewAccount.Enabled = true;
                    }
                    else
                    {
                        btn_viewAccount.Enabled = false;
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
Ejemplo n.º 5
0
 private void MultiplePayments_Load(object sender, EventArgs e)
 {
     try
     {
         var service = (OpenBalanceResponse)DenhacService.GetOpenBalanceService();
         if (service.transactionStatus)
         {
             bs_openBalanceResponse.DataSource = service.rows;
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
Ejemplo n.º 6
0
 private void PaymentEntry_Load(object sender, EventArgs e)
 {
     try
     {
         var service = (GetPaymentTypesResponse)DenhacService.GetPaymentTypesService();
         if (service.transactionStatus)
         {
             bs_paymentTypesResponse.DataSource = service.rows;
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
Ejemplo n.º 7
0
 private void btn_logout_Click(object sender, EventArgs e)
 {
     try
     {
         var service = DenhacService.LogoutService();
         if (service.transactionStatus)
         {
             this.EnableLoginOptions();
         }
         else
         {
             MessageBox.Show("Failed to log out for whatever weird reason. Details:\n" + service.errorMsg);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
Ejemplo n.º 8
0
        private void btn_submit_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                try
                {
                    var paymentTypeId = ((PaymentType)cb_paymentType.SelectedItem).id;

                    var service = (CreatePaymentResponse)DenhacService.CreatePaymentService(memberIdForPayment, Convert.ToDouble(txt_amount.Text), paymentTypeId, txt_memoNotes.Text);
                    if (service.transactionStatus)
                    {
                        MessageBox.Show("Payment Created!");
                        ClearForm();
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
            }
        }
Ejemplo n.º 9
0
        private void btn_testConnection_Click(object sender, EventArgs e)
        {
            DenhacService.hostName = txt_server.Text;
            DenhacService.userName = txt_username.Text;
            DenhacService.password = txt_password.Text;

            try {
                var service = DenhacService.LoginService();
                if (service.transactionStatus)
                {
                    MessageBox.Show("Login SUCCESS");
                    this.DisableLoginOptions();
                }
                else
                {
                    MessageBox.Show("Ruh-roh, you failed to login! Details:\n" + service.errorMsg);
                    this.EnableLoginOptions();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
Ejemplo n.º 10
0
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         if (mode == MemberMode.Create)
         {
             var service = (CreateMemberResponse)DenhacService.CreateMemberService(this.txt_lastname.Text,
                                                                                   this.txt_mi.Text,
                                                                                   this.txt_firstname.Text,
                                                                                   this.dt_birthdate.Value.Date,
                                                                                   this.txt_streetaddr.Text,
                                                                                   this.txt_city.Text,
                                                                                   this.txt_zipcode.Text,
                                                                                   this.txt_communicationemail.Text,
                                                                                   this.txt_paypalemail.Text,
                                                                                   this.txt_phone.Text,
                                                                                   this.txt_businessphone.Text,
                                                                                   this.txt_emercontact1.Text,
                                                                                   this.txt_emerphone1.Text,
                                                                                   this.txt_emeraddr1.Text,
                                                                                   this.txt_emerrelation1.Text,
                                                                                   this.txt_emercontact2.Text,
                                                                                   this.txt_emerphone2.Text,
                                                                                   this.txt_emeraddr2.Text,
                                                                                   this.txt_emerrelation2.Text,
                                                                                   this.txt_paymentamt.Text,
                                                                                   this.dt_joindate.Value.Date,
                                                                                   this.txt_proxcardid.Text,
                                                                                   this.txt_medicalproblems.Text,
                                                                                   this.txt_adusername.Text);
             if (service.transactionStatus)
             {
                 MessageBox.Show("New Member Created!");
                 this.Close();
             }
             else
             {
                 MessageBox.Show(service.errorMsg);
             }
         }
         else if (mode == MemberMode.Update)
         {
             var service = (EditMemberResponse)DenhacService.EditMemberService(this.lbl_memberid.Text,
                                                                               this.txt_lastname.Text,
                                                                               this.txt_mi.Text,
                                                                               this.txt_firstname.Text,
                                                                               this.dt_birthdate.Value.Date,
                                                                               this.txt_streetaddr.Text,
                                                                               this.txt_city.Text,
                                                                               this.txt_zipcode.Text,
                                                                               this.txt_communicationemail.Text,
                                                                               this.txt_paypalemail.Text,
                                                                               this.txt_phone.Text,
                                                                               this.txt_businessphone.Text,
                                                                               this.txt_emercontact1.Text,
                                                                               this.txt_emerphone1.Text,
                                                                               this.txt_emeraddr1.Text,
                                                                               this.txt_emerrelation1.Text,
                                                                               this.txt_emercontact2.Text,
                                                                               this.txt_emerphone2.Text,
                                                                               this.txt_emeraddr2.Text,
                                                                               this.txt_emerrelation2.Text,
                                                                               this.txt_paymentamt.Text,
                                                                               this.dt_joindate.Value.Date,
                                                                               this.txt_proxcardid.Text,
                                                                               this.txt_medicalproblems.Text,
                                                                               this.txt_adusername.Text);
             if (service.transactionStatus)
             {
                 MessageBox.Show("Member Data Saved Successfully!");
                 this.Close();
             }
             else
             {
                 MessageBox.Show(service.errorMsg);
             }
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }