コード例 #1
0
        protected void btn_ThemSuat_Click(object sender, EventArgs e)
        {
            CinemaLINQDataContext dt = new CinemaLINQDataContext();

            var query = from dmsc in dt.DanhMucSuatChieus
                        where dmsc.ThoiGianBatDau.Hour == int.Parse(tb_Gio.Text) && dmsc.ThoiGianBatDau.Minute == int.Parse(tb_Phut.Text)
                        select dmsc;

            if (query.Count<DanhMucSuatChieu>() == 0)
            {
                DanhMucSuatChieu dmsc = new DanhMucSuatChieu();
                DateTime time = new DateTime(1990, 1, 1);
                time = time.AddHours(int.Parse(tb_Gio.Text));
                time = time.AddMinutes(int.Parse(tb_Phut.Text));
                dmsc.ThoiGianBatDau = time;
                dmsc.TinhTrang = true;
                dmsc.GiaDanhMuc = int.Parse(tb_GiaDanhMucSuatMoi.Text);
                dt.DanhMucSuatChieus.InsertOnSubmit(dmsc);
                dt.SubmitChanges();
            }
        }
コード例 #2
0
 partial void UpdateDanhMucSuatChieu(DanhMucSuatChieu instance);
コード例 #3
0
 partial void DeleteDanhMucSuatChieu(DanhMucSuatChieu instance);
コード例 #4
0
 partial void InsertDanhMucSuatChieu(DanhMucSuatChieu instance);