コード例 #1
0
ファイル: frmHome.cs プロジェクト: vubang153/QuanLySanBongDa
        // Sự kiện click vào nút Thêm bên bảng Quản lý sân bóng
        private void button1_Click(object sender, EventArgs e)
        {
            var confirmResult = this.messageConfirm("Bạn muốn thêm hoá đơn này chứ ?");

            if (confirmResult == DialogResult.Yes)
            {
                // Convert phần tử
                int hoursPicker   = Convert.ToInt32(cbbHoursPicker.SelectedItem.ToString());
                int minutesPicker = Convert.ToInt32(cbbMinutePicker.SelectedItem.ToString());
                // Khai báo class Booking
                booking booking = new booking();
                // Get các giá trị từ form
                int      pitchIndex  = cbbPitchName.SelectedIndex;
                DateTime bookingDate = dtpBookingDate.Value;
                int      timeBooking = (60 * hoursPicker) + minutesPicker;
                int      creater     = cbbCreater.SelectedIndex;
                string   note        = tbNote.Text;
                // Set giá trị vào thực thể
                booking.id_pitch = pitchIndex;
                booking.time     = timeBooking;
                booking.message  = note;
                booking.price    = 1000000;
                booking.id_user  = creater;
                booking.id       = 7;
                db.bookings.InsertOnSubmit(booking);
                db.SubmitChanges();
            }
        }
コード例 #2
0
 private void detach_bookings(booking entity)
 {
     this.SendPropertyChanging();
     entity.pitch = null;
 }
コード例 #3
0
 private void attach_bookings(booking entity)
 {
     this.SendPropertyChanging();
     entity.pitch = this;
 }
コード例 #4
0
 partial void Deletebooking(booking instance);
コード例 #5
0
 partial void Updatebooking(booking instance);
コード例 #6
0
 partial void Insertbooking(booking instance);