コード例 #1
0
        private void btn_member_card_search_Click(object sender, EventArgs e)
        {
            try
            {
                Buisness_Logic.gymMemberRepository gr = new Buisness_Logic.gymMemberRepository();
              //  Buisness_Logic.gymMember gm = new Buisness_Logic.gymMember();
                string nicr = " ";
                gmzzz = gr.search(int.Parse(txt_memCardID.Text), txt_memCard_name.Text, nicr);


                    txt_memCard_name.Text = gmzzz.name;
                txt_memCard_jdate.Text = gmzzz.joinedDate;

                pictureBox_card_photo.SizeMode = PictureBoxSizeMode.StretchImage;

                MemoryStream ms1 = new MemoryStream(gmzzz.photo);
                // ms1.ToArray();
                ms1.Position = 0;

                ms1.Read(gmzzz.photo, 0, gmzzz.photo.Length);
                pictureBox_card_photo.Image = Image.FromStream(ms1);



            }
            catch (Exception dsf)
            {

                throw;
            }
        }
コード例 #2
0
        private void btnM3_update_Click(object sender, EventArgs e)
        {

            if (validateUpdateMember())
            {
                Buisness_Logic.gymMember gm = new Buisness_Logic.gymMember();

                MemoryStream memt1p2 = new MemoryStream();
                pictureBoxM3.Image.Save(memt1p2, System.Drawing.Imaging.ImageFormat.Jpeg);
                byte[] photo_memt2 = memt1p2.ToArray();

                gm.MemberID = int.Parse(txtM3_memID.Text);
                gm.name = txtM3_name.Text;
                gm.nic = txtM3_nic.Text;
                gm.phone = txtM3_phone.Text;

                gm.fatLevel = double.Parse(txtM3_fatLevel.Text);
                gm.addresss = txtmsearch_address.Text;

                gm.gender = cmbM3_gender.SelectedItem.ToString();
                gm.paymentPlan = cmbM3_paymentpaln.SelectedItem.ToString();
                gm.dob = txtm3_dob.Text;
                gm.height = double.Parse(txtM3_height.Text);
                gm.weight = double.Parse(txtM3_weight.Text);
                gm.photo = photo_memt2;
                gm.email = txtmsemail.Text;

                Buisness_Logic.gymMemberRepository grup = new Buisness_Logic.gymMemberRepository();

                if (grup.updateGymMember(gm))
                {
                    MessageBox.Show("Member detail updated.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    datagridm3refresh();
                }
            }
           
        }
コード例 #3
0
        private void btnM2delete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtM3_memID.Text))
            {
                try
                {
                    Buisness_Logic.gymMember gmd = new Buisness_Logic.gymMember();

                    gmd.MemberID = int.Parse(txtM3_memID.Text);

                    Buisness_Logic.gymMemberRepository grd = new Buisness_Logic.gymMemberRepository();

                    if (grd.deleteMemeber(gmd))
                    {
                        MessageBox.Show("Record deleted.", "Information.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        datagridm3refresh();
                    }

                    else
                    {
                        MessageBox.Show("Record delete failed.", "Information.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }


                }
                catch (Exception edel)
                {

                    throw;
                }
            }
            else
            {
                MessageBox.Show("Please enter the member ID to delete a record.", "Information.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        private void btnM3_check_Click(object sender, EventArgs e)
        {

            transporter = checKFeeUI();

        }
コード例 #5
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;
        }
コード例 #6
0
        private void btnM_save_Click(object sender, EventArgs e)
        {
            try
            {

                if (validateAddMember())
                {

                    //initialize image

                    MemoryStream memt1p1 = new MemoryStream();
                    picuturebox_member.Image.Save(memt1p1, System.Drawing.Imaging.ImageFormat.Jpeg);
                    byte[] photo_memt1 = memt1p1.ToArray();

                    //******************************************



                    // create gymMember object 
                    Buisness_Logic.gymMember mem = new Buisness_Logic.gymMember();

                    //*******************************************

                    // set values to gymMember class
                    mem.name = txtM_name.Text;
                    mem.dob = dateTimePickerMem.Value.ToShortDateString();
                    mem.gender = cmbM_gender.SelectedItem.ToString();
                    mem.phone = txtM_phone.Text;
                    mem.addresss = txtM_address.Text;
                    mem.nic = txtM_nic.Text;

                    mem.height = double.Parse(txtM_height.Text);
                    mem.weight = double.Parse(txtM_weight.Text);
                    mem.email = txtM_email.Text;
                    mem.photo = photo_memt1;
                    mem.paymentPlan = cmbM_paymentPlan.SelectedItem.ToString();
                    mem.fatLevel = double.Parse(txtM_fat.Text);

                    //**********************************************






                    Buisness_Logic.gymMemberRepository gr = new Buisness_Logic.gymMemberRepository();


                    if (gr.save(mem))
                    {
                        MessageBox.Show("Success", "Data Insertion", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        txtM_memID.Text = mem.MemberID.ToString();
                        txtM_bmiratio.Text = mem.BMIratio.ToString();
                    }


                }






            }

            catch (Exception exm1)
            {
                MessageBox.Show(exm1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }