コード例 #1
0
        private static SeatPo ChangeObj(DataRow dr, int nUser, ref string szStatusFlag)
        {
            SeatPo obj = new SeatPo();

            obj.SEATID         = dr["SeatId"] == DBNull.Value ? "" : dr["SeatId"].ToString();
            obj.ROWNUMBER      = dr["RowNumber"] == DBNull.Value ? "" : dr["RowNumber"].ToString();
            obj.COLUMNNUMBER   = dr["ColumnNumber"] == DBNull.Value ? "" : dr["ColumnNumber"].ToString();
            obj.SEATNUMBER     = dr["SeatNumber"] == DBNull.Value ? "" : dr["SeatNumber"].ToString();
            obj.XAXIS          = dr["Xaxis"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Xaxis"]);
            obj.YAXIS          = dr["Yaxis"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Yaxis"]);
            obj.HEIGHT         = dr["Height"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Height"]);
            obj.WIDTH          = dr["Width"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Width"]);
            obj.PROPERTY       = dr["Property"] == DBNull.Value ? "" : dr["Property"].ToString();
            obj.SEATINGCHARTID = dr["SeatingChartId"] == DBNull.Value ? "" : dr["SeatingChartId"].ToString();
            obj.BLOCKID        = dr["BlockId"] == DBNull.Value ? "" : dr["BlockId"].ToString();
            obj.SEATTYPE       = dr["SeatType"] == DBNull.Value ? "" : dr["SeatType"].ToString();
            obj.SEATGROUP      = dr["SeatGroup"] == DBNull.Value ? "" : dr["SeatGroup"].ToString();
            obj.CREATED        = dr["Created"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(dr["Created"]);
            obj.UPDATED        = dr["Updated"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(dr["Updated"]);
            obj.ACTIVEFLAG     = dr["ActiveFlag"] == DBNull.Value ? 1 : Convert.ToInt32(dr["ActiveFlag"]);

            int nLockedBy = dr["LockedBy"] == DBNull.Value ? 0 : Convert.ToInt32(dr["LockedBy"]);

            szStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString();
            if (szStatusFlag == "1")
            {
                if (nLockedBy == nUser)
                {
                    szStatusFlag = "5";
                }
            }
            return(obj);
        }
コード例 #2
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool Delete(SeatPo obj)
        {
            string          text       = " DELETE FROM " + this.TABLE_NAME + this.SQL_WHERE_KEYS;
            MySqlConnection connection = DBOHelper.GetConnection();

            DBOHelper.OpenConnection(connection);
            MySqlCommand mySqlCommand = new MySqlCommand(text, connection);

            this.SetKeyParams(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            finally
            {
                DBOHelper.CloseConnection(connection);
            }
            return(result);
        }
コード例 #3
0
        public static List <SeatMaDll.Seat> RetrieveStatusObjs(string szShowPlanId, string szHallId, int nLevel, int nUser)
        {
            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(szShowPlanId, scList[0].SeatingChartId);

            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);
        }
コード例 #4
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool Update(MySqlConnection conn, MySqlTransaction trans, SeatPo obj)
        {
            string text = string.Concat(new string[]
            {
                "UPDATE ",
                this.TABLE_NAME,
                " SET ",
                this.SQL_UPDATE_FIELD,
                this.SQL_WHERE_KEYS
            });
            MySqlCommand mySqlCommand = new MySqlCommand(text, conn, trans);

            this.SetKeyParams(mySqlCommand, obj);
            this.SetAttParams(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            return(result);
        }
コード例 #5
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool Insert(MySqlConnection conn, MySqlTransaction trans, SeatPo obj)
        {
            string text = string.Concat(new string[]
            {
                "INSERT INTO ",
                this.TABLE_NAME,
                " (",
                this.SQL_INSERT_COLUMNS,
                ") VALUES (",
                this.SQL_INSERT_VALUES,
                ")"
            });
            MySqlCommand mySqlCommand = new MySqlCommand(text, conn, trans);

            this.SetKeyParams(mySqlCommand, obj);
            this.SetAttParams(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            return(result);
        }
コード例 #6
0
ファイル: SeatItemAction.cs プロジェクト: windygu/flamingo
        public static List <SeatPo> SplitDBObj(SeatMaDll.Seat st)
        {
            List <SeatPo> list = new List <SeatPo>();

            if (st._brotherList.Count <= 0)
            {
                SeatPo po = new SeatPo();
                po.SEATID         = st._seatId;
                po.ROWNUMBER      = st._seatRowNumberDisplay;//st._seatRowNumber;
                po.COLUMNNUMBER   = st._seatColumn;
                po.SEATNUMBER     = st._seatNumber;
                po.XAXIS          = st._seatPosX;
                po.YAXIS          = st._seatPosY;
                po.WIDTH          = st._seatWidth;
                po.HEIGHT         = st._seatHeight;
                po.PROPERTY       = st._seatProperty;
                po.SEATINGCHARTID = st._seatSeatingChartId;
                po.BLOCKID        = st._seatBlockId;
                po.SEATTYPE       = st._seatFlag;
                po.SEATGROUP      = st._seatSeatGroup;
                po.CREATED        = DateTime.Now; //st._seatStatusFlag;
                po.UPDATED        = DateTime.Now; //st._seatStatusFlag;
                po.ACTIVEFLAG     = 1;
                list.Add(po);
            }
            else
            {
                string szSeatGroup = st._brotherList[0]._seatId;
                for (int i = 0; i < st._brotherList.Count; i++)
                {
                    SeatPo po = new SeatPo();
                    po.SEATID         = st._brotherList[i]._seatId;
                    po.ROWNUMBER      = st._brotherList[i]._seatRowNumberDisplay;//st._brotherList[i]._seatRowNumber;
                    po.COLUMNNUMBER   = st._brotherList[i]._seatColumn;
                    po.SEATNUMBER     = st._brotherList[i]._seatNumber;
                    po.XAXIS          = st._brotherList[i]._seatPosX;
                    po.YAXIS          = st._brotherList[i]._seatPosY;
                    po.WIDTH          = st._brotherList[i]._seatWidth;
                    po.HEIGHT         = st._brotherList[i]._seatHeight;
                    po.PROPERTY       = st._brotherList[i]._seatProperty;
                    po.SEATINGCHARTID = st._brotherList[i]._seatSeatingChartId;
                    po.BLOCKID        = st._brotherList[i]._seatBlockId;
                    po.SEATTYPE       = st._brotherList[i]._seatFlag;
                    po.SEATGROUP      = szSeatGroup;

                    //po.SEATGROUP = st._brotherList[i]._seatFlag == "0" ? szSeatGroup : "";
                    po.CREATED    = DateTime.Now; //st._seatStatusFlag;
                    po.UPDATED    = DateTime.Now; //st._seatStatusFlag;
                    po.ACTIVEFLAG = 1;
                    list.Add(po);
                }
            }
            return(list);
        }
コード例 #7
0
ファイル: SeatItemAction.cs プロジェクト: windygu/flamingo
        public static List <SeatMaDll.Seat> RetrieveItemsWithBlock(string SeatingChartId)
        {
            List <SeatMaDll.Seat> listAll         = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listNoBrother   = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>();
            SeatDbo   dbo = new SeatDbo();
            DataTable dt  = dbo.RetrieveALLItemsWithBlock(SeatingChartId);

            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"]);
                SeatPo         po        = ChangeObj(dr);
                SeatMaDll.Seat st        = ChangeObjFromData(po);
                st._BackColor       = nBgColour;
                st._IsUsedBackColor = true;

                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;
                        listHaveBrother.Add(st);
                    }
                }
            }
            SeatAction.MergeObjNew(listNoBrother, listHaveBrother);
            foreach (SeatMaDll.Seat st in listHaveBrother)
            {
                listAll.Add(st);
            }
            return(listAll);
        }
コード例 #8
0
ファイル: SeatItemAction.cs プロジェクト: windygu/flamingo
        public static List <SeatMaDll.Seat> RetrieveItems(string SeatingChartId)
        {
            List <SeatMaDll.Seat> listAll         = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listNoBrother   = new List <SeatMaDll.Seat>();
            List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>();
            SeatDbo   dbo = new SeatDbo();
            DataTable dt  = dbo.RetrieveALLItems(SeatingChartId);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(listAll);
            }
            foreach (DataRow dr in dt.Rows)
            {
                SeatPo         po = ChangeObj(dr);
                SeatMaDll.Seat st = ChangeObjFromData(po);

                if (st._seatSeatGroup.Trim().Length <= 0)
                {
                    listAll.Add(st);
                }
                else
                {
                    if (st._brotherList.Count <= 0)
                    {
                        listNoBrother.Add(st);
                    }
                    else
                    {
                        listHaveBrother.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);
        }
コード例 #9
0
ファイル: SeatItemAction.cs プロジェクト: windygu/flamingo
 public static SeatMaDll.Seat ChangeObjFromDataWithBlock(SeatPo po)
 {
     SeatMaDll.Seat st = new SeatMaDll.Seat();
     st._seatFlag             = po.SEATTYPE;
     st._seatStatusFlag       = "0"; //po.SEATSTATUSID;
     st._seatRowNumber        = po.ROWNUMBER;
     st._seatRowNumberDisplay = po.ROWNUMBER;
     st._seatColumn           = po.COLUMNNUMBER;
     st._seatNumber           = po.SEATNUMBER;
     st._seatId             = po.SEATID;
     st._seatColumnCount    = 1;
     st._seatPosX           = po.XAXIS;
     st._seatPosY           = po.YAXIS;
     st._seatWidth          = po.WIDTH;
     st._seatHeight         = po.HEIGHT;
     st._seatProperty       = po.PROPERTY;
     st._seatSeatingChartId = po.SEATINGCHARTID;
     st._seatBlockId        = po.BLOCKID;
     st._seatSeatGroup      = po.SEATGROUP;
     st._IsUsedBackColor    = true;
     if (po.SEATGROUP.Trim().Length > 0 && po.SEATGROUP == po.SEATID)
     {
         SeatMaDll.Seat stN = new SeatMaDll.Seat();
         stN._seatFlag             = po.SEATTYPE;
         stN._seatStatusFlag       = "0"; //po.SEATSTATUSID;
         stN._seatRowNumber        = po.ROWNUMBER;
         stN._seatRowNumberDisplay = po.ROWNUMBER;
         stN._seatColumn           = po.COLUMNNUMBER;
         stN._seatNumber           = po.SEATNUMBER;
         stN._seatId             = po.SEATID;
         stN._seatColumnCount    = 1;
         stN._seatPosX           = po.XAXIS;
         stN._seatPosY           = po.YAXIS;
         stN._seatWidth          = po.WIDTH;
         stN._seatHeight         = po.HEIGHT;
         stN._seatProperty       = po.PROPERTY;
         stN._seatSeatingChartId = po.SEATINGCHARTID;
         stN._seatBlockId        = po.BLOCKID;
         stN._seatSeatGroup      = po.SEATGROUP;
         stN._IsUsedBackColor    = true;
         st._brotherList.Add(stN);
     }
     return(st);
 }
コード例 #10
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
 private void SetAttParams(MySqlCommand cmd, SeatPo obj)
 {
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.ROWNUMBER, 15).Value       = obj.ROWNUMBER;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.COLUMNNUMBER, 15).Value    = obj.COLUMNNUMBER;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATNUMBER, 15).Value      = obj.SEATNUMBER;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.XAXIS, 3).Value            = obj.XAXIS;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.YAXIS, 3).Value            = obj.YAXIS;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.HEIGHT, 3).Value           = obj.HEIGHT;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.WIDTH, 3).Value            = obj.WIDTH;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.PROPERTY, 253).Value       = obj.PROPERTY;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATGROUP, 253).Value      = obj.SEATGROUP;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.CAPACITY, 3).Value         = obj.CAPACITY;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATINGCHARTID, 253).Value = obj.SEATINGCHARTID;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.BLOCKID, 253).Value        = obj.BLOCKID;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATTYPE, 253).Value       = obj.SEATTYPE;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.CREATED, 12).Value         = obj.CREATED;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.UPDATED, 12).Value         = obj.UPDATED;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.ACTIVEFLAG, 3).Value       = obj.ACTIVEFLAG;
 }
コード例 #11
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool Insert(SeatPo obj)
        {
            MySqlConnection connection = DBOHelper.GetConnection();

            DBOHelper.OpenConnection(connection);
            string text = string.Concat(new string[]
            {
                "INSERT INTO ",
                this.TABLE_NAME,
                " (",
                this.SQL_INSERT_COLUMNS,
                ") VALUES (",
                this.SQL_INSERT_VALUES,
                ")"
            });
            MySqlCommand mySqlCommand = new MySqlCommand(text, connection);

            this.SetKeyParams(mySqlCommand, obj);
            this.SetAttParams(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            finally
            {
                DBOHelper.CloseConnection(connection);
            }
            return(result);
        }
コード例 #12
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool Delete(MySqlConnection conn, MySqlTransaction trans, SeatPo obj)
        {
            string       text         = " DELETE FROM " + this.TABLE_NAME + this.SQL_WHERE_KEYS;
            MySqlCommand mySqlCommand = new MySqlCommand(text, conn, trans);

            this.SetKeyParams(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            return(result);
        }
コード例 #13
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
        public bool UpdateType(SeatPo obj)
        {
            MySqlConnection connection = DBOHelper.GetConnection();

            DBOHelper.OpenConnection(connection);
            string text = string.Concat(new string[]
            {
                "UPDATE ",
                this.TABLE_NAME,
                " SET ",
                this.SQL_UPDATETYPE_FIELD,
                this.SQL_WHERE_KEYS
            });
            MySqlCommand mySqlCommand = new MySqlCommand(text, connection);

            this.SetKeyParams(mySqlCommand, obj);
            this.SetAttParams_UpdateType(mySqlCommand, obj);
            bool result;

            try
            {
                result = (mySqlCommand.ExecuteNonQuery() > 0);
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
            finally
            {
                DBOHelper.CloseConnection(connection);
            }
            return(result);
        }
コード例 #14
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);
        }
コード例 #15
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
 private void SetAttParams_UpdateType(MySqlCommand cmd, SeatPo obj)
 {
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATGROUP, 253).Value = obj.SEATGROUP;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATTYPE, 253).Value  = obj.SEATTYPE;
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.UPDATED, 12).Value    = obj.UPDATED;
 }
コード例 #16
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);
        }
コード例 #17
0
ファイル: SeatDbo.cs プロジェクト: windygu/flamingo
 private void SetKeyParams(MySqlCommand cmd, SeatPo obj)
 {
     cmd.Parameters.AddWithValue(SeatDbo.CmdParam.SEATID, 253).Value = obj.SEATID;
 }
コード例 #18
0
ファイル: SeatItemAction.cs プロジェクト: windygu/flamingo
        public static List <SeatPo> SplitDBObj_ForUpdate(SeatMaDll.Seat st)
        {
            List <SeatPo> list = new List <SeatPo>();

            if (st._brotherList.Count <= 0)
            {
                SeatPo po = new SeatPo();
                po.SEATID         = st._seatId;
                po.ROWNUMBER      = st._seatRowNumber;
                po.COLUMNNUMBER   = st._seatColumn;
                po.SEATNUMBER     = st._seatNumber;
                po.XAXIS          = st._seatPosX;
                po.YAXIS          = st._seatPosY;
                po.WIDTH          = st._seatWidth;
                po.HEIGHT         = st._seatHeight;
                po.PROPERTY       = st._seatProperty;
                po.SEATINGCHARTID = st._seatSeatingChartId;
                po.BLOCKID        = st._seatBlockId;
                po.SEATTYPE       = st._seatFlag;
                po.SEATGROUP      = st._seatSeatGroup;
                po.CREATED        = DateTime.Now; //st._seatStatusFlag;
                po.UPDATED        = DateTime.Now; //st._seatStatusFlag;
                po.ACTIVEFLAG     = 1;
                list.Add(po);
            }
            else
            {
                string szSeatGroup = st._brotherList[0]._seatId;
                int    nGroupCount = 0;
                ReFindGroupId(st._brotherList, ref szSeatGroup, ref nGroupCount);
                for (int i = 0; i < st._brotherList.Count; i++)
                {
                    SeatPo po = new SeatPo();
                    po.SEATID         = st._brotherList[i]._seatId;
                    po.ROWNUMBER      = st._brotherList[i]._seatRowNumber;
                    po.COLUMNNUMBER   = st._brotherList[i]._seatColumn;
                    po.SEATNUMBER     = st._brotherList[i]._seatNumber;
                    po.XAXIS          = st._brotherList[i]._seatPosX;
                    po.YAXIS          = st._brotherList[i]._seatPosY;
                    po.WIDTH          = st._brotherList[i]._seatWidth;
                    po.HEIGHT         = st._brotherList[i]._seatHeight;
                    po.PROPERTY       = st._brotherList[i]._seatProperty;
                    po.SEATINGCHARTID = st._brotherList[i]._seatSeatingChartId;
                    po.BLOCKID        = st._brotherList[i]._seatBlockId;



                    if (st._brotherList[i]._seatFlag != "0" && st._brotherList[i]._seatFlag != "1" && st._brotherList[i]._seatFlag != "2")
                    {
                        po.SEATGROUP = "";
                        po.SEATTYPE  = st._brotherList[i]._seatFlag;
                    }
                    else
                    {
                        if (nGroupCount <= 1)
                        {
                            po.SEATGROUP = "";
                            po.SEATTYPE  = "0";
                        }
                        else
                        {
                            po.SEATGROUP = szSeatGroup;
                            po.SEATTYPE  = st._brotherList[i]._seatFlag;
                        }
                    }
                    po.CREATED    = DateTime.Now; //st._seatStatusFlag;
                    po.UPDATED    = DateTime.Now; //st._seatStatusFlag;
                    po.ACTIVEFLAG = 1;
                    list.Add(po);
                }
            }
            return(list);
        }