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();
        }
Example #2
0
        void cbb_Theater_SelectedIndexChanged(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            SimTheaterInfo sti         = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            string         szTheaterId = sti._TheaterId;

            uC_HallInfoSeek1.InitHall(szTheaterId);
        }
        void cbb_Theater_SelectedIndexChanged(object sender, EventArgs e)
        {
            SimTheaterInfo sti         = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem;
            string         szTheaterId = sti._TheaterId;

            uC_HallInfoSeek1.InitHallWithHallId(szTheaterId, _HallId);
            uC_HallInfoSeek1.cbb_Theater.Enabled = false;
            uC_HallInfoSeek1.cbb_Hall.Enabled    = false;
        }
Example #4
0
        private static SimTheaterInfo ChangeObj(DataRow dr)
        {
            SimTheaterInfo obj    = new SimTheaterInfo();
            string         szID   = dr["TheaterId"] == DBNull.Value ? "" : dr["TheaterId"].ToString();
            string         szName = dr["TheaterName"] == DBNull.Value ? "" : dr["TheaterName"].ToString();

            obj._TheaterId   = szID;
            obj._TheaterName = szName;
            return(obj);
        }
Example #5
0
        public void InitTheaterInfo()
        {
            List <SimTheaterInfo> list = SimTheaterInfo.RetrieveItems();

            cbb_Theater.DataSource = list;
            //if (list.Count > 0)
            //    cbb_Theater.SelectedItem = list[0];
            //else
            cbb_Theater.SelectedItem = null;
        }
Example #6
0
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }
            if (obj.GetType() != typeof(SimTheaterInfo) &&
                !obj.GetType().IsSubclassOf(typeof(SimTheaterInfo)))
            {
                return(false);
            }
            SimTheaterInfo that = (SimTheaterInfo)obj;

            return(this._TheaterId == that._TheaterId);
        }
Example #7
0
        public static List <SimTheaterInfo> RetrieveItems()
        {
            List <SimTheaterInfo> list = new List <SimTheaterInfo>();
            DataTable             dt   = new TheaterInfoDbo().RetrieveALLItems();

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(list);
            }
            foreach (DataRow dr in dt.Rows)
            {
                SimTheaterInfo obj = ChangeObj(dr);
                list.Add(obj);
            }
            dt.Dispose();
            return(list);
        }
Example #8
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();
        }
        void cbb_Hall_SelectedIndexChanged(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                return;
            }
            if (uC_HallInfoSeek1.cbb_Hall.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;

            uC_HallInfoSeek1.InitHallLevel(szTheaterId, szHallId);
        }
Example #10
0
 public void InitTheaterInfo()
 {
     cbb_Theater.DataSource   = SimTheaterInfo.RetrieveItems();
     cbb_Theater.SelectedItem = null;
 }
Example #11
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();
        }
Example #12
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);
        }