コード例 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                Mapping.Metjurnalnomera met       = new Mapping.Metjurnalnomera();
                Mapping.Metnomera       metnomera = new Mapping.Metnomera();
                hotel.Program.Pole.id = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value);
                var linq = from n in db.jurnalnomera
                           where n.id == hotel.Program.Pole.id
                           select n;

                foreach (var i in linq)
                {
                    met.Delete(hotel.Program.Pole.id);
                    metnomera.Zan(i.idnomera, "не занят");
                }
                obnclienta();
            }
            catch { MessageBox.Show("Error"); }
        }
コード例 #2
0
ファイル: NoBron.cs プロジェクト: biletnam/Hotel-1
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (dateTimePicker1.Value <= dateTimePicker2.Value)
                {
                    Mapping.Metjurnalnomera met       = new Mapping.Metjurnalnomera();
                    Mapping.Metnomera       metnomera = new Mapping.Metnomera();

                    met.ADD("Нет", 1, Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value), Convert.ToInt32(dataGridView2.CurrentRow.Cells[0].Value), dateTimePicker1.Value, dateTimePicker2.Value);

                    metnomera.Zan(Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value), "занят");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Дата заезда не может быть больше даты выезда");
                }
            }
            catch { MessageBox.Show("Error"); }
        }
コード例 #3
0
ファイル: Voprospobroni.cs プロジェクト: biletnam/Hotel-1
        private void button1_Click(object sender, EventArgs e)
        {
            try

            {
                hotel.Program.Pole.id = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value);

                Mapping.Metnomera       met = new Mapping.Metnomera();
                Mapping.Metjurnalnomera d   = new Mapping.Metjurnalnomera();
                var linq = from n in db.bron
                           where n.id == hotel.Program.Pole.id
                           select n;
                foreach (var i in linq)
                {
                    d.ADD("Да", i.id, i.idnomera, i.idclienta, i.datazaezda, i.dataviezda);
                    met.Zan(i.idnomera, "занят");
                    //MessageBox.Show(("да " + i.id + " " + i.idnomera + " " + i.idclienta + " " + i.datazaezda + " " + i.dataviezda).ToString());
                }
                this.Close();
            }
            catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); }
            catch { MessageBox.Show("Error"); }
        }