private void txt_regAddress_Leave(object sender, EventArgs e) { if (txt_regAddress.Text != "") { EPC_address.SetError(txt_regAddress, "correct"); EPW_Address.Clear(); } else if (txt_regAddress.Text == "") { EPW_Address.SetError(txt_regAddress, "Cannot keep Address blank"); EPC_address.Clear(); } }
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(); }
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(); }
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); } }