Beispiel #1
0
        private void GenWorkingCalendarToDB()
        {
            ValidateException.ThrowErrorItem(WorkingCalendarValidation.CheckEmptyDemandMonth((NZInt)Convert.ToInt32(txtNoOfMonth.Text)));

            switch (ShowConfirmMessage(Messages.eConfirm.CFM9012))
            {
            case MessageDialogResult.Cancel:
                return;

            case MessageDialogResult.No:
                return;

            case MessageDialogResult.Yes:
                break;
            }

            // เตรียมข้อมูลสำหรับ gen
            bool[] bStopingDay =
            {
                evoCheckBoxDay1.Checked,
                evoCheckBoxDay2.Checked,
                evoCheckBoxDay3.Checked,
                evoCheckBoxDay4.Checked,
                evoCheckBoxDay5.Checked,
                evoCheckBoxDay6.Checked,
                evoCheckBoxDay7.Checked
            };
            int iNoOfMonth = Convert.ToInt32(txtNoOfMonth.Text);

            //DateTime dateTime = Convert.ToDateTime(Convert.ToDateTime(evoDateTextBoxStartMY.DateValue).ToString("MM-01-yyyy"));
            DateTime dtmSelectedMonth = (DateTime)evoDateTextBoxStartMY.DateValue;

            dtmSelectedMonth = dtmSelectedMonth.AddDays(0 - dtmSelectedMonth.Day);
            dtmSelectedMonth = dtmSelectedMonth.AddDays(1);

            m_BIZWorkingCalendar.CreateWorkingCalendar(iNoOfMonth, dtmSelectedMonth, bStopingDay);
            UpdateDateTextBox();
            MessageDialog.ShowInformation(this, "Information", new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
            GenerateCalendar();
        }