Exemple #1
0
 private void txt_regMonileNo_Leave(object sender, EventArgs e)
 {
     if (txt_regMonileNo.Text != "")
     {
         EPC_mobile.SetError(txt_regMonileNo, "correct");
         EPW_mobile.Clear();
     }
     else if (txt_regMonileNo.Text == "")
     {
         EPW_mobile.SetError(txt_regMonileNo, "Cannot keep mobile no blank");
         EPC_mobile.Clear();
     }
 }
Exemple #2
0
        private void btn_IDPrint_Click(object sender, EventArgs e)
        {
            EPC_regid.Clear();
            EPW_regid.Clear();
            EPC_regfee.Clear();
            EPW_regfee.Clear();
            EPC_mobile.Clear();
            EPW_mobile.Clear();
            EPC_address.Clear();
            EPW_Address.Clear();
            EP_niccorrect.Clear();
            EP_nicworng.Clear();
            NameEPcorrect.Clear();
            NameEPwrong.Clear();
            pnl_Mmcard.BringToFront();

            pnl_Mmcard.Show();
        }
Exemple #3
0
 private void Btn_PrintBill_Click(object sender, EventArgs e)
 {
     EPC_regid.Clear();
     EPW_regid.Clear();
     EPC_regfee.Clear();
     EPW_regfee.Clear();
     EPC_mobile.Clear();
     EPW_mobile.Clear();
     EPC_address.Clear();
     EPW_Address.Clear();
     EP_niccorrect.Clear();
     EP_nicworng.Clear();
     NameEPcorrect.Clear();
     NameEPwrong.Clear();
     pnl_mem_reg.Hide();
     pnl_Mmcard.Hide();
     pnl_PrintBill.Show();
 }
Exemple #4
0
        private void btn_Register_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_regID.Text != "" && txt_regfname.Text != "" && txt_regNIC.Text != "" && txt_regAddress.Text != "" && txt_regMonileNo.Text != "" && txt_regFee.Text != "")
                {
                    string Reg_ID  = txt_regID.Text;
                    string Name    = txt_regfname.Text;
                    string NIC     = txt_regNIC.Text;
                    string Address = txt_regAddress.Text;
                    string Mobile  = txt_regMonileNo.Text;
                    string Reg_Fee = txt_regFee.Text;

                    StringBuilder name = new StringBuilder();
                    foreach (Control cont in this.grp_Enents.Controls)
                    {
                        if (cont is CheckBox)
                        {
                            if (((CheckBox)cont).Checked == true)
                            {
                                name.Append(((CheckBox)cont).Text.ToString() + ",");
                            }
                        }
                    }

                    if (rad_regMonthly.Checked)
                    {
                        Package = "Monthly";
                    }
                    if (rad_regOneYear.Checked)
                    {
                        Package = "One Year";
                    }
                    if (rad_regsixMonth.Checked)
                    {
                        Package = "Six Month";
                    }

                    SqlConnection con = obj.connect();

                    string insertquery = "insert into RegMembers(Reg_ID,Name,NIC,Address,Mobile,Birthday,Reg_Date,Reg_Fee,Package,Events) values('" + Reg_ID + "','" + Name + "','" + NIC + "','" + Address + "','" + Mobile + "',convert(datetime,'" + dtp_regBitthDay.Text + "',101),convert(datetime,'" + dtp_regDate.Text + "',101),'" + Reg_Fee + "','" + Package + "','" + name + "')";

                    SqlCommand cmb = new SqlCommand(insertquery, con);
                    con.Open();
                    cmb.ExecuteNonQuery();
                    MessageBox.Show("Successfully Registered ");
                    con.Close();
                }

                else
                {
                    MessageBox.Show("Please complete the form");
                }

                txt_regAddress.Text  = "";
                txt_regFee.Text      = "";
                txt_regfname.Text    = "";
                txt_regID.Text       = "";
                txt_regMonileNo.Text = "";
                txt_regNIC.Text      = "";

                rad_regMonthly.Checked   = false;
                rad_regOneYear.Checked   = false;
                rad_regsixMonth.Checked  = false;
                chk_regBadminton.Checked = false;
                chk_regBiliard.Checked   = false;
                chk_regGym.Checked       = false;
                chk_regSwimm.Checked     = false;
                chk_regTennis.Checked    = false;
                EPC_regid.Clear();
                EPW_regid.Clear();
                EPC_regfee.Clear();
                EPW_regfee.Clear();
                EPC_mobile.Clear();
                EPW_mobile.Clear();
                EPC_address.Clear();
                EPW_Address.Clear();
                EP_niccorrect.Clear();
                EP_nicworng.Clear();
                NameEPcorrect.Clear();
                NameEPwrong.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }