Пример #1
0
        private void SimpleButton56_Click_1(object sender, System.EventArgs e)
        {
            if (ucMemberID1.EditValue.ToString() == "")
            {
                MessageBox.Show(this, "Please select a member id.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtTherapist.Text == "")
            {
                MessageBox.Show(this, "Please select a therapist.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtPackageID.Text == "")
            {
                MessageBox.Show(this, "Please select a package ID.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtServiceCode.Text == "")
            {
                MessageBox.Show(this, "Please select a service code.");
                this.DialogResult = DialogResult.None;
                return;
            }

            if (myIsWaitingList)
            {
                if (dtEdtStartTime.DateTime.Hour < 16)
                {
                    MessageBox.Show(this, "Waiting List must be set after 8.00 pm.");
                    this.DialogResult = DialogResult.None;
                    return;
                }
                else if (dtEdtStartTime.DateTime.Hour > 23 && dtEdtEndTime.DateTime.Hour > 23)
                {
                    MessageBox.Show(this, "Waiting List must be set before 11.00 pm.");
                    this.DialogResult = DialogResult.None;
                    return;
                }
            }

            this.BindingContext[myDataTable].EndCurrentEdit();

            try
            {
                mySpaBooking.Save(myDataTable, !myIsWaitingList);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.DialogResult = DialogResult.None;
                return;
            }
        }
Пример #2
0
        private void SimpleButton56_Click_1(object sender, System.EventArgs e)
        {
            if (lkpEdtMemberID.Text == "")
            {
                MessageBox.Show(this, "Please select a member id.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtTherapist.Text == "")
            {
                MessageBox.Show(this, "Please select a therapist.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtPackageID.Text == "")
            {
                MessageBox.Show(this, "Please select a package ID.");
                this.DialogResult = DialogResult.None;
                return;
            }
            else if (lkpEdtServiceCode.Text == "")
            {
                MessageBox.Show(this, "Please select a service code.");
                this.DialogResult = DialogResult.None;
                return;
            }
//			else if (dtEdtStartTime.DateTime < DateTime.Now.m)
//			{
//				MessageBox.Show(this, "Please select a valid date or time.");
//				return;
//			}
//			else if (dtEdtStartTime.DateTime < dtEdtEndTime.DateTime)
//			{
//				MessageBox.Show(this, "Please select a valid date or time.");
//				return;
//			}

            this.BindingContext[myDataTable].EndCurrentEdit();

            try
            {
                mySpaBooking.Save(myDataTable, true);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.DialogResult = DialogResult.None;
                return;
            }
        }