コード例 #1
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;
        }
コード例 #2
0
        private void txtFormatID_TextChanged(object sender, EventArgs e)
        {
            string movieID        = (string)dtgvFormat.SelectedCells[0].OwningRow.Cells["Mã phim"].Value;
            Movie  movieSelecting = MovieDAO.GetMovieByID(movieID);

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

            if (movieSelecting == null)
            {
                return;
            }

            //cboFormat_MovieID.SelectedItem = movieSelecting;

            int indexMovie = -1;
            int iMovie     = 0;

            foreach (Movie item in cboFormat_MovieID.Items)
            {
                if (item.Name == movieSelecting.Name)
                {
                    indexMovie = iMovie;
                    break;
                }
                iMovie++;
            }
            cboFormat_MovieID.SelectedIndex = indexMovie;


            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;
        }
コード例 #3
0
ファイル: TauTypeUC.cs プロジェクト: nguyenvanthien6/datve
 void DeleteScreenType(string id)
 {
     if (ScreenTypeDAO.DeleteScreenType(id))
     {
         MessageBox.Show("Xóa loại phòng thành công");
     }
     else
     {
         MessageBox.Show("Xóa loại phòng thất bại");
     }
 }
コード例 #4
0
ファイル: TauTypeUC.cs プロジェクト: nguyenvanthien6/datve
 void UpdateScreenType(string id, string name)
 {
     if (ScreenTypeDAO.UpdateScreenType(id, name))
     {
         MessageBox.Show("Sửa loại phòng thành công");
     }
     else
     {
         MessageBox.Show("Sửa loại phòng thất bại");
     }
 }
コード例 #5
0
ファイル: TauTypeUC.cs プロジェクト: nguyenvanthien6/datve
 void InsertScreenType(string id, string name)
 {
     if (ScreenTypeDAO.InsertScreenType(id, name))
     {
         MessageBox.Show("Thêm loại phòng thành công");
     }
     else
     {
         MessageBox.Show("Thêm loại phòng thất bại");
     }
 }
コード例 #6
0
        private void cboFormatID_Showtime_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboFormatID_Showtime.SelectedIndex != -1)
            {
                FormatMovie formatMovieSelecting = (FormatMovie)cboFormatID_Showtime.SelectedItem;
                txtMovieName_Showtime.Text      = formatMovieSelecting.MovieName;
                txtScreenTypeName_Showtime.Text = formatMovieSelecting.ScreenTypeName;

                cboCinemaID_Showtime.DataSource = null;
                ScreenType screenType = ScreenTypeDAO.GetScreenTypeByName(formatMovieSelecting.ScreenTypeName);
                cboCinemaID_Showtime.DataSource    = CinemaDAO.GetCinemaByScreenTypeID(screenType.ID);
                cboCinemaID_Showtime.DisplayMember = "Name";
            }
        }
コード例 #7
0
        private void txtCinemaID_TextChanged(object sender, EventArgs e)
        //Use this to bind data between dtgv and cbo because cbo can't be applied DataBindings normally
        {
            string screenName = (string)dtgvCinema.SelectedCells[0].OwningRow.Cells["Tên màn hình"].Value;

            DTO.ScreenType screenType = ScreenTypeDAO.GetScreenTypeByName(screenName);
            //This is the ScreenType that we're currently selecting in dtgv

            cboCinemaScreenType.SelectedItem = screenType;

            int index = -1;
            int i     = 0;

            foreach (ScreenType item in cboCinemaScreenType.Items)
            {
                if (item.Name == screenType.Name)
                {
                    index = i;
                    break;
                }
                i++;
            }
            cboCinemaScreenType.SelectedIndex = index;
        }
コード例 #8
0
 void LoadScreenTypeIntoComboBox(ComboBox cbo)
 {
     cbo.DataSource    = ScreenTypeDAO.GetListScreenType();
     cbo.DisplayMember = "Name";
     cbo.ValueMember   = "ID";
 }
コード例 #9
0
ファイル: TauTypeUC.cs プロジェクト: nguyenvanthien6/datve
 void LoadScreenTypeList()
 {
     screenTypeList.DataSource = ScreenTypeDAO.GetScreenType();
 }
コード例 #10
0
ファイル: FormatTauUC.cs プロジェクト: nguyenvanthien6/datve
 void LoadScreenIDIntoCombobox(ComboBox comboBox)
 {
     comboBox.DataSource    = ScreenTypeDAO.GetListScreenType();
     comboBox.DisplayMember = "ID";
     comboBox.ValueMember   = "ID";
 }