Example #1
0
        private void btnAddInbody_Click(object sender, EventArgs e)
        {
            frmInbodyReport frm = new frmInbodyReport();

            frm.LogID = logID;
            frm.ShowDialog();
            getTrainee();
        }
Example #2
0
        private void gridControl2_DoubleClick(object sender, EventArgs e)
        {
            int             InbodyID = Convert.ToInt32(gridView4.GetFocusedRowCellValue("م"));
            frmInbodyReport frm      = new frmInbodyReport();

            frm.inBodyID = InbodyID;
            frm.newOne   = false;
            frm.ShowDialog();
        }
Example #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!valName.Validate())
            {
                txtName.Focus();
                return;
            }
            if (!valBirth.Validate())
            {
                dtBirthdate.Focus();
                return;
            }
            if (!valGender.Validate())
            {
                cmbGender.Focus();
                return;
            }
            if (!valPhone.Validate())
            {
                txtPhone.Focus();
                return;
            }
            if (!valOffer.Validate())
            {
                cmbOffers.Focus();
                return;
            }

            MemoryStream ms = new MemoryStream();

            pBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
            byte[]   img      = ms.ToArray();
            DateTime dt       = Convert.ToDateTime(dtBirthdate.EditValue);
            int      SocialID = Convert.ToInt32(radioGroup1.EditValue);

            if (txtCardNumber.Text != "")
            {
                a.addTrainee(txtCardNumber, txtName, dt, cmbGender, cmbStatus, txtNationality, txtDegree, txtNationalID, txtNotes, dtHiring, txtTel, txtPhone, txtAddress, txtMail,
                             img, radioGroup1, ref TraineeID);
                a.addTraineeProfile(TraineeID, cmbOffers, dtBegin, dtEnd, txtPrice, txtPaid, txtCarry, sessionNum, freezing, invitations, spa, massage, others, inbody,
                                    RGpaymentMethod, type, ref LogID, cmbTrainers, cmbEmployee);
                a.incrementSocialMedia(SocialID);
                if (Convert.ToDouble(txtPaid.Text) == 0)
                {
                    a.addCash(1, "إضافة إشتراك", 0.ToString(), txtPaid.Text, "", txtName.Text, cmbOffers.Text);
                }
                if (Convert.ToDouble(txtPaid.Text) > 0)
                {
                    a.addCash(1, "إضافة إشتراك", Properties.Settings.Default.RecieptID.ToString(), txtPaid.Text, RGpaymentMethod.Text, txtName.Text, cmbOffers.Text);
                    if (RGpaymentMethod.SelectedIndex == 0)
                    {
                        u.updateTraffic(Convert.ToDouble(txtPaid.Text), 0);
                    }
                    f.fillRpt(txtName.Text, txtPaid, offerName, Convert.ToDateTime(dtBegin.EditValue), Convert.ToDateTime(dtEnd.EditValue), txtCarry.Text, RGpaymentMethod.SelectedIndex);
                    Properties.Settings.Default.RecieptID = ++Properties.Settings.Default.RecieptID;
                    Properties.Settings.Default.Save();
                }
                XtraMessageBox.Show("تمت الإضافة بنجاح", "إضافة", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (XtraMessageBox.Show("هل تريد إضافة inbody report?", "سؤال", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    if (inbody == 0)
                    {
                        XtraMessageBox.Show("هذا الإشتراك ليس له تقارير", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    frmInbodyReport frm = new frmInbodyReport();
                    frm.LogID = LogID;
                    frm.ShowDialog();
                }
                this.Close();
            }
            else if (txtCardNumber.Text == "")
            {
                if (XtraMessageBox.Show("لم يتم تمرير الكارت، هل تريد الإستمرار؟", "تنبيه", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    a.addTrainee(txtCardNumber, txtName, dt, cmbGender, cmbStatus, txtNationality, txtDegree, txtNationalID, txtNotes, dtHiring, txtTel, txtPhone, txtAddress, txtMail,
                                 img, radioGroup1, ref TraineeID);
                    a.addTraineeProfile(TraineeID, cmbOffers, dtBegin, dtEnd, txtPrice, txtPaid, txtCarry, sessionNum, freezing, invitations, spa, massage, others, inbody,
                                        RGpaymentMethod, type, ref LogID, cmbTrainers, cmbEmployee);
                    a.incrementSocialMedia(SocialID);
                    if (Convert.ToDouble(txtPaid.Text) == 0)
                    {
                        a.addCash(1, "إضافة إشتراك", 0.ToString(), txtPaid.Text, "", txtName.Text, cmbOffers.Text);
                    }
                    if (Convert.ToDouble(txtPaid.Text) > 0)
                    {
                        a.addCash(1, "إضافة إشتراك", Properties.Settings.Default.RecieptID.ToString(), txtPaid.Text, RGpaymentMethod.Text, txtName.Text, cmbOffers.Text);
                        if (RGpaymentMethod.SelectedIndex == 0)
                        {
                            u.updateTraffic(Convert.ToDouble(txtPaid.Text), 0);
                        }
                        f.fillRpt(txtName.Text, txtPaid, offerName, Convert.ToDateTime(dtBegin.EditValue), Convert.ToDateTime(dtEnd.EditValue), txtCarry.Text, RGpaymentMethod.SelectedIndex);
                        Properties.Settings.Default.RecieptID = ++Properties.Settings.Default.RecieptID;
                        Properties.Settings.Default.Save();
                    }
                    XtraMessageBox.Show("تمت الإضافة بنجاح", "إضافة", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (XtraMessageBox.Show("هل تريد إضافة inbody report?", "سؤال", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (inbody == 0)
                        {
                            XtraMessageBox.Show("هذا الإشتراك ليس له تقارير", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            this.Close();
                            return;
                        }
                        else
                        {
                            frmInbodyReport frm = new frmInbodyReport();
                            frm.LogID = LogID;
                            frm.ShowDialog();
                        }
                    }
                    this.Close();
                }
            }
        }