Ejemplo n.º 1
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;
        }