public FormReaderHoliday(OpenMode openMode, AccessDataBase.Model.ReaderInfo modelReaderInfo, AccessDataBase.Model.ReaderHoliday modelHoliay)
        {
            InitializeComponent();
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = GetResourcesFile.getSystemIco();
            this.CenterToScreen();

            this.openMode = openMode;
            this.modelReaderInfo = modelReaderInfo;
            this.modelHoliay = modelHoliay;
            if (openMode == OpenMode.Update)
            {
                kryptonDateTimePickerStartDate.Value = Convert.ToDateTime(modelHoliay.ReaderHolidayStartDate);
                kryptonDateTimePickerEndDate.Value = Convert.ToDateTime(modelHoliay.ReaderHolidayEndDate);
            }
            else if(openMode == OpenMode.Add)
            { }
        }
        private void toolStripButtonUpdateHolidayInfo_Click(object sender, EventArgs e)
        {
            if (dataGridViewWithCheckBox1.CurrentRow == null)
            {
                return;
            }
            int selectIndex = dataGridViewWithCheckBox1.CurrentRow.Index;

            string holidayID = dataGridViewWithCheckBox1["ReaderHolidayID", selectIndex].Value.ToString().Trim();
            string readerID  = dataGridViewWithCheckBox1["ReaderID", selectIndex].Value.ToString().Trim();

            modelReaderInfo.ReaderID = int.Parse(readerID);

            modelHoliday = bllHoliday.GetModel(int.Parse(holidayID));

            FormReaderHoliday formReaderHoliday = new FormReaderHoliday(OpenMode.Update, modelReaderInfo, modelHoliday);

            formReaderHoliday.ShowDialog();

            refreshDataGridView();
        }
Exemple #3
0
        public FormReaderHoliday(OpenMode openMode, AccessDataBase.Model.ReaderInfo modelReaderInfo, AccessDataBase.Model.ReaderHoliday modelHoliay)
        {
            InitializeComponent();
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon            = GetResourcesFile.getSystemIco();
            this.CenterToScreen();

            this.openMode        = openMode;
            this.modelReaderInfo = modelReaderInfo;
            this.modelHoliay     = modelHoliay;
            if (openMode == OpenMode.Update)
            {
                kryptonDateTimePickerStartDate.Value = Convert.ToDateTime(modelHoliay.ReaderHolidayStartDate);
                kryptonDateTimePickerEndDate.Value   = Convert.ToDateTime(modelHoliay.ReaderHolidayEndDate);
            }
            else if (openMode == OpenMode.Add)
            {
            }
        }
        private void toolStripButtonUpdateHolidayInfo_Click(object sender, EventArgs e)
        {
            if (dataGridViewWithCheckBox1.CurrentRow == null)
                return;
            int selectIndex = dataGridViewWithCheckBox1.CurrentRow.Index;

            string holidayID = dataGridViewWithCheckBox1["ReaderHolidayID", selectIndex].Value.ToString().Trim();
            string readerID = dataGridViewWithCheckBox1["ReaderID", selectIndex].Value.ToString().Trim();

            modelReaderInfo.ReaderID = int.Parse(readerID);

            modelHoliday = bllHoliday.GetModel(int.Parse(holidayID));

            FormReaderHoliday formReaderHoliday = new FormReaderHoliday(OpenMode.Update, modelReaderInfo, modelHoliday);
            formReaderHoliday.ShowDialog();

            refreshDataGridView();
        }