Ejemplo n.º 1
0
        private MJadwal EntityFilm(dynamic result)
        {
            var entity = new MJadwal()
            {
                IdJadwal = Convert.ToInt32(result[_column[0]]) as int? ?? 0,
            };

            entity.Film.Id    = Convert.ToInt32(result[_column[1]]) as int? ?? 0;
            entity.Film.Judul = result[_column[2]].ToString() as string;
            entity.Film.Harga = Convert.ToInt32(result[_column[3]]) as int? ?? 0;
            return(entity);
        }
Ejemplo n.º 2
0
        private MJadwal Entity(dynamic result)
        {
            var entity = new MJadwal()
            {
                IdJadwal = Convert.ToInt32(result[_column[0]]) as int? ?? 0,
                Waktu    = result[_column[1]].ToString() as string,
            };


            entity.Ruang.Id   = Convert.ToInt32(result[_column[2]]) as int? ?? 0;
            entity.Ruang.Nama = result[_column[3]].ToString() as string;
            entity.Film.Id    = Convert.ToInt32(result[_column[4]]) as int? ?? 0;
            entity.Film.Judul = result[_column[5]].ToString() as string;

            return(entity);
        }
Ejemplo n.º 3
0
        public void Update(MJadwal data)
        {
            if (IsValidate())
            {
                var isflaged = false;
                _sql.Query = string.Format("UPDATE jadwal SET id_ruang = '{0}',waktu = '{1}',id_film = '{2}' WHERE id_jadwal = '{3}'", data.Ruang.Id, data.Waktu, data.Film.Id, Code);
                isflaged   = _sql.ExecuteUpdate();

                if (isflaged)
                {
                    _table = Read();
                    CMain.GetInstance.Index("ReadFilm");
                    _viewact.Close();
                }
                else
                {
                    MessageBox.Show("Proses update gagal!!!", "Peringatan", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
        }
Ejemplo n.º 4
0
        public void Create(MJadwal data)
        {
            if (IsValidate())
            {
                var isflaged = false;
                _sql.Query = string.Format("INSERT INTO jadwal (`id_ruang`,`waktu`,`id_film`) VALUES ('{0}','{1}','{2}')", data.Ruang.Id, data.Waktu, data.Film.Id);
                isflaged   = _sql.ExecuteUpdate();

                if (isflaged)
                {
                    _table = Read();
                    CMain.GetInstance.Index("ReadFilm");
                    _viewact.Close();
                }
                else
                {
                    MessageBox.Show("Proses simpan gagal!!!", "Peringatan", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
        }
Ejemplo n.º 5
0
 public MTiket()
 {
     Jadwal = new MJadwal();
 }