예제 #1
0
        public bool Update(MySqlConnection conn, MySqlTransaction trans, SeatstatusPo 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);
        }
예제 #2
0
 private void SetAttParams(MySqlCommand cmd, SeatstatusPo obj)
 {
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.SEATID, 253).Value       = obj.SEATID;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.SHOWPLANID, 15).Value    = obj.SHOWPLANID;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.TICKETINGSTATE, 3).Value = obj.TICKETINGSTATE;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.LOCKEDBY, 3).Value       = obj.LOCKEDBY;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.SOLDBY, 3).Value         = obj.SOLDBY;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.CREATED, 12).Value       = obj.CREATED;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.UPDATED, 12).Value       = obj.UPDATED;
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.ACTIVEFLAG, 3).Value     = obj.ACTIVEFLAG;
 }
예제 #3
0
        public bool Insert(SeatstatusPo 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);
        }
예제 #4
0
        public bool Delete(MySqlConnection conn, MySqlTransaction trans, SeatstatusPo 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);
        }
예제 #5
0
        public bool Update(SeatstatusPo obj)
        {
            MySqlConnection connection = DBOHelper.GetConnection();

            DBOHelper.OpenConnection(connection);
            string text = string.Concat(new string[]
            {
                "UPDATE ",
                this.TABLE_NAME,
                " SET ",
                this.SQL_UPDATE_FIELD,
                this.SQL_WHERE_KEYS
            });
            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);
        }
예제 #6
0
 private void SetKeyParams(MySqlCommand cmd, SeatstatusPo obj)
 {
     cmd.Parameters.AddWithValue(SeatstatusDbo.CmdParam.SEATSTATUSID, 253).Value = obj.SEATSTATUSID;
 }