예제 #1
0
        private void dataGridView_MouseUp(object sender, MouseEventArgs e)
        {
            if (otvoritiNovuFormicu)
            {
                //Broj označenih čelija
                int selectedCellCount = dataGridView.GetCellCount(DataGridViewElementStates.Selected);

                if (UserSelectedMultipleRows(ref dataGridView, selectedCellCount))
                {
                    return;
                }

                if (UserSelectedRowHeader(ref dataGridView, selectedCellCount))
                {
                    return;
                }

                int[] days     = Days(ref dataGridView, selectedCellCount);
                int   firstDay = days[0];
                int   lastDay  = days[1];

                //OTVORITI FORMU UNOS REZERVACIJE S PARAMETRIMA O KOJOJ SOBI SE RADI, PRVI DAN, POSLJEDNJI DAN, MJESEC, GODINA, TRENUTNO VRIJEME hh:mm:ss
                int            rowNumberToInsertIntoComboBox = dataGridView.SelectedCells[0].RowIndex;
                string         fullFirstDay   = firstDay.ToString() + "." + (cbMonth.SelectedIndex + 1).ToString() + "." + numYear.Value.ToString() + " " + DateTime.Now.ToString("hh:mm:ss");
                string         fullLastDay    = lastDay.ToString() + "." + (cbMonth.SelectedIndex + 1).ToString() + "." + numYear.Value.ToString() + " " + DateTime.Now.ToString("hh:mm:ss");
                FrmRezervacija frmRezervacija = new FrmRezervacija(rowNumberToInsertIntoComboBox, fullFirstDay, fullLastDay);
                frmRezervacija.ShowDialog();
            }
            otvoritiNovuFormicu = true;
        }
예제 #2
0
        private void BtnReservation_Click(object sender, EventArgs e)
        {
            FrmRezervacija form = new FrmRezervacija();

            form.ShowDialog();
            if (form.ReservationCreated)
            {
                LoadMonthData(SelectedMonth, Convert.ToInt32(numYear.Value));
            }
        }
예제 #3
0
        /// <summary>
        /// Opens reservation form and enabled edit mode
        /// </summary>
        private void EditReservation()
        {
            Hide();
            FrmRezervacija form = new FrmRezervacija
            {
                BrojRezervacije = BrojRezervacije,
                EditMode        = true
            };

            form.FormClosed += (s, args) => Close();
            form.ShowDialog();
        }
예제 #4
0
        private void BtnReservation_Click(object sender, EventArgs e)
        {
            FrmRezervacija form = new FrmRezervacija();

            form.MdiParent = this.MdiParent;
            form.Dock      = DockStyle.Fill;
            form.Show();
            if (form.ReservationCreated)
            {
                LoadMonthData(SelectedMonth, Convert.ToInt32(numYear.Value));
            }
        }