コード例 #1
0
ファイル: frmTau.cs プロジェクト: nguyenvanthien6/datve
        public frmTau(ShowTimes showTimes, Taudidto thienboat)
        {
            InitializeComponent();

            Times     = showTimes;
            thienboat = thienboat;
        }
コード例 #2
0
ファイル: FormatTauUC.cs プロジェクト: nguyenvanthien6/datve
        private void cboFormat_thienboatID_SelectedValueChanged(object sender, EventArgs e)
        //Display the thienboatName when thienboatID changed
        {
            Taudidto thienboatSelected = cboFormat_thienboatID.SelectedItem as Taudidto;

            txtFormat_thienboatName.Text = thienboatSelected.Name;
        }
コード例 #3
0
ファイル: FormatTauUC.cs プロジェクト: nguyenvanthien6/datve
        private void txtFormatID_TextChanged(object sender, EventArgs e)
        {
            string   thienboatID        = (string)dtgvFormat.SelectedCells[0].OwningRow.Cells["Mã Tau"].Value;
            Taudidto thienboatSelecting = TaudiDAO.GetthienboatByID(thienboatID);

            //This is the thienboat that we're currently selecting in dtgv

            if (thienboatSelecting == null)
            {
                return;
            }

            //cboFormat_thienboatID.SelectedItem = thienboatSelecting;

            int indexthienboat = -1;
            int ithienboat     = 0;

            foreach (Taudidto item in cboFormat_thienboatID.Items)
            {
                if (item.Name == thienboatSelecting.Name)
                {
                    indexthienboat = ithienboat;
                    break;
                }
                ithienboat++;
            }
            cboFormat_thienboatID.SelectedIndex = indexthienboat;


            string     screenName          = (string)dtgvFormat.SelectedCells[0].OwningRow.Cells["Tên MH"].Value;
            ScreenType screenTypeSelecting = ScreenTypeDAO.GetScreenTypeByName(screenName);

            //This is the ScreenType that we're currently selecting in dtgv

            if (screenTypeSelecting == null)
            {
                return;
            }

            //cboFormat_ScreenID.SelectedItem = screenTypeSelecting;

            int indexScreen = -1;
            int iScreen     = 0;

            foreach (ScreenType item in cboFormat_ScreenID.Items)
            {
                if (item.Name == screenTypeSelecting.Name)
                {
                    indexScreen = iScreen;
                    break;
                }
                iScreen++;
            }
            cboFormat_ScreenID.SelectedIndex = indexScreen;
        }
コード例 #4
0
 private void cboFilmName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboFilmName.SelectedIndex != -1)
     {
         cboFormatFilm.DataSource = null;
         lvLichDi.Items.Clear();
         Taudidto thienboat = cboFilmName.SelectedItem as Taudidto;
         cboFormatFilm.DataSource    = FormatTauDAO.GetListFormatthienboatBythienboat(thienboat.ID);
         cboFormatFilm.DisplayMember = "ScreenTypeName";
     }
 }
コード例 #5
0
ファイル: TaudiDAO.cs プロジェクト: nguyenvanthien6/datve
        public static Taudidto GetthienboatByID(string id)
        {
            Taudidto  thienboat = null;
            DataTable data      = DataProvider.ExecuteQuery("SELECT * FROM dbo.Tau WHERE id = '" + id + "'");

            foreach (DataRow item in data.Rows)
            {
                thienboat = new Taudidto(item);
                return(thienboat);
            }
            return(thienboat);
        }
コード例 #6
0
ファイル: TaudiDAO.cs プロジェクト: nguyenvanthien6/datve
        public static List <Taudidto> GetListthienboat()
        {
            List <Taudidto> listthienboat = new List <Taudidto>();
            DataTable       data          = DataProvider.ExecuteQuery("SELECT * FROM Tau");

            foreach (DataRow row in data.Rows)
            {
                Taudidto thienboat = new Taudidto(row);
                listthienboat.Add(thienboat);
            }
            return(listthienboat);
        }
コード例 #7
0
ファイル: TaudiDAO.cs プロジェクト: nguyenvanthien6/datve
        public static List <Taudidto> GetListthienboatByDate(DateTime date)
        {
            List <Taudidto> listthienboat = new List <Taudidto>();
            DataTable       data          = DataProvider.ExecuteQuery("select * from Tau where @Date <= NgayKetThuc", new object[] { date });

            foreach (DataRow row in data.Rows)
            {
                Taudidto thienboat = new Taudidto(row);
                listthienboat.Add(thienboat);
            }
            return(listthienboat);
        }
コード例 #8
0
 private void lvLichDi_Click(object sender, EventArgs e)
 {
     if (lvLichDi.SelectedItems.Count > 0)
     {
         timer1.Stop();
         ShowTimes showTimes = lvLichDi.SelectedItems[0].Tag as ShowTimes;
         Taudidto  thienboat = cboFilmName.SelectedItem as Taudidto;
         frmTau    frm       = new frmTau(showTimes, thienboat);
         this.Hide();
         frm.ShowDialog();
         this.OnLoad(null);
         this.Show();
     }
 }
コード例 #9
0
ファイル: TaudiUC.cs プロジェクト: nguyenvanthien6/datve
        private void txtthienboatID_TextChanged(object sender, EventArgs e)
        //Use to binding the CheckedListBox Genre of thienboat and picture of thienboat
        {
            picFilm.Image = null;
            for (int i = 0; i < clbthienboatGenre.Items.Count; i++)
            {
                clbthienboatGenre.SetItemChecked(i, false);
                //Uncheck all CheckBox first
            }

            List <Genre> listGenreOfthienboat = TauByGenreDAO.GetListGenreBythienboatID(txtthienboatID.Text);

            for (int i = 0; i < clbthienboatGenre.Items.Count; i++)
            {
                Genre genre = (Genre)clbthienboatGenre.Items[i];
                foreach (Genre item in listGenreOfthienboat)
                {
                    if (genre.ID == item.ID)
                    {
                        clbthienboatGenre.SetItemChecked(i, true);
                        break;
                    }
                }
            }

            Taudidto thienboat = TaudiDAO.GetthienboatByID(txtthienboatID.Text);

            if (thienboat == null)
            {
                return;
            }

            if (thienboat.Poster != null)
            {
                picFilm.Image = TaudiDAO.byteArrayToImage(thienboat.Poster);
            }
        }