Пример #1
0
        public static bool UpdatBlockData(SeatMaDll.SeatChartDisp seatChartDispTemp)
        {
            DataObject.DBO.SeatDbo      dbo      = new DataObject.DBO.SeatDbo();
            List <DataObject.PO.SeatPo> listSeat = new List <DataObject.PO.SeatPo>();
            bool bR = true;

            foreach (Control c in seatChartDispTemp.Controls)
            {
                if (c.GetType() == typeof(SeatMaDll.BHSeatControl))
                {
                    SeatMaDll.Seat si = (SeatMaDll.Seat)c.Tag;

                    if (listSeat != null)
                    {
                        listSeat.Clear();
                    }
                    listSeat = SeatAction.SplitDBObj(si);
                    foreach (DataObject.PO.SeatPo po in listSeat)
                    {
                        if (!dbo.UpdateBlock(po.SEATID, po.BLOCKID))
                        {
                            bR = false;
                        }
                    }
                }
            }
            return(bR);
        }
Пример #2
0
        public static bool UpdateTypeData(SeatMaDll.SeatChartDisp seatChartDispTemp)
        {
            try
            {
                DataObject.DBO.SeatDbo      dbo      = new DataObject.DBO.SeatDbo();
                List <DataObject.PO.SeatPo> listSeat = new List <DataObject.PO.SeatPo>();
                bool bR = true;
                foreach (Control c in seatChartDispTemp.Controls)
                {
                    if (c.GetType() != typeof(SeatMaDll.BHSeatControl))
                    {
                        continue;
                    }
                    SeatMaDll.Seat si = (SeatMaDll.Seat)c.Tag;

                    if (listSeat != null)
                    {
                        listSeat.Clear();
                    }
                    listSeat = SeatAction.SplitDBObj_ForUpdate(si);
                    foreach (DataObject.PO.SeatPo po in listSeat)
                    {
                        if (!dbo.UpdateType(po))
                        {
                            bR = false;
                        }
                    }
                }
                return(bR);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        public bool DeleteAll(BlockPo obj, string szBlockIdNew)
        {
            MySqlConnection connection = DBOHelper.GetConnection();

            DBOHelper.OpenConnection(connection);
            MySqlTransaction mySqlTransaction = connection.BeginTransaction();
            bool             result;

            try
            {
                SeatDbo       seatDbo       = new SeatDbo();
                BlockPriceDbo blockPriceDbo = new BlockPriceDbo();
                bool          flag          = true;
                seatDbo.UpdateBlockWithNew(connection, mySqlTransaction, obj.BLOCKID, szBlockIdNew);
                blockPriceDbo.DeleteAllByBlockId(connection, mySqlTransaction, obj.BLOCKID);
                if (flag)
                {
                    flag = this.Delete(connection, mySqlTransaction, obj);
                }
                if (flag)
                {
                    mySqlTransaction.Commit();
                }
                else
                {
                    mySqlTransaction.Rollback();
                }
                result = flag;
            }
            catch (MySqlException ex)
            {
                mySqlTransaction.Rollback();
                throw ex;
            }
            catch (Exception ex2)
            {
                mySqlTransaction.Rollback();
                throw ex2;
            }
            finally
            {
                DBOHelper.CloseConnection(connection);
            }
            return(result);
        }
Пример #4
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;
            }
        }