Exemplo n.º 1
0
		public bool Delete(TheaterInfoPo 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;
		}
Exemplo n.º 2
0
		public bool Insert(MySqlConnection conn, MySqlTransaction trans, TheaterInfoPo 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;
		}
Exemplo n.º 3
0
		public bool Update(TheaterInfoPo 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;
		}
Exemplo n.º 4
0
		public bool Update(MySqlConnection conn, MySqlTransaction trans, TheaterInfoPo 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;
		}
Exemplo n.º 5
0
		private void SetAttParams(MySqlCommand cmd, TheaterInfoPo obj)
		{
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.AUTHORIZATIONID, 253).Value = obj.AUTHORIZATIONID;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.THEATERTYPEID, 253).Value = obj.THEATERTYPEID;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.THEATERNAME, 253).Value = obj.THEATERNAME;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.CORPORATION, 253).Value = obj.CORPORATION;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.TELEPHONE, 253).Value = obj.TELEPHONE;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.CONTACTPEOPLE, 253).Value = obj.CONTACTPEOPLE;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.HALLS, 503).Value = obj.HALLS;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.SEATS, 503).Value = obj.SEATS;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.PROVINCE, 253).Value = obj.PROVINCE;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.CITY, 253).Value = obj.CITY;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.DISTRICT, 253).Value = obj.DISTRICT;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.POSTCODE, 253).Value = obj.POSTCODE;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.ADDRESS, 253).Value = obj.ADDRESS;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.THEATERCODE, 253).Value = obj.THEATERCODE;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.CINECHAINID, 253).Value = obj.CINECHAINID;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.SERIALNUMER, 253).Value = obj.SERIALNUMER;
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.RATIO, 4).Value = obj.RATIO;
		}
Exemplo n.º 6
0
		public bool Delete(MySqlConnection conn, MySqlTransaction trans, TheaterInfoPo 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;
		}
Exemplo n.º 7
0
		public bool Insert(TheaterInfoPo 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;
		}
Exemplo n.º 8
0
		private void SetKeyParams(MySqlCommand cmd, TheaterInfoPo obj)
		{
			cmd.Parameters.AddWithValue(TheaterInfoDbo.CmdParam.THEATERID, 253).Value = obj.THEATERID;
		}