Пример #1
0
        private void SimpleButton56_Click(object sender, System.EventArgs e)
        {
            this.BindingContext[myDataTable].EndCurrentEdit();

            if (ucMemberID1.EditValue.ToString() == "")
            {
                MessageBox.Show(this, "Please key in 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 >= dtEdtEndTime.DateTime)
            {
                MessageBox.Show(this, "End Time must later than start time.");
                this.DialogResult = DialogResult.None;
                return;
            }

            DataRow  masterRow          = myDataTable.Rows[0];
            int      nPackageID         = ACMS.Convert.ToInt32(masterRow["nPackageID"]);
            string   strServiceCode     = masterRow["strServiceCode"].ToString();
            int      nServiceEmployeeID = ACMS.Convert.ToInt32(masterRow["nServiceEmployeeID"]);
            DateTime dtDate             = ACMS.Convert.ToDateTime(masterRow["dtDate"]);
            DateTime dtStartTime        = ACMS.Convert.ToDateTime(masterRow["dtStartTime"]);
            DateTime dtEndTime          = ACMS.Convert.ToDateTime(masterRow["dtEndTime"]);
            string   strBranchCode      = masterRow["strBranchCode"].ToString();
            string   remark             = masterRow["strRemarks"].ToString();

            try
            {
                mySpaBooking.MarkService(myServiceSessionID, dtDate, dtStartTime, dtEndTime,
                                         strBranchCode, nPackageID, strServiceCode, nServiceEmployeeID, remark);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
            }
        }