Example #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;
            }
        }
Example #2
0
        private void btnGw_search_Click(object sender, EventArgs e)
        {
            try
            {
                Buisness_Logic.gymMemberRepository gr = new Buisness_Logic.gymMemberRepository();

                int    regNo = string.IsNullOrWhiteSpace(txtgetW_memID.Text) ? 0 : int.Parse(txtgetW_memID.Text);
                string name  = "";
                string nic   = txtgetW_nic.Text;
                var    gm    = gr.search(regNo, name, nic);
                txtgetW_memID.Text  = gm.MemberID.ToString();
                txtgetW_nic.Text    = gm.nic;
                txtgetW_weight.Text = gm.weight.ToString();
                txtgetW_bmi.Text    = gm.BMIratio.ToString();
                txtgetW_fat.Text    = gm.fatLevel.ToString();
                txtgetW_height.Text = gm.height.ToString();
                //txtgetW_shedule.Text =
            }
            catch (Exception fd)
            {
                throw;
            }
        }
Example #3
0
        private void btnM3_Search_Click(object sender, EventArgs e)
        {

            try
            {
                // Buisness_Logic.validation val3 = new Buisness_Logic.validation();


                if (validate_search())
                {

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

                    var gm = gr_search.search((string.IsNullOrEmpty(txtM3_memID.Text) ? 0 : int.Parse(txtM3_memID.Text)), txtM3_name.Text.ToString(), txtM3_nic.Text.ToString());


                    if (gm.MemberID == 0)
                    {
                        clearMSearch();
                    }
                    else
                    {
                        txtM3_memID.Text = gm.MemberID.ToString();
                        txtM3_name.Text = gm.name;
                        txtM3_nic.Text = gm.nic;
                        txtM3_phone.Text = gm.phone.ToString();
                        //  txt.Text = gm.joinedDate;
                        txtM3_fatLevel.Text = gm.fatLevel.ToString();
                        //MemoryStream ms = new MemoryStream(gm.photo);
                        //pictureBoxM3.Image = Image.FromStream(ms);
                        cmbM3_gender.SelectedItem = gm.gender;
                        cmbM3_paymentpaln.SelectedItem = gm.paymentPlan;
                        txtm3_dob.Text = gm.dob;
                        txtM3_height.Text = gm.height.ToString();
                        txtM3_weight.Text = gm.weight.ToString();
                        txtM3_bmi.Text = gm.BMIratio.ToString();
                        txtmsemail.Text = gm.email;
                        txtmsearch_address.Text = gm.addresss;

                        pictureBoxM3.SizeMode = PictureBoxSizeMode.StretchImage;

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

                        ms1.Read(gm.photo, 0, gm.photo.Length);
                        pictureBoxM3.Image = Image.FromStream(ms1);
                    }


                }







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