Exemplo n.º 1
0
        private void btnMF_addfee_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtMF_memID.Text))
            {
                MessageBox.Show("Please search payment details of a member first.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Buisness_Logic.fee fee1 = new Buisness_Logic.fee();

                fee1.paymentPlan = txtMF_payPlan.Text;
                // fee1.LastPaid_amount = double.Parse(txtMFnewpayemnt.Text);
                fee1.service = "Gym";
                fee1.lastVPaymentDate = txtMF_lastValidDate.Text;
                fee1.memberID = int.Parse(txtMF_memID.Text);





                Buisness_Logic.feeRepository fr = new Buisness_Logic.feeRepository();
                if (fr.addFee(fee1, transporter))
                {
                    txtMFnewpayemnt.Text = fee1.newAmount.ToString();
                    txtPaidDate.Text = fee1.paidDate;
                    txtPaidTIme.Text = fee1.paidTime;
                    txtPaymentValidfor.Text = fee1.PaymentvalidDate;



                    MessageBox.Show("Payment Updated", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 2
0
        private void btnmfCalcPayment_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtMF_memID.Text) || string.IsNullOrWhiteSpace(txtmfNIC.Text))
            {
                MessageBox.Show("Please search payment details of a member first.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Buisness_Logic.fee fee2 = new Buisness_Logic.fee();

                fee2.service          = txtfservice.Text;
                fee2.lastVPaymentDate = txtMF_lastValidDate.Text;
                fee2.memberID         = int.Parse(txtMF_memID.Text);

                Buisness_Logic.feeRepository fr = new Buisness_Logic.feeRepository();
                // fr.paymentCalculation(fee2, transporter);


                txtMFnewpayemnt.Text    = fee2.newAmount.ToString();
                txtPaymentValidfor.Text = fee2.PaymentvalidDate;
            }
        }
Exemplo n.º 3
0
        private Buisness_Logic.gymMember checKFeeUI()
        {
            Buisness_Logic.gymMember gmf = new Buisness_Logic.gymMember();
            try
            {
                if (validateFeedatils())
                {


                    Buisness_Logic.feeRepository frfee = new Buisness_Logic.feeRepository();
                    gmf.MemberID = (string.IsNullOrEmpty(txtMF_memID.Text) ? 0 : int.Parse(txtMF_memID.Text));
                    gmf.nic = txtmfNIC.Text.ToString();
                    gmf.name = txtMFee_name.Text.ToString();


                    bool req1 = frfee.searchMemberDerailsFor_fee(gmf);




                    Buisness_Logic.fee ft = new Buisness_Logic.fee();

                    ft.memberID = gmf.MemberID;
                    //gmf.MemberID = int.Parse(txtMF_memID.Text);
                    //gmf.nic = txtmfNIC.Text;
                    //gmf.name = txtMFee_name.Text;





                    bool req2 = frfee.checkPaymentDetails(ft);
                    if (gmf.MemberID == 0)
                    {
                        clearFee();
                    }
                    else
                    {
                        txtMF_memID.Text = gmf.MemberID.ToString();
                        txtMFee_name.Text = gmf.name;
                        txtmfNIC.Text = gmf.nic;
                        txtMF_payPlan.Text = gmf.paymentPlan;

                    }
                    txtMF_lastValidDate.Text = ft.lastVPaymentDate;
                    txtlstPaidDate.Text = ft.lastPaidDate;
                    txtLastpaidtime.Text = ft.lastPaidTime;
                    txtMF_amount.Text = ft.LastPaid_amount.ToString();
                    txtfservice.Text = ft.service;
                    if (req1 == true && req2 == true)
                    {
                        MessageBox.Show("payment record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else if (req1 == true && req2 == false)
                    {

                        txtMF_amount.Text = "";
                        txtMF_lastValidDate.Text = "";
                        txtfservice.Text = "";
                        txtlstPaidDate.Text = "";
                        txtLastpaidtime.Text = "";
                        MessageBox.Show("Member information found. But no payment record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    }
                    else
                    {
                        MessageBox.Show("No memeber information found by that Member ID", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                        clearFee();

                    }

                }





            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
            return gmf;
        }