private void btnPrintAll_Click(object sender, EventArgs e) { try { new PrompteForm().ShowDialog(); if (PrompteForm.Year != "") { DataSet ds = Class_Fees.usp_PrintAllFees(PrompteForm.Year); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("لا توجد أي بيانات لهذه السنة", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { this.Cursor = Cursors.WaitCursor; RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); RPT.AllFees cr = new RPT.AllFees(); cr.SetDataSource(ds); cr.SetParameterValue("Year", PrompteForm.Year); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } } } catch (Exception) { this.Cursor = Cursors.Default; //throw; } }
private void btnDelete_Click(object sender, EventArgs e) { try { if (dataGridView1.SelectedRows.Count == 0) { MessageBox.Show("عليك أن تحدد الفاتورة المرادة أولا", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { DialogResult dr = MessageBox.Show("هل تريد حقا حذف هذه الفاتورة", "إشعار", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { Class_Fees.usp_tblFeesDelete(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString())); MessageBox.Show("تم الحذف بنجاح", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadData(); } } } catch (Exception) { MessageBox.Show("حدث خلل أثناء الحذف", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click(object sender, EventArgs e) { try { new Form_studentManagment("Fees").ShowDialog(); txtNum.Text = Form_studentManagment.ID; txtName.Text = Form_studentManagment.SName; txtYear.Text = Form_studentManagment.Year; txtMonthlyPrice.Text = Form_studentManagment.MonthlyPrice; txtInscPrice.Text = Form_studentManagment.InscriptionPrice; txtFiliere.Text = Form_studentManagment.Filiers; txtClass.Text = Form_studentManagment.Classe; if (txtMonthlyPrice.Text != "" && txtInscPrice.Text != "") { DataTable dt = Class_Fees.usp_getmylatDue(txtNum.Text); txtM.Text = dt.Rows[0][0].ToString(); M = decimal.Parse(txtM.Text); GetFeeType(); } } catch (Exception) { //throw; } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { if (comboBox1.Text == "رسوم التسجيل والتأمين") { price = decimal.Parse(txtInscPrice.Text); listView1.Items.Clear(); txtDiscount.Text = 0.ToString(); } else { price = decimal.Parse(txtMonthlyPrice.Text); decimal discount = Class_Fees.usp_getMyDiscoutn(txtNum.Text); if (discount == null) { txtDiscount.Text = 0.ToString(); } else { txtDiscount.Text = discount.ToString(); price -= discount; GetOtherFees(); } } txtTotal.Text = (price + M).ToString(); } catch (Exception EX) { // } }
private void btnSearchByClass_Click(object sender, EventArgs e) { if (cmbClass.Text != "") { DataTable dt = Class_Fees.usp_SelectFeesByClass(Convert.ToInt32(cmbClass.SelectedValue)); dataGridView1.DataSource = dt; } }
public void GetFeeType() { DataTable dt = Class_Fees.usp_tblFeetypeSelect(); comboBox1.DisplayMember = "label"; comboBox1.ValueMember = "idfeesType"; comboBox1.DataSource = dt; }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != "") { DataTable dt = Class_Fees.usp_SelectFeesByName(textBox1.Text); dataGridView1.DataSource = dt; } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string year = dataGridView1.SelectedRows[0].Cells[4].Value.ToString(); string num = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); DataTable dt = Class_Fees.usp_getMu(year, num); txtTotal.Text = dt.Rows[0][0].ToString(); txtREst.Text = dt.Rows[0][1].ToString(); }
private void btnSearch_Click(object sender, EventArgs e) { try { DataTable dt = Class_Fees.usp_GetNombreOfFees(txtYear.Text, Convert.ToInt32(cmbFiliere.SelectedValue)); dataGridView1.DataSource = dt; txtNombreRecu.Text = dt.Rows.Count.ToString(); } catch (Exception ex) { //throw; } }
private void btnSearchID_Click(object sender, EventArgs e) { int result; if (int.TryParse(txtSearchID.Text, out result)) { DataTable dt = Class_Fees.usp_SelectFeesById(result); dataGridView1.DataSource = dt; } else { MessageBox.Show("أدخل رقم الوصل بشكل صحيح", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnSearchByDate_Click_1(object sender, EventArgs e) { try { DataTable dt = Class_Fees.usp_GetFeesByDate(dateTimePicker1.Value.Date); dataGridView1.DataSource = dt; txtNombreRecu.Text = dt.Rows.Count.ToString(); decimal daily = 0.00M; foreach (DataRow dr in dt.Rows) { daily += Convert.ToDecimal(dr[6]); } txtDaily.Text = daily.ToString(); } catch (Exception ex) { // throw; } }
private void btnSave_Click(object sender, EventArgs e) { if (decimal.Parse(txtPaid.Text) <= 0) { MessageBox.Show("لا ينبغي للمبلغ المدفوع أن يكون صفراً"); return; } if (decimal.Parse(txtRest.Text) < 0) { MessageBox.Show("المبلغ المتبقي أصغر من صفر، تأكد مما أدخلته", "رسالة إشعارية", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } try { DataTable dtPaimentDetail = new DataTable(); dtPaimentDetail.Columns.Add("idMonth"); dtPaimentDetail.Columns.Add("NumInscription"); dtPaimentDetail.Columns.Add("idOtherFees"); foreach (ListViewItem it in listView1.Items) { if (it.Checked) { dtPaimentDetail.Rows.Add(Convert.ToInt32(comboBox1.SelectedValue), txtNum.Text, Convert.ToInt32(it.SubItems[0].Text)); } } if (dtPaimentDetail.Rows.Count == 0) { dtPaimentDetail.Rows.Add(Convert.ToInt32(comboBox1.SelectedValue), txtNum.Text, null); } Class_Fees.usp_tblFeesInsert(txtYear.Text, Convert.ToDecimal(txtTotal.Text), Convert.ToDecimal(txtPaid.Text), Convert.ToDecimal(txtRest.Text), dateTimePicker1.Value, dtPaimentDetail, txtNote.Text); MessageBox.Show("تم الحفظ بنجاح"); FeeId = Class_Fees.usp_getLastFees(); Clear(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtIdFee.Text)) { MessageBox.Show("المرجوا تحديد رقم الوصل", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { Class_Fees.usp_tblFeesUpdate(int.Parse(txtIdFee.Text), decimal.Parse(txtTotal.Text), decimal.Parse(txtPaid.Text), decimal.Parse(txtRest.Text), txtNote.Text); MessageBox.Show("تم التحديث بنجاح", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); LoadData(); } } catch (Exception ex) { MessageBox.Show("حصل خطأ في التحديث", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnPrint_Click(object sender, EventArgs e) { if (FeeId > 0) { try { this.Cursor = Cursors.WaitCursor; DataSet ds = Class_Fees.usp_getRecu(FeeId); RPT.CrystalReport1 cr = new RPT.CrystalReport1(); cr.SetDataSource(ds); RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show("حصل خطأ في جمع البيانات", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnPrintSelected_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { try { this.Cursor = Cursors.WaitCursor; int FeeId = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); DataSet ds = Class_Fees.usp_getRecu(FeeId); RPT.CrystalReport1 cr = new RPT.CrystalReport1(); cr.SetDataSource(ds); RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show("حصل خطأ في جمع البيانات", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnSearchByClass_Click(object sender, EventArgs e) { DataTable dt = Class_Fees.usp_getLateThismonthNoClasses(Convert.ToInt32(cmbYears.SelectedValue), Convert.ToInt32(cmbMonth.SelectedValue)); dataGridView1.DataSource = dt; }
private void LoadData() { DataTable dt = Class_Fees.usp_SelectFees(); dataGridView1.DataSource = dt; }