private bool CheckSameSC(SuatChieu s1, int s1_tl, SuatChieu s2, int s2_tl) { DateTime d1 = new DateTime(s1.Nam, s1.Thang, s1.Ngay, s1.Gio, s1.Phut, 0); DateTime d2 = new DateTime(s2.Nam, s2.Thang, s2.Ngay, s2.Gio, s2.Phut, 0); int t = (int)(d1 - d2).TotalMinutes; t = Math.Abs(t); if (d1.CompareTo(d2) > 0) { //d1 > d2 sample d1: 12:15 -- d2: 11:25 //t > s1_tl, s1 can be show after s2 if (t > s2_tl) { return(false); } return(true); } else { if (t > s1_tl) { return(false); } return(true); } }
private int CountSoGheDaDat(Phim t, SuatChieu s) { int tt = 0; foreach (HoaDon i in listHoaDon) { if (i.MaPhim == t.MaPhim && s.MaSuatChieu == i.MaSuatChieu) { tt += i.MaGhe.Count; } } return(tt); }
public bool CheckSameSC(Phim t, SuatChieu s) { foreach (Phim i in listPhim) { foreach (SuatChieu j in i.ListSC) { if (s.MaPhong == j.MaPhong && CheckSameSC(s, t.ThoiLuong, j, i.ThoiLuong)) { return(true); } } } return(false); }
public List <Ghe> GetListGheFollowSC(Phim t, SuatChieu s) { List <Ghe> lg = FindPhong(s.MaPhong).ListGhe; List <string> lg_rved = new List <string>(); foreach (HoaDon i in ListHoaDon) { if (i.MaPhim == t.MaPhim && i.MaSuatChieu == s.MaSuatChieu) { foreach (string j in i.MaGhe) { SetTTDaDatForGhe(lg, j); } } } return(lg); }
private int CheckShowingSC(DateTime d1, SuatChieu s2, int s2_tl) { DateTime d2 = new DateTime(s2.Nam, s2.Thang, s2.Ngay, s2.Gio, s2.Phut, 0); int t = (int)(d1 - d2).TotalMinutes; t = Math.Abs(t); if (d1.CompareTo(d2) > 0) { if (t > s2_tl) { return(-1); } return(Math.Abs(t - s2_tl)); } else { return(-1); } }