void cbb_Level_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                return;
            }
            if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null)
            {
                return;
            }
            if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null)
            {
                return;
            }

            SimTheaterInfo sti         = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            string         szTheaterId = sti._TheaterId;

            SimHall sh       = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem;
            string  szHallId = sh._HallId;

            SimHallLevel shl     = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem;
            string       szLevel = shl._LevelId;

            _editSeatInfo = new SeatMaDll.EditSeatInfo();
            _editSeatInfo._szTheaterName = sti._TheaterName;
            _editSeatInfo._szHallName    = sh._HallName;
            _editSeatInfo._szLevelName   = shl._LevelId;

            List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjListWithBlock(sh._HallId, Convert.ToInt32(shl._LevelId));

            uC_HallInfoSeek1.InitSeatingChart(scList);

            QueryData();
        }
예제 #2
0
파일: Hall.cs 프로젝트: windygu/flamingo
        private static SimHallLevel ChangeObj(DataRow dr, string szTheaterId)
        {
            SimHallLevel obj = new SimHallLevel();

            obj._TheaterId = szTheaterId;
            //dr["TheaterId"] == DBNull.Value ? "" : dr["TheaterId"].ToString();
            obj._HallId  = dr["HallId"] == DBNull.Value ? "" : dr["HallId"].ToString();
            obj._LevelId = dr["Level"] == DBNull.Value ? "" : dr["Level"].ToString();
            return(obj);
        }
예제 #3
0
파일: Hall.cs 프로젝트: windygu/flamingo
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }
            if (obj.GetType() != typeof(SimHallLevel) &&
                !obj.GetType().IsSubclassOf(typeof(SimHallLevel)))
            {
                return(false);
            }
            SimHallLevel that = (SimHallLevel)obj;

            return(this._LevelId == that._LevelId);
        }
예제 #4
0
        public void InitHallLevel(string szTheaterId, string szHallId)
        {
            cbb_Level.ResetText();
            List <SimHallLevel> list = SimHallLevel.RetrieveLevelItemsByTH(szTheaterId, szHallId);

            cbb_Level.DataSource = list;
            if (list.Count > 0)
            {
                cbb_Level.SelectedItem = list[0];
            }
            else
            {
                cbb_Level.SelectedItem = null;
            }
        }
예제 #5
0
파일: Hall.cs 프로젝트: windygu/flamingo
        public static List <SimHallLevel> RetrieveLevelItems(string szTheaterId, string szHallId)
        {
            List <SimHallLevel> list = new List <SimHallLevel>();
            DataTable           dt   = new SeatingchartDbo().RetrieveLevelItems(szTheaterId, szHallId);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(list);
            }
            foreach (DataRow dr in dt.Rows)
            {
                SimHallLevel obj = ChangeObj(dr, szTheaterId);
                list.Add(obj);
            }
            return(list);
        }
예제 #6
0
        private void SaveData()
        {
            if (this.bgwSave.IsBusy)
            {
                throw new ApplicationException("系统正在执行数据提交操作,请稍后...");
            }
            if (_editSeatInfo == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (_seatingChart == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影院!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影厅!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            SimHall        sh  = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem;
            SimHallLevel   shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem;

            if (seatChartDispScreen1.seatChartDisp1.Controls.Count <= 0)
            {
                MessageBox.Show("座位图中没有座位,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            this.Cursor = Cursors.AppStarting;
            this.bgwSave.RunWorkerAsync();
        }
예제 #7
0
파일: Hall.cs 프로젝트: windygu/flamingo
        public static List <SimHallLevel> RetrieveLevelItemsByTH(string szTheaterId, string szHallId)
        {
            List <SimHallLevel> list = new List <SimHallLevel>();
            int nLevels = new HallDbo().GetHallLevel(szTheaterId, szHallId);

            if (nLevels <= 0)
            {
                return(list);
            }
            for (int i = 1; i <= nLevels; i++)
            {
                SimHallLevel obj = new SimHallLevel();
                obj._TheaterId = szTheaterId;
                obj._HallId    = szHallId;
                obj._LevelId   = i.ToString();
                list.Add(obj);
            }
            return(list);
        }
예제 #8
0
 public void InitHallLevel(string szTheaterId, string szHallId)
 {
     cbb_Level.ResetText();
     cbb_Level.DataSource   = SimHallLevel.RetrieveLevelItems(szTheaterId, szHallId);
     cbb_Level.SelectedItem = null;
 }
예제 #9
0
        private void SaveData()
        {
            if (this.bgwSave.IsBusy)
            {
                throw new ApplicationException("系统正在执行数据提交操作,请稍后...");
            }
            if (_editSeatInfo == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (_seatingChart == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影院!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影厅!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            SimHall        sh  = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem;
            SimHallLevel   shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem;

            if (_editSeatInfo._szTheaterName != sti._TheaterName)
            {
                MessageBox.Show("导入的影院名称与座位图的影院名称不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (_editSeatInfo._szHallName != sh._HallName)
            {
                MessageBox.Show("导入的影厅名称与座位图的影厅名称不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (_editSeatInfo._szLevelName != shl._LevelId)
            {
                MessageBox.Show("导入的座位图楼层与座位图的楼层不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (seatChartDispScreen1.seatChartDisp1.Controls.Count <= 0)
            {
                MessageBox.Show("座位图中没有座位,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            SeatMaDll.SeatingChart stchTemp = SeatingChartAction.GetSeatingChart(_seatingChart.SeatingChartName);
            if (stchTemp == null)
            {
                stchTemp          = BuildSeatingChart(_seatingChart.SeatingChartName);
                stchTemp.BgColour = _seatingChart.BgColour;
                stchTemp.Shape    = _seatingChart.Shape;
                _seatingChart     = stchTemp;
            }
            else
            {
                stchTemp.BgColour = _seatingChart.BgColour;
                stchTemp.Shape    = _seatingChart.Shape;
                _seatingChart     = stchTemp;
                bool bWillUsed = SeatingChartAction.SeatingChartExistWillUsed(_seatingChart.SeatingChartName, DateTime.Now);
                if (bWillUsed)
                {
                    MessageBox.Show("座位图正在买票中使用,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                DialogResult      result  = MessageBox.Show("座位图已经存在,是否重新导入?", "系统提示", buttons);
                if (result == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }

                bool bHaveUsed = SeatingChartAction.SeatingChartExistHaveUsed(_seatingChart.SeatingChartId);
                if (bHaveUsed)
                {
                    SeatingChartAction.UpdateActiveFlag(_seatingChart.SeatingChartId, 0);
                    stchTemp          = BuildSeatingChart(_seatingChart.SeatingChartName);
                    stchTemp.BgColour = _seatingChart.BgColour;
                    stchTemp.Shape    = _seatingChart.Shape;
                    _seatingChart     = stchTemp;
                }
                else
                {
                    SeatAction.DeleteBySeatingChartId(_seatingChart.SeatingChartId);
                }
            }

            this.Cursor = Cursors.AppStarting;
            this.bgwSave.RunWorkerAsync();
        }
예제 #10
0
        private bool ImportData(ref string szMsg)
        {
            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                szMsg = "必须选择一个影院!";
                return(false);
            }
            if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null)
            {
                szMsg = "必须选择一个影厅!";
                return(false);
            }
            if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null)
            {
                szMsg = "必须选择一个楼层!";
                return(false);
            }

            SimTheaterInfo sti         = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            string         szTheaterId = sti._TheaterId;

            SimHall sh       = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem;
            string  szHallId = sh._HallId;

            SimHallLevel shl     = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem;
            string       szLevel = shl._LevelId;

            _editSeatInfo = new SeatMaDll.EditSeatInfo();
            _editSeatInfo._szTheaterName = sti._TheaterName;
            _editSeatInfo._szHallName    = sh._HallName;
            _editSeatInfo._szLevelName   = shl._LevelId;

            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title  = "请选择包含数据的座位图文件";
            dialog.Filter = "座位图文件|*.dat";
            string szFileName_Full = "";                 //@"c:\Firsite.dat";

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                szFileName_Full = dialog.FileName;
                if (szFileName_Full.Trim().Length <= 0)
                {
                    //MessageBox.Show("文件名称不能为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    szMsg = "文件名称不能为空!";
                    return(false);
                }
            }
            if (szFileName_Full.Trim().Length <= 0)
            {
                return(false);
            }

            //bool bImport = seatChartDispScreen1.seatChartDisp1.ImportItems(szFileName_Full, ref _editSeatInfo, ref szMsg);
            bool bImport = seatChartDispScreen1.seatChartDisp1.PreImportItems(szFileName_Full, ref _editSeatInfo, ref szMsg);

            if (!bImport)
            {
                return(false);
            }

            SetSeatResource(_editSeatInfo._ObjSeatingChart.BgColour);
            seatChartDispScreen1.seatChartDisp1.ImportSeatChartNew(_editSeatInfo._ObjSeatingChart);

            _seatingChart = _editSeatInfo._ObjSeatingChart;
            _seatingChart.SeatingChartName = _editSeatInfo._szSeatingChartName;

            seatChartDispScreen1.seatChartDisp1.Invalidate();

            bool bInUsed = SeatingChartAction.SeatingChartExistWillUsed(_seatingChart.SeatingChartName, DateTime.Now);

            if (bInUsed)
            {
                MessageBox.Show("座位图正在买票中使用,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            return(bImport);
        }