Exemple #1
0
        public static bool Update(SeatMaDll.SeatingChart sc)
        {
            SeatingchartDbo dbo  = new SeatingchartDbo();
            SeatingchartPo  scPo = new SeatingchartPo();

            scPo.SEATINGCHARTID   = sc.SeatingChartId;
            scPo.SEATINGCHARTNAME = sc.SeatingChartName;
            scPo.LEVEL            = sc.Level;
            scPo.SEATS            = sc.Seats;
            scPo.COLUMNS          = sc.Columns;
            scPo.ROWSPACE         = sc.RowSpace;
            scPo.COLUMNSPACE      = sc.ColumnSpace;
            scPo.ROTATION         = sc.Rotation;
            scPo.HALLID           = sc.HallId;
            scPo.THEATERID        = sc.TheaterId;

            BlockPo blPo = new BlockPo();

            blPo.BLOCKID        = scPo.SEATINGCHARTID + "0";
            blPo.BLOCKNAME      = "默认";
            blPo.SEATINGCHARTID = scPo.SEATINGCHARTID;

            DataTable dt      = dbo.RetrieveALLItemsBySeatingchartId(sc.SeatingChartId);
            bool      bReturn = false;

            if (dt == null || dt.Rows.Count <= 0)
            {
                bReturn = dbo.InsertWithBlock(scPo, blPo);
            }
            dt.Dispose();
            return(bReturn);
        }
Exemple #2
0
        private SeatMaDll.SeatingChart BuildSeatingChart(string szSeatingChartName)
        {
            if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影院!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }
            if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个影厅!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }
            if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null)
            {
                MessageBox.Show("必须选择一个楼层!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }
            if (szSeatingChartName.Trim().Length <= 0)
            {
                MessageBox.Show("座位图名称不能为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }

            string szTheaterId = ((SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem)._TheaterId;
            string szHallId    = ((SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem)._HallId;

            try
            {
                int nLevel = Convert.ToInt32(uC_HallInfoSeek1.cbb_Level.Text.Trim());
                //Convert.ToInt32(((SimHallLevel)cbb_Level.SelectedItem)._LevelId);
                string szSeatingchartId = SeatingChartAction.BuildSeatingchartId(szHallId, nLevel);

                SeatMaDll.SeatingChart stchTemp = new SeatMaDll.SeatingChart();
                stchTemp.SeatingChartId   = szSeatingchartId;
                stchTemp.SeatingChartName = szSeatingChartName;
                stchTemp.Level            = nLevel;
                stchTemp.Seats            = 0;
                stchTemp.Rows             = 0;
                stchTemp.Columns          = 0;
                stchTemp.RowSpace         = 5;
                stchTemp.ColumnSpace      = 4;
                stchTemp.HallId           = szHallId;
                stchTemp.TheaterId        = szTheaterId;

                if (SeatingChartAction.Update(stchTemp))
                {
                    return(stchTemp);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public static SeatMaDll.SeatingChart GetSeatingChart(string szSeatingChartName)
        {
            SeatingchartDbo dbo = new SeatingchartDbo();
            DataTable       dt  = dbo.GetSeatingChart(szSeatingChartName);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(null);
            }
            SeatMaDll.SeatingChart obj = ChangeObj(dt.Rows[0]);
            return(obj);
        }
Exemple #4
0
        public void QueryData()
        {
            seatChartDispScreen1.seatChartDisp1.ClearItems();
            seatChartDispScreen1.seatChartDisp1.Invalidate();
            seatChartDispScreen1.SetBottomDisplay_Right("");

            if (uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem == null)
            {
                return;
            }
            _seatingChart = (SeatMaDll.SeatingChart)uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem;

            SetSeatResource(_seatingChart.BgColour);

            int nLeftPad = (int)((tableLayoutPanel_All.ColumnStyles[2].Width - _nSCPanelWidth) / 2);
            int nTopPad  = (int)((tableLayoutPanel_All.RowStyles[3].Height - _nSCPanelContainerHeight) / 2);

            seatChartDispScreen1.seatChartDisp1.ImportSeatChartWithBlockAndPad(_seatingChart, nLeftPad, nTopPad);

            int nSeatCount = seatChartDispScreen1.seatChartDisp1.GetAllSeatCount();

            seatChartDispScreen1.SetBottomDisplay_Right("座位数量:" + nSeatCount.ToString());

            _SimBlockObj = null;

            uC_ImageButtonVPanel_Block.Clear();
            _SimBlockObj = null;

            if (_seatingChart == null)
            {
                return;
            }
            List <SimBlock> list = SimBlock.RetrieveItems(_seatingChart.SeatingChartId);

            if (list == null || list.Count <= 0)
            {
                return;
            }
            uC_ImageButtonVPanel_Block.Clear();
            List <ImageButtonItem> listImgButton = new List <ImageButtonItem>();

            foreach (SimBlock sb in list)
            {
                ImageButtonItem ibi = new ImageButtonItem();
                ibi._Img         = global::WinFormUI.Properties.Resources.SeatChartFlag;
                ibi._DisplayText = sb._BlockName;
                ibi._BackColor   = sb._BgColour;
                ibi._objFlag     = sb;
                listImgButton.Add(ibi);
            }
            uC_ImageButtonVPanel_Block.CreateControl(listImgButton);
        }
Exemple #5
0
        public static SeatMaDll.SeatingChart RetrieveObj(string szHallId, int nLevel)
        {
            SeatingchartDbo dbo = new SeatingchartDbo();
            DataTable       dt  = dbo.RetrieveALLItems(szHallId, nLevel);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(null);
            }
            SeatMaDll.SeatingChart obj = ChangeObj(dt.Rows[0]);
            if (obj != null)
            {
                obj._listSiteItem = SeatAction.RetrieveItems(obj.SeatingChartId);
            }
            return(obj);
        }
Exemple #6
0
        public static BlockRich RetrieveObj(string szHallId, int nLevel)
        {
            SeatMaDll.SeatingChart objSeatingChart = SeatingChartAction.RetrieveObj(szHallId, nLevel);
            if (objSeatingChart == null)
            {
                return(null);
            }
            BlockRich blcR = new BlockRich();

            blcR._ObjSeatingChart = objSeatingChart;
            if (blcR._ObjSeatingChart != null)
            {
                blcR._ObjBlock = Block.RetrieveObj(blcR._ObjSeatingChart.SeatingChartId, "0");
            }
            return(blcR);
        }
Exemple #7
0
 private static SeatMaDll.SeatingChart ChangeObj(DataRow dr)
 {
     SeatMaDll.SeatingChart obj = new SeatMaDll.SeatingChart();
     obj.SeatingChartId   = dr["SeatingChartId"] == DBNull.Value ? "" : dr["SeatingChartId"].ToString();
     obj.SeatingChartName = dr["SeatingChartName"] == DBNull.Value ? "" : dr["SeatingChartName"].ToString();
     obj.Level            = dr["Level"] == DBNull.Value ? 1 : Convert.ToInt32(dr["Level"]);
     obj.Seats            = dr["Seats"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Seats"]);
     obj.Columns          = dr["Columns"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Columns"]);
     obj.RowSpace         = dr["RowSpace"] == DBNull.Value ? 0 : Convert.ToInt32(dr["RowSpace"]);
     obj.ColumnSpace      = dr["ColumnSpace"] == DBNull.Value ? 0 : Convert.ToInt32(dr["ColumnSpace"]);
     obj.Shape            = dr["Shape"] == DBNull.Value ? "" : dr["Shape"].ToString();
     obj.BgColour         = dr["BgColour"] == DBNull.Value ? "" : dr["BgColour"].ToString();
     obj.HallId           = dr["HallId"] == DBNull.Value ? "" : dr["HallId"].ToString();
     //obj.TheaterId = dr["TheaterId"] == DBNull.Value ? "" : dr["TheaterId"].ToString();
     obj.Rotation = dr["Rotation"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Rotation"]);
     return(obj);
 }
Exemple #8
0
        public static List <SeatMaDll.SeatingChart> RetrieveObjListWithBlock(string szHallId, int nLevel)
        {
            List <SeatMaDll.SeatingChart> list = new List <SeatMaDll.SeatingChart>();
            SeatingchartDbo dbo = new SeatingchartDbo();
            DataTable       dt  = dbo.RetrieveALLItems(szHallId, nLevel);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(list);
            }
            foreach (DataRow dr in dt.Rows)
            {
                SeatMaDll.SeatingChart obj = ChangeObj(dr);
                obj._listSiteItem = SeatAction.RetrieveItemsWithBlock(obj.SeatingChartId);
                list.Add(obj);
            }
            return(list);
        }
Exemple #9
0
        public void QueryData()
        {
            seatChartDispScreen1.seatChartDisp1.ClearItems();
            seatChartDispScreen1.seatChartDisp1.Invalidate();
            seatChartDispScreen1.SetBottomDisplay_Right("");

            if (uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem == null)
            {
                return;
            }
            _seatingChart = (SeatMaDll.SeatingChart)uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem;

            SetSeatResource(_seatingChart.BgColour);

            seatChartDispScreen1.seatChartDisp1.ImportSeatChart(_seatingChart);

            int nSeatCount = seatChartDispScreen1.seatChartDisp1.GetAllSeatCount();

            seatChartDispScreen1.SetBottomDisplay_Right("座位数量:" + nSeatCount.ToString());
        }
Exemple #10
0
        public void ReQueryDataBy(int nIndex)
        {
            uC_HallInfoSeek1.cbb_SeatingChart.SelectedIndex = nIndex;
            if (uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem == null)
            {
                return;
            }
            _seatingChart = (SeatMaDll.SeatingChart)uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem;
            seatChartDispScreen1.seatChartDisp1.ImportSeatChartWithBlock(_seatingChart);

            _SimBlockObj = null;

            uC_ImageButtonVPanel_Block.Clear();
            _SimBlockObj = null;

            if (_seatingChart == null)
            {
                return;
            }
            List <SimBlock> list = SimBlock.RetrieveItems(_seatingChart.SeatingChartId);

            if (list == null || list.Count <= 0)
            {
                return;
            }
            uC_ImageButtonVPanel_Block.Clear();
            List <ImageButtonItem> listImgButton = new List <ImageButtonItem>();

            foreach (SimBlock sb in list)
            {
                ImageButtonItem ibi = new ImageButtonItem();
                ibi._Img         = global::WinFormUI.Properties.Resources.SeatChartFlag;
                ibi._DisplayText = sb._BlockName;
                ibi._BackColor   = sb._BgColour;
                ibi._objFlag     = sb;
                listImgButton.Add(ibi);
            }
            uC_ImageButtonVPanel_Block.CreateControl(listImgButton);
        }
Exemple #11
0
        public void QueryData()
        {
            seatChartDispScreen1.seatChartDisp1.ClearItems();
            seatChartDispScreen1.seatChartDisp1.Invalidate();
            seatChartDispScreen1.SetBottomDisplay_Right("");

            if (uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem == null)
            {
                return;
            }
            _seatingChart = (SeatMaDll.SeatingChart)uC_HallInfoSeek1.cbb_SeatingChart.SelectedItem;
            SetSeatResource(_seatingChart.BgColour);

            int nLeftPad = (int)((tableLayoutPanel_All.ColumnStyles[2].Width - _nSCPanelWidth) / 2);
            int nTopPad  = (int)((tableLayoutPanel_All.RowStyles[3].Height - _nSCPanelContainerHeight) / 2);

            seatChartDispScreen1.seatChartDisp1.ImportSeatChartWithPad(_seatingChart, nLeftPad, nTopPad);

            int nSeatCount = seatChartDispScreen1.seatChartDisp1.GetAllSeatCount();

            seatChartDispScreen1.SetBottomDisplay_Right("座位数量:" + nSeatCount.ToString());
        }
Exemple #12
0
        public static bool ResetData(SeatMaDll.SeatingChart sc)
        {
            SeatingchartDbo dbo  = new SeatingchartDbo();
            SeatingchartPo  scPo = new SeatingchartPo();

            scPo.SEATINGCHARTID   = sc.SeatingChartId;
            scPo.SEATINGCHARTNAME = sc.SeatingChartName;
            scPo.LEVEL            = sc.Level;
            scPo.SEATS            = sc.Seats;
            scPo.ROWS             = sc.Rows;
            scPo.COLUMNS          = sc.Columns;
            scPo.ROWSPACE         = sc.RowSpace;
            scPo.COLUMNSPACE      = sc.ColumnSpace;
            scPo.ROTATION         = sc.Rotation;
            scPo.HALLID           = sc.HallId;
            scPo.THEATERID        = sc.TheaterId;
            scPo.BGCOLOUR         = sc.BgColour;
            scPo.SHAPE            = sc.Shape;
            bool bReturn = dbo.Update(scPo);

            return(bReturn);
        }
Exemple #13
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();
        }
Exemple #14
0
        private void btnSeatInfoSubmit_Click(object sender, EventArgs e)
        {
            if (cbb_Theater.SelectedItem == null)
            {
                return;
            }
            if (cbb_Hall.SelectedItem == null)
            {
                return;
            }
            if (cbb_Level.Text.Trim().Length <= 0)
            {
                return;
            }

            string szTheaterId = ((SimTheaterInfo)cbb_Theater.SelectedItem)._TheaterId;
            string szHallId    = ((SimHall)cbb_Hall.SelectedItem)._HallId;

            string szSeats = tb_Seats.Text.Trim();

            if (szSeats.Length <= 0)
            {
                szSeats = "0";
            }

            string szRows = tb_Rows.Text.Trim();

            if (szRows.Length <= 0)
            {
                szRows = "0";
            }

            string szColumns = tb_Columns.Text.Trim();

            if (szColumns.Length <= 0)
            {
                szColumns = "0";
            }

            try
            {
                int nLevel = Convert.ToInt32(cbb_Level.Text.Trim());
                //Convert.ToInt32(((SimHallLevel)cbb_Level.SelectedItem)._LevelId);
                string szSeatingchartId = SeatingChartAction.BuildSeatingchartId(szHallId, nLevel);
                SeatMaDll.SeatingChart _seatingChart = new SeatMaDll.SeatingChart();
                _seatingChart.SeatingChartId   = szSeatingchartId;
                _seatingChart.SeatingChartName = tb_seatingchartName.Text;
                _seatingChart.Level            = nLevel;
                _seatingChart.Seats            = int.Parse(szSeats);
                _seatingChart.Rows             = int.Parse(szRows);
                _seatingChart.Columns          = int.Parse(szColumns);
                _seatingChart.RowSpace         = 5;
                _seatingChart.ColumnSpace      = 4;
                _seatingChart.HallId           = szHallId;
                _seatingChart.TheaterId        = szTheaterId;

                if (SeatingChartAction.Update(_seatingChart))
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("创建座位图成功!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #15
0
        public static List <SeatMaDll.Seat> RetrieveObjWithSeatingchartAndBlock(string szShowPlanId, string szHallId, int nLevel, int nUser, ref SeatMaDll.SeatingChart seatingchart)
        {
            List <SeatMaDll.Seat> listAll         = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listNoBrother   = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>();

            List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel);

            if (scList == null || scList.Count <= 0)
            {
                return(listAll);
            }

            SeatstatusDbo dbo = new SeatstatusDbo();
            //DataTable dt = dbo.RetrieveItemStatus_Init(szShowPlanId, szHallId, nLevel);
            DataTable dt = dbo.RetrieveItemStatus_InitWithBlock(szShowPlanId, scList[0].SeatingChartId);

            seatingchart = scList[0];

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(listAll);
            }
            foreach (DataRow dr in dt.Rows)
            {
                int nBgColour = dr["BgColour"] == DBNull.Value ? 0 : Convert.ToInt32(dr["BgColour"]);

                string szStatusFlag = "0";
                SeatPo po           = ChangeObj(dr, nUser, ref szStatusFlag);

                SeatMaDll.Seat st = SeatAction.ChangeObjFromData(po);

                st._BackColor       = nBgColour;
                st._IsUsedBackColor = true;

                //st._seatStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString();
                st._seatStatusFlag = szStatusFlag;
                if (st._seatSeatGroup.Trim().Length <= 0)
                {
                    listAll.Add(st);
                }
                else
                {
                    if (st._brotherList.Count <= 0)
                    {
                        listNoBrother.Add(st);
                    }
                    else
                    {
                        st._brotherList[0]._BackColor       = nBgColour;
                        st._brotherList[0]._IsUsedBackColor = true;
                        st._brotherList[0]._seatStatusFlag  = szStatusFlag;
                        listHaveBrother.Add(st);
                    }
                }
            }
            SeatAction.MergeObjNew(listNoBrother, listHaveBrother);

            foreach (SeatMaDll.Seat st in listHaveBrother)
            {
                listAll.Add(st);
            }
            return(listAll);
        }
Exemple #16
0
        public static List <SeatMaDll.Seat> RetrieveObjWithSeatingchart(string szShowPlanId, string szHallId, int nLevel, int nUser, ref SeatMaDll.SeatingChart seatingchart)
        {
            List <SeatMaDll.Seat> listAll         = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listNoBrother   = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>();

            List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel);

            if (scList == null || scList.Count <= 0)
            {
                return(listAll);
            }

            SeatstatusDbo dbo = new SeatstatusDbo();
            //DataTable dt = dbo.RetrieveItemStatus_Init(szShowPlanId, szHallId, nLevel);
            DataTable dt = dbo.RetrieveItemStatus_Init(szShowPlanId, scList[0].SeatingChartId);

            seatingchart = scList[0];

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(listAll);
            }
            foreach (DataRow dr in dt.Rows)
            {
                string szStatusFlag = "0";
                SeatPo po           = ChangeObj(dr, nUser, ref szStatusFlag);

                SeatMaDll.Seat st = SeatAction.ChangeObjFromData(po);

                //st._seatStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString();
                st._seatStatusFlag = szStatusFlag;
                if (st._seatSeatGroup.Trim().Length <= 0)
                {
                    listAll.Add(st);
                }
                else
                {
                    if (st._brotherList.Count <= 0)
                    {
                        listNoBrother.Add(st);
                    }
                    else
                    {
                        st._brotherList[0]._seatStatusFlag = szStatusFlag;
                        listHaveBrother.Add(st);
                    }
                }
                //if (!SeatAction.MergeObj(list, st)) list.Add(st);
            }
            SeatAction.MergeObjNew(listNoBrother, listHaveBrother);

            foreach (SeatMaDll.Seat st in listHaveBrother)
            {
                listAll.Add(st);
            }
            //if (listHaveBrother.Count > 0)
            //    listAll.AddRange(listHaveBrother[0], listHaveBrother[listHaveBrother.Count-1]);
            //listAll = listAll.AddRange(listNoBrother);
            //.CopyTo(listNoBrother);
            return(listAll);
        }
Exemple #17
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;
            }
        }
Exemple #18
0
        public static List <SeatMaDll.Seat> RetrieveObjWithSeatingchartAndBlock(string szShowPlanId, SeatMaDll.SeatingChart seatingChartTemp, int nUser, int nLeftPad, int nTopPad, ref SeatMaDll.SeatingChart seatingchart)
        {
            List <SeatMaDll.Seat> listAll         = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listNoBrother   = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>();

            if (seatingChartTemp == null)
            {
                return(listAll);
            }
            SeatstatusDbo dbo = new SeatstatusDbo();
            DataTable     dt  = dbo.RetrieveItemStatus_InitWithBlock(szShowPlanId, seatingChartTemp.SeatingChartId);

            seatingchart = seatingChartTemp;

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(listAll);
            }
            //var sw = new Stopwatch();
            //sw.Restart();
            foreach (DataRow dr in dt.Rows)
            {
                int nBgColour = dr["BgColour"] == DBNull.Value ? 0 : Convert.ToInt32(dr["BgColour"]);

                string szStatusFlag = "0";
                SeatPo po           = ChangeObj(dr, nUser, ref szStatusFlag);

                SeatMaDll.Seat st = SeatAction.ChangeObjFromDataWithPad(po, nLeftPad, nTopPad);

                st._BackColor       = nBgColour;
                st._IsUsedBackColor = true;

                //st._seatStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString();
                st._seatStatusFlag = szStatusFlag;
                if (st._seatSeatGroup.Trim().Length <= 0)
                {
                    listAll.Add(st);
                }
                else
                {
                    if (st._brotherList.Count <= 0)
                    {
                        listNoBrother.Add(st);
                    }
                    else
                    {
                        st._brotherList[0]._BackColor       = nBgColour;
                        st._brotherList[0]._IsUsedBackColor = true;
                        st._brotherList[0]._seatStatusFlag  = szStatusFlag;
                        listHaveBrother.Add(st);
                    }
                }
            }
            //sw.Stop();
            //TimeSpan time = sw.Elapsed;
            SeatAction.MergeObjNew(listNoBrother, listHaveBrother);
            dt.Dispose();
            foreach (SeatMaDll.Seat st in listHaveBrother)
            {
                listAll.Add(st);
            }
            return(listAll);
        }
Exemple #19
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);
        }