private void metroTile1_Click(object sender, EventArgs e) { if (txt_amount_full_pay.Text == "") { MessageBox.Show("Please confirm amount paying", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails (Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark) VALUES('" + txt_course_fee_for_full_payament.Text.Remove(txt_course_fee_for_full_payament.Text.Length - 2, 2) + "','" + txt_discout_for_full_payment.Text + "','" + txt_amount_full_pay.Text.Remove(txt_amount_full_pay.Text.Length - 2, 2) + "','" + DateTime.Today.ToShortDateString() + "','" + DateTime.Now.ToLongTimeString() + "','" + studno + "','None','Full payement for diploma course')"); d.update("UPDATE Dip_stud_modules SET payement_no='" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails") + "' WHERE stud_no='" + studno + "' "); MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(0, 72653).ToString(); if (a1 == DialogResult.Yes) { } else { } } } }
private void metroTile5_Click(object sender, EventArgs e) { if (txt_reg_fee_paying.Text.Any(char.IsLetter) == true || txt_reg_fee_paying.Text == "" || Convert.ToDouble(txt_reg_fee_of_course.Text.Remove(txt_reg_fee_of_course.Text.Length - 2, 2)) < Convert.ToDouble(txt_reg_fee_paying.Text)) { MessageBox.Show("Please enter valid registration fee", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails (Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark) VALUES('" + txt_reg_fee_of_course.Text.Remove(txt_reg_fee_of_course.Text.Length - 2, 2) + "','0','" + txt_reg_fee_paying.Text + "','" + General_methods.get_current_date() + "','" + General_methods.get_current_time().ToString() + "','" + txt_studno.Text + "','None','Registration fee for diploma course')"); d.update("UPDATE Stud_details SET reg_fee='" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails").ToString() + "' WHERE stud_no='" + txt_studno.Text + "'"); MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(0, 2837872).ToString(); if (a1 == DialogResult.Yes) { } else { } } } }
private void metroGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (e.ColumnIndex == 7 && e.RowIndex >= 0) { DialogResult dc = MessageBox.Show("Are you sure you want to terminate payment?", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dc == DialogResult.Yes) { d.update("UPDATE Short_program_participation SET payment_no=Null WHERE payment_no='" + metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString() + "'"); d.delete("DELETE FROM PaymentDetails WHERE Payment_No='" + metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString() + "'"); MessageBox.Show("Succefully terminated payment", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); label1.Text = General_methods.Generate_RandomNumber(0, 99999).ToString(); } else { } } else if (e.ColumnIndex == 9 && e.RowIndex >= 0) { show_studs.pay_no = metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString(); show_studs s = new show_studs(); s.Show(); } }
private void metroGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (e.ColumnIndex == 7 && e.RowIndex >= 0) { DialogResult dc = MessageBox.Show("Are you sure you want to terminate payment?", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dc == DialogResult.Yes) { if (metroGrid1.Rows[e.RowIndex].Cells[6].Value.ToString() == "Course fee for Certificate course") { d.delete("DELETE FROM PaymentDetails WHERE Payment_No='" + Convert.ToInt32(metroGrid1.Rows[e.RowIndex].Cells[0].Value) + "'"); } else if (metroGrid1.Rows[e.RowIndex].Cells[6].Value.ToString() == "Registration fee for Certificate course") { d.update("UPDATE Stud_details SET reg_fee=NULL WHERE stud_no='" + txt_studno.Text + "'"); d.delete("DELETE FROM PaymentDetails WHERE Payment_No='" + Convert.ToInt32(metroGrid1.Rows[e.RowIndex].Cells[0].Value) + "'"); } MessageBox.Show("Succefully terminated payment", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); label1.Text = General_methods.Generate_RandomNumber(0, 99999).ToString(); } else { } } }
private void metroTile1_Click(object sender, EventArgs e) { string remark = "Payament for short programs / workshops (Company) -" + txt_remark.Text; if (txt_netamount.Text == "") { MessageBox.Show("Please calculate the final amount", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txt_amount.Text == "") { MessageBox.Show("Participants have not been selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.Text == "") { MessageBox.Show("Please select payment method", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.SelectedIndex == 2 && txt_chequeno.Text == "") { MessageBox.Show("Please enter the cheque number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails(Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark,Payment_mode) VALUES ('" + txt_amount.Text.Remove(txt_amount.Text.Length - 2, 2).ToString() + "','" + txt_discount.Text + "','" + txt_netamount.Text.Remove(txt_netamount.Text.Length - 2, 2).ToString() + "','" + General_methods.get_current_date() + "','" + General_methods.get_current_time() + "','" + General_methods.find_organization_no_from_organization_name(cmb_companies.Text) + "','" + txt_progno.Text + "','" + remark + "','" + cmb_payment_mode.Text + "')"); int id = d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails"); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.CheckedItems.Contains(checkedListBox1.Items[i]) == true && a.Contains(i) == false) { d.update("UPDATE Short_program_participation SET payment_no='" + id + "' WHERE ref_no='" + checkedListBox1.Items[i].ToString().Split('-').GetValue(1) + "'"); } else { } } if (cmb_payment_mode.SelectedIndex == 2) { d.insert("INSERT INTO Cheque_payments (Payment_no,Cheque_no) VALUES ('" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails") + "','" + txt_chequeno.Text + "')"); } MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(1, 678767).ToString(); ////////////// if (a1 == DialogResult.Yes) { } else { } } else { } } }
private void metroTile4_Click(object sender, EventArgs e) { string remark = "Payament for short programs / workshops (Individual) -" + txt_remark_individual.Text; if (txt_amount_payable_individual.Text == "") { MessageBox.Show("Please select participant", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txt_amount_paying_individual.Text == "") { MessageBox.Show("Please enter amount paying", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txt_discount_individual.Text == "") { MessageBox.Show("Please enter discount", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txt_netamount_individual.Text == "") { MessageBox.Show("Final amount not calculated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode2.Text == "") { MessageBox.Show("Please select payment method", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode2.SelectedIndex == 2 && txt_cheque_no2.Text == "") { MessageBox.Show("Please enter the cheque number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails(Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark) VALUES ('" + txt_amount_paying_individual.Text.ToString() + "','" + txt_discount.Text + "','" + txt_netamount_individual.Text.Remove(txt_netamount_individual.Text.Length - 2, 2).ToString() + "','" + General_methods.get_current_date() + "','" + General_methods.get_current_time() + "','" + cmb_individual_participants.Text.Split('-').GetValue(0).ToString() + "','" + txt_progno.Text + "','" + remark + "')"); int id = d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails"); d.update("UPDATE Short_program_participation SET payment_no='" + id + "' WHERE ref_no='" + cmb_individual_participants.Text.Split('-').GetValue(0).ToString() + "'"); if (cmb_payment_mode2.SelectedIndex == 2) { d.insert("INSERT INTO Cheque_payments (Payment_no,Cheque_no) VALUES ('" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails") + "','" + txt_cheque_no2.Text + "')"); } MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(1, 678767).ToString(); ////////////// if (a1 == DialogResult.Yes) { } else { } } else { } } }
private void metroTile4_Click(object sender, EventArgs e) { if (txt_mosule_wise_amount_after_discount.Text == "") { MessageBox.Show("Please calculate the final amount", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txt_amount_paying_module_wise.Text == "") { MessageBox.Show("Paying amounts for modules have not been confirmed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.Text == "") { MessageBox.Show("Please select payment method", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.SelectedIndex == 2 && txt_chequeno.Text == "") { MessageBox.Show("Please enter the cheque number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails(Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark,Payment_mode) VALUES ('" + txt_amount_paying_module_wise.Text.Remove(txt_amount_paying_module_wise.Text.Length - 2, 2).ToString() + "','" + txt_mod_wise_discount.Text + "','" + txt_mosule_wise_amount_after_discount.Text.Remove(txt_mosule_wise_amount_after_discount.Text.Length - 2, 2).ToString() + "','" + General_methods.get_current_date() + "','" + General_methods.get_current_time() + "','" + txt_studno.Text + "','None','Module wise Payement for Diploma course','" + cmb_payment_mode.Text + "')"); int id = d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails"); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.CheckedItems.Contains(checkedListBox1.Items[i]) == true && a.Contains(i) == false) { d.update("UPDATE Dip_stud_modules SET payement_no='" + id + "' WHERE stud_no='" + txt_studno.Text + "' AND module_no='" + General_methods.get_module_no_from_module_name(checkedListBox1.Items[i].ToString(), General_methods.get_course_no_from_course_name(txt_course_name.Text)) + "'"); } else { } } if (cmb_payment_mode.SelectedIndex == 2) { d.insert("INSERT INTO Cheque_payments (Payment_no,Cheque_no) VALUES ('" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails") + "','" + txt_chequeno.Text + "')"); } MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(1, 678767).ToString(); ////////////// if (a1 == DialogResult.Yes) { } else { } } else { } } }
private void metroTile1_Click(object sender, EventArgs e) { if (txt_name.Text == "") { MessageBox.Show(this, "Please enter participants name", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txt_email.Text == "") { MessageBox.Show(this, "Please enter participants email", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txt_phoneno.MaskCompleted == false) { MessageBox.Show(this, "Please enter participants phone no", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (cmb_desigs.Text == "") { MessageBox.Show(this, "Please enter participants phone no", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (General_methods.Quick_NIC_Validation(txt_NIC.Text) == "Invalid") { MessageBox.Show(this, "Please enter valid NIC", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (cmb_org.Text == "") { MessageBox.Show(this, "Please select Organization of participant", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txt_destrict.Text == "") { MessageBox.Show(this, "Please select Address of participant", "Missing Field", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { DialogResult d2 = MessageBox.Show("Update details?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (d2 == DialogResult.Yes) { Database d = new Database(); d.update("UPDATE Short_program_participation SET address='" + txt_destrict.Text + "',designation='" + cmb_desigs.Text + "',Email='" + txt_email.Text + "',Name='" + txt_name.Text + "',NIC='" + txt_NIC.Text + "',Organization_id='" + General_methods.find_organization_no_from_organization_name(cmb_org.Text) + "',phone_no='" + txt_phoneno.Text + "' WHERE ref_no='" + lbl_no.Text + "'"); MessageBox.Show("Details Updated Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); label1.Text = General_methods.Generate_RandomNumber(3, 678).ToString(); Close(); } } }
private void metroTile2_Click(object sender, EventArgs e) { if (txt_amount_paying.Text == "") { MessageBox.Show("Please confirm amount paying", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.Text == "") { MessageBox.Show("Please select payment method", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (cmb_payment_mode.SelectedIndex == 2 && txt_chequeno.Text == "") { MessageBox.Show("Please enter the cheque number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("You are about to save a payment. Press yes to confirm", "Notification", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { d.insert("INSERT INTO PaymentDetails (Gross_amount,Discount_percent,Net_amount,Date,Time,stud_no_org_no,program_no,Remark) VALUES('" + txt_amount_paying.Text + "','" + txt_discount.Text + "','" + txt_final_amount.Text.Remove(txt_final_amount.Text.Length - 2, 2) + "','" + DateTime.Today.ToShortDateString() + "','" + DateTime.Now.ToLongTimeString() + "','" + studno + "','None','Course fee for Certificate course')"); if (cmb_payment_mode.SelectedIndex == 2) { d.insert("INSERT INTO Cheque_payments (Payment_no,Cheque_no) VALUES ('" + d.singleInt("SELECT MAX(Payment_No) FROM PaymentDetails") + "','" + txt_chequeno.Text + "')"); } MessageBox.Show("Details Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult a1 = MessageBox.Show("Generate Recipt?", "Notofication", MessageBoxButtons.OK, MessageBoxIcon.Information); //this label is used for event firing label1.Text = General_methods.Generate_RandomNumber(0, 72653).ToString(); if (a1 == DialogResult.Yes) { } else { } } } }