示例#1
0
        private void BtnInsert_Click(object sender, EventArgs e)
        {
            //من شاشة الحجز
            if (visitID.HasValue)
            {
                InsertPayment(Patient.getPatientName_By_ID(patientID.Value), true, visitID.Value, patientID.Value, DateTime.Now.ToString("yyyy-MM-dd"), numPayed.Value);
                this.Close();
            }
            //مدفوع لمريض من شاشة الدفع
            if (parameters.Count > 0)
            {
                if (get_Required_Payment(int.Parse(parameters[6])) == get_Previous_Payment(int.Parse(parameters[6])))
                {
                    MessageBox.Show("المريض دفع كله");
                }
                else
                {
                    InsertPayment(parameters[1], true, int.Parse(parameters[6]), int.Parse(parameters[3]), dtpPayDate.Value.ToString("yyyy-MM-dd"), numPayed.Value);
                    frmPayments.Focus();
                    PaymentsLogic.RefreshAfterAdd(frmPayments.dataGridView1);
                    this.Close();
                }
            }
            //اضافة مصروف خارجي
            if (numRemaining.Visible == false)
            {
                bool Direction = cmbxDirection.SelectedIndex == 0 ? false : true;

                InsertPayment(txtPersonName.Text, Direction, 0, 0, dtpPayDate.Value.ToString("yyyy-MM-dd"), numOtherPayed.Value);
                frmPayments.Focus();
                PaymentsLogic.RefreshAfterAdd(frmPayments.dataGridView1);
                this.Close();
            }
        }
示例#2
0
 private void BtnInsert_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count == 0)
     {
         MessageBox.Show("لا يوجد فئات");
     }
     else
     {
         if (Application.OpenForms.OfType <frmPaymentCRUD>().Any())
         {
             return;
         }
         else
         {
             new frmPaymentCRUD(this, PaymentsLogic.EditButton(dataGridView1), null, null).Show();
         }
     }
 }