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
        public static bool CommitData(SeatMaDll.SeatChartDisp seatChartDispTemp,
                                      ref SeatMaDll.SeatingChart seatingchartTemp, ref SeatMaDll.EditSeatInfo editSeatInfoTemp)
        {
            try
            {
                DataObject.DBO.SeatDbo dbo = new DataObject.DBO.SeatDbo();

                //SeatAction.DeleteBySeatingChartId(seatingchartTemp.SeatingChartId);
                List <DataObject.PO.SeatPo> listSeat = new List <DataObject.PO.SeatPo>();
                int nSeatCount = 0;
                foreach (Control c in seatChartDispTemp.Controls)
                {
                    if (c.GetType() == typeof(SeatMaDll.BHSeatControl))
                    {
                        string         szSeatGuid = string.Format("{0:D4}", nSeatCount);
                        SeatMaDll.Seat si         = (SeatMaDll.Seat)c.Tag;
                        if (si._brotherList.Count <= 0)
                        {
                            nSeatCount++;
                            szSeatGuid             = string.Format("{0:D4}", nSeatCount);
                            si._seatSeatingChartId = seatingchartTemp.SeatingChartId;
                            si._seatId             = si._seatSeatingChartId + szSeatGuid;
                            si._seatBlockId        = si._seatSeatingChartId + "0";
                        }
                        else
                        {
                            for (int i = 0; i < si._brotherList.Count; i++)
                            {
                                nSeatCount++;
                                szSeatGuid = string.Format("{0:D4}", nSeatCount);
                                si._brotherList[i]._seatSeatingChartId = seatingchartTemp.SeatingChartId;
                                szSeatGuid = si._brotherList[i]._seatSeatingChartId + szSeatGuid;
                                si._brotherList[i]._seatId      = szSeatGuid;
                                si._brotherList[i]._seatBlockId = si._brotherList[i]._seatSeatingChartId + "0";
                            }
                        }

                        if (listSeat != null)
                        {
                            listSeat.Clear();
                        }
                        listSeat = SeatAction.SplitDBObj(si);
                        foreach (DataObject.PO.SeatPo po in listSeat)
                        {
                            if (dbo.Insert(po))
                            {
                                seatingchartTemp._listSiteItem.Add(si);
                            }
                        }
                    }
                }
                seatingchartTemp.Seats       = editSeatInfoTemp._ObjSeatingChart.Seats;
                seatingchartTemp.Rows        = editSeatInfoTemp._ObjSeatingChart.Rows;
                seatingchartTemp.Columns     = editSeatInfoTemp._ObjSeatingChart.Columns;
                seatingchartTemp.RowSpace    = editSeatInfoTemp._ObjSeatingChart.RowSpace;
                seatingchartTemp.ColumnSpace = editSeatInfoTemp._ObjSeatingChart.ColumnSpace;
                seatingchartTemp.Rotation    = editSeatInfoTemp._ObjSeatingChart.Rotation;
                bool bR = SeatingChartAction.ResetData(seatingchartTemp);
                bR = Hall.UpdateSeat(seatingchartTemp.HallId);
                return(bR);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
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);
        }