Пример #1
0
		/// <summary>
		/// Selects FRM_AnswerTrigger values from Database and assigns them to the appropriate DO_FRM_AnswerTrigger property.
		/// </summary>
		/// <param name="IFAnswer_in">IFAnswer</param>
		/// <param name="IFTrigger_in">IFTrigger</param>
		/// <param name="IFQuestion_in">IFQuestion</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if FRM_AnswerTrigger doesn't exists at Database</returns>
		public static SO_FRM_AnswerTrigger getObject(
			long IFAnswer_in, 
			int IFTrigger_in, 
			long IFQuestion_in, 
			DBConnection dbConnection_in
		) {
			SO_FRM_AnswerTrigger _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFAnswer_", DbType.Int64, ParameterDirection.InputOutput, IFAnswer_in, 0), 
				_connection.newDBDataParameter("IFTrigger_", DbType.Int32, ParameterDirection.InputOutput, IFTrigger_in, 0), 
				_connection.newDBDataParameter("IFQuestion_", DbType.Int64, ParameterDirection.InputOutput, IFQuestion_in, 0), 
				_connection.newDBDataParameter("IFUser__audit_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Date__audit_", DbType.DateTime, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_FRM_AnswerTrigger_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_FRM_AnswerTrigger();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFAnswer = 0L;
				} else {
					_output.IFAnswer = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFTrigger = 0;
				} else {
					_output.IFTrigger = (int)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.IFQuestion = 0L;
				} else {
					_output.IFQuestion = (long)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.IFUser__audit = 0L;
				} else {
					_output.IFUser__audit = (long)_dataparameters[3].Value;
				}
				if (_dataparameters[4].Value == System.DBNull.Value) {
					_output.Date__audit = new DateTime(1900, 1, 1);
				} else {
					_output.Date__audit = (DateTime)_dataparameters[4].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #2
0
		/// <summary>
		/// Selects NET_Profile__default values from Database and assigns them to the appropriate DO_NET_Profile__default property.
		/// </summary>
		/// <param name="IFProfile_in">IFProfile</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if NET_Profile__default doesn't exists at Database</returns>
		public static SO_NET_Profile__default getObject(
			long IFProfile_in, 
			DBConnection dbConnection_in
		) {
			SO_NET_Profile__default _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.InputOutput, IFProfile_in, 0)
			};
			_connection.Execute_SQLFunction("sp0_NET_Profile__default_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_NET_Profile__default();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFProfile = 0L;
				} else {
					_output.IFProfile = (long)_dataparameters[0].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #3
0
		public static DBServerTypes GetDBServerType(
			DBConnection connection_in
		) {
#if PostgreSQL
			if (connection_in is DBConnection_PostgreSQL) {
				return DBServerTypes.PostgreSQL;
			}
			else
#endif
			if (connection_in is DBConnection_SQLServer) {
				return DBServerTypes.SQLServer;
			}
#if MySQL
			else
			if (connection_in is DBConnection_MySQL) {
				return DBServerTypes.MySQL;
			}
#endif
			
			throw new Exception(
				string.Format(
					System.Globalization.CultureInfo.CurrentCulture,
					"unsuported db type: {0}", 
					connection_in.ToString()
				)
			);
		}
Пример #4
0
		/// <summary>
		/// Selects vNET_User values from Database (based on the search condition) and assigns them to the appropriate DO0_vNET_User property.
		/// </summary>
		/// <param name="IDUser_search_in">IDUser search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if vNET_User doesn't exists at Database</returns>
		public static SO_vNET_User getObject_byUser(
			long IDUser_search_in, 
			DBConnection dbConnection_in
		) {
			SO_vNET_User _output = null;
			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDUser_search_", DbType.Int64, ParameterDirection.Input, IDUser_search_in, 0), 
				_connection.newDBDataParameter("IDUser", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFApplication", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Login", DbType.AnsiString, ParameterDirection.Output, null, 255), 
				_connection.newDBDataParameter("Name", DbType.AnsiString, ParameterDirection.Output, null, 255), 
				_connection.newDBDataParameter("Email", DbType.AnsiString, ParameterDirection.Output, null, 255)
			};
			_connection.Execute_SQLFunction(
				"sp0_vNET_User_getObject_byUser", 
				_dataparameters
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[1].Value != DBNull.Value) {
				_output = new SO_vNET_User();
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IDUser = 0L;
				} else {
					_output.IDUser = (long)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.IFApplication_isNull = true;
				} else {
					_output.IFApplication = (int)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.Login = string.Empty;
				} else {
					_output.Login = (string)_dataparameters[3].Value;
				}
				if (_dataparameters[4].Value == System.DBNull.Value) {
					_output.Name_isNull = true;
				} else {
					_output.Name = (string)_dataparameters[4].Value;
				}
				if (_dataparameters[5].Value == System.DBNull.Value) {
					_output.Email_isNull = true;
				} else {
					_output.Email = (string)_dataparameters[5].Value;
				}

				return _output;
			}

			return null;
		}
Пример #5
0
		/// <summary>
		/// Selects CRD_Permission values from Database and assigns them to the appropriate DO_CRD_Permission property.
		/// </summary>
		/// <param name="IDPermission_in">IDPermission</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if CRD_Permission doesn't exists at Database</returns>
		public static SO_CRD_Permission getObject(
			long IDPermission_in, 
			DBConnection dbConnection_in
		) {
			SO_CRD_Permission _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDPermission_", DbType.Int64, ParameterDirection.InputOutput, IDPermission_in, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 255), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFTable_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFAction_", DbType.Int64, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_CRD_Permission_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_CRD_Permission();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDPermission = 0L;
				} else {
					_output.IDPermission = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.Name = string.Empty;
				} else {
					_output.Name = (string)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.IFApplication_isNull = true;
				} else {
					_output.IFApplication = (int)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.IFTable_isNull = true;
				} else {
					_output.IFTable = (long)_dataparameters[3].Value;
				}
				if (_dataparameters[4].Value == System.DBNull.Value) {
					_output.IFAction_isNull = true;
				} else {
					_output.IFAction = (long)_dataparameters[4].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #6
0
//		#region public DO__base(...);
		/// <summary>
		/// Initializes a new instance of <see cref="DO__base">DO__base</see>
		/// </summary>
		/// <param name="connection_in">DB Connection</param>
		protected DO__base(
			DBConnection connection_in
		) : this (
			connection_in, 
			connection_in.DBServerType, 
			connection_in.Connectionstring, 
			false, // connection_insideInstance_in
			null
		) {}
Пример #7
0
		/// <summary>
		/// Selects DIC_TextLanguage values from Database and assigns them to the appropriate DO_DIC_TextLanguage property.
		/// </summary>
		/// <param name="IFText_in">IFText</param>
		/// <param name="IFLanguage_in">IFLanguage</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if DIC_TextLanguage doesn't exists at Database</returns>
		public static SO_DIC_TextLanguage getObject(
			long IFText_in, 
			int IFLanguage_in, 
			DBConnection dbConnection_in
		) {
			SO_DIC_TextLanguage _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFText_", DbType.Int64, ParameterDirection.InputOutput, IFText_in, 0), 
				_connection.newDBDataParameter("IFLanguage_", DbType.Int32, ParameterDirection.InputOutput, IFLanguage_in, 0), 
				_connection.newDBDataParameter("Text__small_", DbType.AnsiString, ParameterDirection.Output, null, 8000), 
				_connection.newDBDataParameter("Text__large_", DbType.AnsiString, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_DIC_TextLanguage_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_DIC_TextLanguage();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFText = 0L;
				} else {
					_output.IFText = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFLanguage = 0;
				} else {
					_output.IFLanguage = (int)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.Text__small_isNull = true;
				} else {
					_output.Text__small = (string)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.Text__large_isNull = true;
				} else {
					_output.Text__large = (string)_dataparameters[3].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #8
0
		/// <summary>
		/// Selects NWS_ContentHighlight values from Database and assigns them to the appropriate DO_NWS_ContentHighlight property.
		/// </summary>
		/// <param name="IFContent_in">IFContent</param>
		/// <param name="IFHighlight_in">IFHighlight</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if NWS_ContentHighlight doesn't exists at Database</returns>
		public static SO_NWS_ContentHighlight getObject(
			long IFContent_in, 
			long IFHighlight_in, 
			DBConnection dbConnection_in
		) {
			SO_NWS_ContentHighlight _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFContent_", DbType.Int64, ParameterDirection.InputOutput, IFContent_in, 0), 
				_connection.newDBDataParameter("IFHighlight_", DbType.Int64, ParameterDirection.InputOutput, IFHighlight_in, 0), 
				_connection.newDBDataParameter("Begin_date_", DbType.DateTime, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("End_date_", DbType.DateTime, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_NWS_ContentHighlight_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_NWS_ContentHighlight();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFContent = 0L;
				} else {
					_output.IFContent = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFHighlight = 0L;
				} else {
					_output.IFHighlight = (long)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.Begin_date_isNull = true;
				} else {
					_output.Begin_date = (DateTime)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.End_date_isNull = true;
				} else {
					_output.End_date = (DateTime)_dataparameters[3].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #9
0
		internal static long insObject_CreateUser(
			Sessionuser sessionUser_in,

			string login_in,

			bool selectIdentity_in, 
			ref List<int> errorlist_in, 

			DBConnection con_in
		) {
			long _output = -1L;

			// ToDos: here! must have permission to create user
			if (!sessionUser_in.hasPermission(
				PermissionType.User__insert
			)) {
				errorlist_in.Add(ErrorType.user__lack_of_permissions_to_write);
				return _output;
			}

			if (!Sessionuser.checkLogin(login_in, ref errorlist_in)) {
				return _output;
			}

			bool _constraint;
			_output = DO_CRD_User.insObject(
				new SO_CRD_User(
					-1L,
					login_in,

// ToDos: here! encrypt before sending...
					login_in, // default: password = login

					sessionUser_in.IDApplication
				),

				selectIdentity_in,
				out _constraint, 

				con_in
			);

			if (_constraint) {
				errorlist_in.Add(ErrorType.data__constraint_violation);
			} else {
				if (con_in == null) {
					// assuming NO other (internal) operations are going on
					errorlist_in.Add(ErrorType.user__successfully_created__WARNING);
				}
			}

			return _output;
		}
Пример #10
0
		/// <summary>
		/// Selects FRM_Questiontype values from Database and assigns them to the appropriate DO_FRM_Questiontype property.
		/// </summary>
		/// <param name="IDQuestiontype_in">IDQuestiontype</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if FRM_Questiontype doesn't exists at Database</returns>
		public static SO_FRM_Questiontype getObject(
			int IDQuestiontype_in, 
			DBConnection dbConnection_in
		) {
			SO_FRM_Questiontype _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDQuestiontype_", DbType.Int32, ParameterDirection.InputOutput, IDQuestiontype_in, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 255), 
				_connection.newDBDataParameter("RegularExpression_", DbType.AnsiString, ParameterDirection.Output, null, 1024)
			};
			_connection.Execute_SQLFunction("sp0_FRM_Questiontype_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_FRM_Questiontype();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDQuestiontype = 0;
				} else {
					_output.IDQuestiontype = (int)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.Name = string.Empty;
				} else {
					_output.Name = (string)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.RegularExpression_isNull = true;
				} else {
					_output.RegularExpression = (string)_dataparameters[2].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #11
0
		/// <summary>
		/// Selects DIC_Text values from Database and assigns them to the appropriate DO_DIC_Text property.
		/// </summary>
		/// <param name="IDText_in">IDText</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if DIC_Text doesn't exists at Database</returns>
		public static SO_DIC_Text getObject(
			long IDText_in, 
			DBConnection dbConnection_in
		) {
			SO_DIC_Text _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDText_", DbType.Int64, ParameterDirection.InputOutput, IDText_in, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("SourceTableField_ref_", DbType.Int32, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_DIC_Text_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_DIC_Text();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDText = 0L;
				} else {
					_output.IDText = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFApplication_isNull = true;
				} else {
					_output.IFApplication = (int)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.SourceTableField_ref_isNull = true;
				} else {
					_output.SourceTableField_ref = (int)_dataparameters[2].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #12
0
		private DataTable Execute_SQL__select(DBConnection dbconnections_in) {
			switch ((DBServerTypes)Enum.Parse(typeof(DBServerTypes), dbconnections_in.DBServerType)) {
				case DBServerTypes.SQLServer:
				case DBServerTypes.PostgreSQL: {
					return dbconnections_in.Execute_SQLQuery_returnDataTable(string.Format(
						"select \"IDUser\", \"Login\", \"Password\" from \"CRD_User\" where \"Login\" = 'test-{0}'",
						this.testid_
					));
				}
				default: {
					throw new Exception(
						string.Format(
							"unsuported db type: {0}",
							dbconnections_in.DBServerType.ToString()
						)
					);
				}
			}
		}
Пример #13
0
		private DO__base(
			DBConnection connection_in, 
			string dbServerType_in, 
			string connectionString_in, 
			bool connection_insideInstance_in,
			string logFile_in
		) {
			this.connection__ = connection_in;
			this.connection_dbservertype_ = dbServerType_in;
			this.connection_connectionstring_ = connectionString_in;
			this.connection_insideinstance_ = connection_insideInstance_in;

			if (logFile_in == null) {
				this.logenabled_ = false;
				this.logfile_ = null;
			} else {
				this.logenabled_ = true;
				this.logfile_ = logFile_in;
			}
		}
Пример #14
0
		private void Execute_SQL__insert(DBConnection dbconnections_in) {
			switch ((DBServerTypes)Enum.Parse(typeof(DBServerTypes), dbconnections_in.DBServerType)) {
				case DBServerTypes.SQLServer:
				case DBServerTypes.PostgreSQL: {
					dbconnections_in.Execute_SQLQuery(string.Format(
						"insert into \"CRD_User\" (\"Login\", \"Password\", \"IFApplication\") values ('test-{0}', 'password', null)",
						this.testid_
					));
					break;
				}
				default: {
					throw new Exception(
						string.Format(
							"unsuported db type: {0}",
							dbconnections_in.DBServerType.ToString()
						)
					);
				}
			}
		}
Пример #15
0
		private void Execute_SQL__delete(DBConnection dbconnections_in) {
			switch ((DBServerTypes)Enum.Parse(typeof(DBServerTypes), dbconnections_in.DBServerType)) {
				case DBServerTypes.SQLServer:
				case DBServerTypes.PostgreSQL: {
						dbconnections_in.Execute_SQLQuery(string.Format(
						"delete from \"CRD_User\" where \"Login\" = 'test-{0}'",
						this.testid_
					));
					break;
				}
				default: {
					throw new Exception(
						string.Format(
							"unsuported db type: {0}",
							dbconnections_in.DBServerType.ToString()
						)
					);
				}
			}
		}
Пример #16
0
		/// <summary>
		/// Selects DIC_LanguageApplication values from Database and assigns them to the appropriate DO_DIC_LanguageApplication property.
		/// </summary>
		/// <param name="IFLanguage_in">IFLanguage</param>
		/// <param name="IFApplication_in">IFApplication</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if DIC_LanguageApplication doesn't exists at Database</returns>
		public static SO_DIC_LanguageApplication getObject(
			int IFLanguage_in, 
			int IFApplication_in, 
			DBConnection dbConnection_in
		) {
			SO_DIC_LanguageApplication _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFLanguage_", DbType.Int32, ParameterDirection.InputOutput, IFLanguage_in, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.InputOutput, IFApplication_in, 0)
			};
			_connection.Execute_SQLFunction("sp0_DIC_LanguageApplication_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_DIC_LanguageApplication();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFLanguage = 0;
				} else {
					_output.IFLanguage = (int)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFApplication = 0;
				} else {
					_output.IFApplication = (int)_dataparameters[1].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Пример #17
0
		/// <summary>
		/// Updates FRM_Form values on Database.
		/// </summary>
		/// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static void updObject(
			SO_FRM_Form FRM_Form_in, 
			bool forceUpdate_in, 
			DBConnection dbConnection_in
		) {
			if (forceUpdate_in || FRM_Form_in.HasChanges) {
				DBConnection _connection = (dbConnection_in == null)
					? DO__Utilities.DBConnection_createInstance(
						DO__Utilities.DBServerType,
						DO__Utilities.DBConnectionstring,
						DO__Utilities.DBLogfile
					) 
					: dbConnection_in;

				IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
					_connection.newDBDataParameter("IDForm_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.IDForm, 0), 
					_connection.newDBDataParameter("TX_Name_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.TX_Name_isNull ? null : (object)FRM_Form_in.TX_Name, 0), 
					_connection.newDBDataParameter("TX_Description_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.TX_Description_isNull ? null : (object)FRM_Form_in.TX_Description, 0), 
					_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, FRM_Form_in.IFApplication_isNull ? null : (object)FRM_Form_in.IFApplication, 0), 
					_connection.newDBDataParameter("IFUser__audit_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.IFUser__audit, 0), 
					_connection.newDBDataParameter("Date__audit_", DbType.DateTime, ParameterDirection.Input, FRM_Form_in.Date__audit, 0)
				};
				_connection.Execute_SQLFunction(
					"sp0_FRM_Form_updObject", 
					_dataparameters
				);
				if (dbConnection_in == null) { _connection.Dispose(); }
				FRM_Form_in.HasChanges = false;
			}
		}
Пример #18
0
		/// <summary>
		/// Inserts FRM_Form values into Database.
		/// </summary>
		/// <param name="selectIdentity_in">assign with True if you wish to retrieve insertion sequence/identity seed and with False if not</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>insertion sequence/identity seed</returns>
		public static long insObject(
			SO_FRM_Form FRM_Form_in, 
			bool selectIdentity_in, 
			DBConnection dbConnection_in
		) {
			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDForm_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("TX_Name_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.TX_Name_isNull ? null : (object)FRM_Form_in.TX_Name, 0), 
				_connection.newDBDataParameter("TX_Description_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.TX_Description_isNull ? null : (object)FRM_Form_in.TX_Description, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, FRM_Form_in.IFApplication_isNull ? null : (object)FRM_Form_in.IFApplication, 0), 
				_connection.newDBDataParameter("IFUser__audit_", DbType.Int64, ParameterDirection.Input, FRM_Form_in.IFUser__audit, 0), 
				_connection.newDBDataParameter("Date__audit_", DbType.DateTime, ParameterDirection.Input, FRM_Form_in.Date__audit, 0), 

				_connection.newDBDataParameter("SelectIdentity_", DbType.Boolean, ParameterDirection.Input, selectIdentity_in, 1)
			};
			_connection.Execute_SQLFunction(
				"sp0_FRM_Form_insObject", 
				_dataparameters
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			FRM_Form_in.IDForm = (long)_dataparameters[0].Value;FRM_Form_in.HasChanges = false;
			

			return FRM_Form_in.IDForm;
		}
Пример #19
0
		/// <summary>
		/// Checks to see if FRM_Form exists at Database
		/// </summary>
		/// <param name="IDForm_in">IDForm</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>True if FRM_Form exists at Database, False if not</returns>
		public static bool isObject(
			long IDForm_in, 
			DBConnection dbConnection_in
		) {
			bool _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDForm_", DbType.Int64, ParameterDirection.Input, IDForm_in, 0)
			};
			_output = (bool)_connection.Execute_SQLFunction(
				"fnc0_FRM_Form_isObject", 
				_dataparameters, 
				DbType.Boolean, 
				0
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;
		}
Пример #20
0
		/// <summary>
		/// Deletes FRM_Form from Database.
		/// </summary>
		/// <param name="IDForm_in">IDForm</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static void delObject(
			long IDForm_in, 
			DBConnection dbConnection_in
		) {
			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDForm_", DbType.Int64, ParameterDirection.Input, IDForm_in, 0)
			};
			_connection.Execute_SQLFunction("sp0_FRM_Form_delObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }
		}
Пример #21
0
		/// <summary>
		/// Count's number of search results from DIC_TextLanguage at Database based on the 'byLanguage_all' search.
		/// </summary>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>number of existing Records for the 'byLanguage_all' search</returns>
		public static long getCount_inRecord_byLanguage_all(
			int IDLanguage_search_in, 
			DBConnection dbConnection_in
		) {
			long _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0)
			};
			_output = (long)_connection.Execute_SQLFunction(
				"fnc0_DIC_TextLanguage_Record_count_byLanguage_all", 
				_dataparameters, 
				DbType.Int64,
				0
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;
		}
Пример #22
0
		/// <summary>
		/// Gets Record, based on 'byLanguage_all' search. It selects DIC_TextLanguage values from Database based on the 'byLanguage_all' search.
		/// </summary>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="page_orderBy_in">page order by</param>
		/// <param name="page_in">page number</param>
		/// <param name="page_itemsPerPage_in">number of records per page</param>
		/// <param name="page_itemsCount_out">total number of items</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static SO_DIC_TextLanguage[] getRecord_byLanguage_all(
			int IDLanguage_search_in, 
			int page_orderBy_in, 
			long page_in, 
			int page_itemsPerPage_in, 
			out long page_itemsCount_out, 
			DBConnection dbConnection_in
		) {
			SO_DIC_TextLanguage[] _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = 
				((page_in > 0) && (page_itemsPerPage_in > 0))
					? new IDbDataParameter[] {
						_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0), 
						_connection.newDBDataParameter("page_orderBy_", DbType.Int32, ParameterDirection.Input, page_orderBy_in, 0), 
						_connection.newDBDataParameter("page_", DbType.Int64, ParameterDirection.Input, page_in, 0), 
						_connection.newDBDataParameter("page_itemsPerPage_", DbType.Int32, ParameterDirection.Input, page_itemsPerPage_in, 0), 

						//_connection.newDBDataParameter("page_itemsCount_", DbType.Int32, ParameterDirection.Output, null, 0), 

					}
					: new IDbDataParameter[] {
						_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0)
					}
				;
			_output = getRecord(
				_connection.Execute_SQLFunction_returnDataTable(
					((page_in > 0) && (page_itemsPerPage_in > 0))
						? "sp_DIC_TextLanguage_Record_open_byLanguage_all_page"
						: "sp0_DIC_TextLanguage_Record_open_byLanguage_all", 
					_dataparameters
				)
			);
			if ((page_in > 0) && (page_itemsPerPage_in > 0)) {
				// && (_dataparameters[_dataparameters.Length - 1].Value != DBNull.Value)) {
				//page_itemsCount_out = (int)_dataparameters[_dataparameters.Length - 1].Value;

				page_itemsCount_out = getCount_inRecord_byLanguage_all(
					IDLanguage_search_in, 
					dbConnection_in
				);
			} else {
				page_itemsCount_out = 0;
			}
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;			
		}
Пример #23
0
		/// <summary>
		/// Deletes DIC_TextLanguage values from Database based on the 'byLanguage_short' search.
		/// </summary>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static void delRecord_byLanguage_short(
			int IDLanguage_search_in, 
			DBConnection dbConnection_in
		) {
			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0)
			};
			_connection.Execute_SQLFunction(
				"sp0_DIC_TextLanguage_Record_delete_byLanguage_short", 
				_dataparameters
			);
			if (dbConnection_in == null) { _connection.Dispose(); }
		}
Пример #24
0
		/// <summary>
		/// It selects DIC_TextLanguage values from Database based on the 'byLanguage_short' search and checks to see if DIC_TextLanguage Keys(passed as parameters) are met.
		/// </summary>
		/// <param name="IFText_in">DIC_TextLanguage's IFText Key used for checking</param>
		/// <param name="IFLanguage_in">DIC_TextLanguage's IFLanguage Key used for checking</param>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>True if DIC_TextLanguage Keys are met in the 'byLanguage_short' search, False if not</returns>
		public static bool isObject_inRecord_byLanguage_short(
			long IFText_in, 
			int IFLanguage_in, 
			int IDLanguage_search_in, 
			DBConnection dbConnection_in
		) {
			bool _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFText_", DbType.Int64, ParameterDirection.Input, IFText_in, 0), 
				_connection.newDBDataParameter("IFLanguage_", DbType.Int32, ParameterDirection.Input, IFLanguage_in, 0), 
				_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0)
			};
			_output = (bool)_connection.Execute_SQLFunction(
				"fnc0_DIC_TextLanguage_Record_hasObject_byLanguage_short", 
				_dataparameters, 
				DbType.Boolean,
				0
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;
		}
Пример #25
0
		/// <summary>
		/// Inserts/Updates DIC_TextLanguage values into/on Database. Inserts if DIC_TextLanguage doesn't exist or Updates if DIC_TextLanguage already exists.
		/// </summary>
		/// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>True if it didn't exist (INSERT), and False if it did exist (UPDATE)</returns>
		public static bool setObject(
			SO_DIC_TextLanguage DIC_TextLanguage_in, 
			bool forceUpdate_in, 
			DBConnection dbConnection_in
		) {
			bool ConstraintExist_out;
			if (forceUpdate_in || DIC_TextLanguage_in.HasChanges) {
				DBConnection _connection = (dbConnection_in == null)
					? DO__Utilities.DBConnection_createInstance(
						DO__Utilities.DBServerType,
						DO__Utilities.DBConnectionstring,
						DO__Utilities.DBLogfile
					) 
					: dbConnection_in;
				IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
					_connection.newDBDataParameter("IFText_", DbType.Int64, ParameterDirection.Input, DIC_TextLanguage_in.IFText, 0), 
					_connection.newDBDataParameter("IFLanguage_", DbType.Int32, ParameterDirection.Input, DIC_TextLanguage_in.IFLanguage, 0), 
					_connection.newDBDataParameter("Text__small_", DbType.AnsiString, ParameterDirection.Input, DIC_TextLanguage_in.Text__small_isNull ? null : (object)DIC_TextLanguage_in.Text__small, 8000), 
					_connection.newDBDataParameter("Text__large_", DbType.AnsiString, ParameterDirection.Input, DIC_TextLanguage_in.Text__large_isNull ? null : (object)DIC_TextLanguage_in.Text__large, 0), 

					//_connection.newDBDataParameter("Exists", DbType.Boolean, ParameterDirection.Output, 0, 1)
					_connection.newDBDataParameter("Output_", DbType.Int32, ParameterDirection.Output, null, 0)
				};
				_connection.Execute_SQLFunction(
					"sp0_DIC_TextLanguage_setObject", 
					_dataparameters
				);
				if (dbConnection_in == null) { _connection.Dispose(); }

				ConstraintExist_out = (((int)_dataparameters[4].Value & 2) == 1);
				if (!ConstraintExist_out) {
					DIC_TextLanguage_in.HasChanges = false;
				}

				return (((int)_dataparameters[4].Value & 1) != 1);
			} else {
				ConstraintExist_out = false;

				return  false;
			}
		}
Пример #26
0
		/// <summary>
		/// Count's number of search results from vNWS_Content at Database based on the 'generic' search.
		/// </summary>
		/// <param name="IFApplication_search_in">IFApplication search condition</param>
		/// <param name="IFUser__Publisher_search_in">IFUser__Publisher search condition</param>
		/// <param name="IFUser__Approved_search_in">IFUser__Approved search condition</param>
		/// <param name="Begin_date_search_in">Begin_date search condition</param>
		/// <param name="End_date_search_in">End_date search condition</param>
		/// <param name="IDTag_search_in">IDTag search condition</param>
		/// <param name="IDAuthor_search_in">IDAuthor search condition</param>
		/// <param name="IDSource_search_in">IDSource search condition</param>
		/// <param name="IDHighlight_search_in">IDHighlight search condition</param>
		/// <param name="IDProfile_search_in">IDProfile search condition</param>
		/// <param name="Keywords_search_in">Keywords search condition</param>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="isAND_notOR_search_in">isAND_notOR search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>number of existing Records for the 'generic' search</returns>
		public static long getCount_inRecord_generic(
			object IFApplication_search_in, 
			long IFUser__Publisher_search_in, 
			object IFUser__Approved_search_in, 
			object Begin_date_search_in, 
			object End_date_search_in, 
			object IDTag_search_in, 
			object IDAuthor_search_in, 
			object IDSource_search_in, 
			object IDHighlight_search_in, 
			object IDProfile_search_in, 
			object Keywords_search_in, 
			int IDLanguage_search_in, 
			object isAND_notOR_search_in, 
			DBConnection dbConnection_in
		) {
			long _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFApplication_search_", DbType.Int32, ParameterDirection.Input, IFApplication_search_in, 0), 
				_connection.newDBDataParameter("IFUser__Publisher_search_", DbType.Int64, ParameterDirection.Input, IFUser__Publisher_search_in, 0), 
				_connection.newDBDataParameter("IFUser__Approved_search_", DbType.Int64, ParameterDirection.Input, IFUser__Approved_search_in, 0), 
				_connection.newDBDataParameter("Begin_date_search_", DbType.DateTime, ParameterDirection.Input, Begin_date_search_in, 0), 
				_connection.newDBDataParameter("End_date_search_", DbType.DateTime, ParameterDirection.Input, End_date_search_in, 0), 
				_connection.newDBDataParameter("IDTag_search_", DbType.AnsiString, ParameterDirection.Input, IDTag_search_in, 8000), 
				_connection.newDBDataParameter("IDAuthor_search_", DbType.AnsiString, ParameterDirection.Input, IDAuthor_search_in, 8000), 
				_connection.newDBDataParameter("IDSource_search_", DbType.AnsiString, ParameterDirection.Input, IDSource_search_in, 8000), 
				_connection.newDBDataParameter("IDHighlight_search_", DbType.AnsiString, ParameterDirection.Input, IDHighlight_search_in, 8000), 
				_connection.newDBDataParameter("IDProfile_search_", DbType.AnsiString, ParameterDirection.Input, IDProfile_search_in, 8000), 
				_connection.newDBDataParameter("Keywords_search_", DbType.AnsiString, ParameterDirection.Input, Keywords_search_in, 8000), 
				_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0), 
				_connection.newDBDataParameter("isAND_notOR_search_", DbType.Boolean, ParameterDirection.Input, isAND_notOR_search_in, 0)
			};
			_output = (long)_connection.Execute_SQLFunction(
				"fnc0_vNWS_Content_Record_count_generic", 
				_dataparameters, 
				DbType.Int64,
				0
			);
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;
		}
Пример #27
0
		/// <summary>
		/// Gets Record, based on 'generic' search. It selects vNWS_Content values from Database based on the 'generic' search.
		/// </summary>
		/// <param name="IFApplication_search_in">IFApplication search condition</param>
		/// <param name="IFUser__Publisher_search_in">IFUser__Publisher search condition</param>
		/// <param name="IFUser__Approved_search_in">IFUser__Approved search condition</param>
		/// <param name="Begin_date_search_in">Begin_date search condition</param>
		/// <param name="End_date_search_in">End_date search condition</param>
		/// <param name="IDTag_search_in">IDTag search condition</param>
		/// <param name="IDAuthor_search_in">IDAuthor search condition</param>
		/// <param name="IDSource_search_in">IDSource search condition</param>
		/// <param name="IDHighlight_search_in">IDHighlight search condition</param>
		/// <param name="IDProfile_search_in">IDProfile search condition</param>
		/// <param name="Keywords_search_in">Keywords search condition</param>
		/// <param name="IDLanguage_search_in">IDLanguage search condition</param>
		/// <param name="isAND_notOR_search_in">isAND_notOR search condition</param>
		/// <param name="page_orderBy_in">page order by</param>
		/// <param name="page_in">page number</param>
		/// <param name="page_itemsPerPage_in">number of records per page</param>
		/// <param name="page_itemsCount_out">total number of items</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static SO_vNWS_Content[] getRecord_generic(
			object IFApplication_search_in, 
			long IFUser__Publisher_search_in, 
			object IFUser__Approved_search_in, 
			object Begin_date_search_in, 
			object End_date_search_in, 
			object IDTag_search_in, 
			object IDAuthor_search_in, 
			object IDSource_search_in, 
			object IDHighlight_search_in, 
			object IDProfile_search_in, 
			object Keywords_search_in, 
			int IDLanguage_search_in, 
			object isAND_notOR_search_in, 
			int page_orderBy_in, 
			long page_in, 
			int page_itemsPerPage_in, 
			out long page_itemsCount_out, 
			DBConnection dbConnection_in
		) {
			SO_vNWS_Content[] _output;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = 
				((page_in > 0) && (page_itemsPerPage_in > 0))
					? new IDbDataParameter[] {
						_connection.newDBDataParameter("IFApplication_search_", DbType.Int32, ParameterDirection.Input, IFApplication_search_in, 0), 
						_connection.newDBDataParameter("IFUser__Publisher_search_", DbType.Int64, ParameterDirection.Input, IFUser__Publisher_search_in, 0), 
						_connection.newDBDataParameter("IFUser__Approved_search_", DbType.Int64, ParameterDirection.Input, IFUser__Approved_search_in, 0), 
						_connection.newDBDataParameter("Begin_date_search_", DbType.DateTime, ParameterDirection.Input, Begin_date_search_in, 0), 
						_connection.newDBDataParameter("End_date_search_", DbType.DateTime, ParameterDirection.Input, End_date_search_in, 0), 
						_connection.newDBDataParameter("IDTag_search_", DbType.AnsiString, ParameterDirection.Input, IDTag_search_in, 8000), 
						_connection.newDBDataParameter("IDAuthor_search_", DbType.AnsiString, ParameterDirection.Input, IDAuthor_search_in, 8000), 
						_connection.newDBDataParameter("IDSource_search_", DbType.AnsiString, ParameterDirection.Input, IDSource_search_in, 8000), 
						_connection.newDBDataParameter("IDHighlight_search_", DbType.AnsiString, ParameterDirection.Input, IDHighlight_search_in, 8000), 
						_connection.newDBDataParameter("IDProfile_search_", DbType.AnsiString, ParameterDirection.Input, IDProfile_search_in, 8000), 
						_connection.newDBDataParameter("Keywords_search_", DbType.AnsiString, ParameterDirection.Input, Keywords_search_in, 8000), 
						_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0), 
						_connection.newDBDataParameter("isAND_notOR_search_", DbType.Boolean, ParameterDirection.Input, isAND_notOR_search_in, 0), 
						_connection.newDBDataParameter("page_orderBy_", DbType.Int32, ParameterDirection.Input, page_orderBy_in, 0), 
						_connection.newDBDataParameter("page_", DbType.Int64, ParameterDirection.Input, page_in, 0), 
						_connection.newDBDataParameter("page_itemsPerPage_", DbType.Int32, ParameterDirection.Input, page_itemsPerPage_in, 0), 

						//_connection.newDBDataParameter("page_itemsCount_", DbType.Int32, ParameterDirection.Output, null, 0), 

					}
					: new IDbDataParameter[] {
						_connection.newDBDataParameter("IFApplication_search_", DbType.Int32, ParameterDirection.Input, IFApplication_search_in, 0), 
						_connection.newDBDataParameter("IFUser__Publisher_search_", DbType.Int64, ParameterDirection.Input, IFUser__Publisher_search_in, 0), 
						_connection.newDBDataParameter("IFUser__Approved_search_", DbType.Int64, ParameterDirection.Input, IFUser__Approved_search_in, 0), 
						_connection.newDBDataParameter("Begin_date_search_", DbType.DateTime, ParameterDirection.Input, Begin_date_search_in, 0), 
						_connection.newDBDataParameter("End_date_search_", DbType.DateTime, ParameterDirection.Input, End_date_search_in, 0), 
						_connection.newDBDataParameter("IDTag_search_", DbType.AnsiString, ParameterDirection.Input, IDTag_search_in, 8000), 
						_connection.newDBDataParameter("IDAuthor_search_", DbType.AnsiString, ParameterDirection.Input, IDAuthor_search_in, 8000), 
						_connection.newDBDataParameter("IDSource_search_", DbType.AnsiString, ParameterDirection.Input, IDSource_search_in, 8000), 
						_connection.newDBDataParameter("IDHighlight_search_", DbType.AnsiString, ParameterDirection.Input, IDHighlight_search_in, 8000), 
						_connection.newDBDataParameter("IDProfile_search_", DbType.AnsiString, ParameterDirection.Input, IDProfile_search_in, 8000), 
						_connection.newDBDataParameter("Keywords_search_", DbType.AnsiString, ParameterDirection.Input, Keywords_search_in, 8000), 
						_connection.newDBDataParameter("IDLanguage_search_", DbType.Int32, ParameterDirection.Input, IDLanguage_search_in, 0), 
						_connection.newDBDataParameter("isAND_notOR_search_", DbType.Boolean, ParameterDirection.Input, isAND_notOR_search_in, 0)
					}
				;
			_output = getRecord(
				_connection.Execute_SQLFunction_returnDataTable(
					((page_in > 0) && (page_itemsPerPage_in > 0))
						? "sp_vNWS_Content_Record_open_generic_page"
						: "sp0_vNWS_Content_Record_open_generic", 
					_dataparameters
				)
			);
			if ((page_in > 0) && (page_itemsPerPage_in > 0)) {
				// && (_dataparameters[_dataparameters.Length - 1].Value != DBNull.Value)) {
				//page_itemsCount_out = (int)_dataparameters[_dataparameters.Length - 1].Value;

				page_itemsCount_out = getCount_inRecord_generic(
					IFApplication_search_in, 
					IFUser__Publisher_search_in, 
					IFUser__Approved_search_in, 
					Begin_date_search_in, 
					End_date_search_in, 
					IDTag_search_in, 
					IDAuthor_search_in, 
					IDSource_search_in, 
					IDHighlight_search_in, 
					IDProfile_search_in, 
					Keywords_search_in, 
					IDLanguage_search_in, 
					isAND_notOR_search_in, 
					dbConnection_in
				);
			} else {
				page_itemsCount_out = 0;
			}
			if (dbConnection_in == null) { _connection.Dispose(); }

			return _output;			
		}
Пример #28
0
		internal static long insObject_Registration(
			string login_in,
			string password_in,
			int idApplication_in,

			bool selectIdentity_in, 
			ref List<int> errorlist_in,
			DBConnection con_in
		) {
			long _output = -1L;

			// user registering
			// 

			if (!Sessionuser.checkLogin(login_in, ref errorlist_in)) {
				return _output;
			}

			bool _constraint;
			_output = DO_CRD_User.insObject(
				new SO_CRD_User(
					-1L,
					login_in,

// ToDos: here! encrypt before sending...
password_in,

					idApplication_in
				),

				selectIdentity_in,
				out _constraint, 

				con_in
			);
			if (_constraint) {
				errorlist_in.Add(ErrorType.data__constraint_violation);
			} else {
				if (con_in == null) {
					// assuming NO other (internal) operations are going on
					errorlist_in.Add(ErrorType.user__successfully_created__WARNING);
				}
			}

			return _output;
		}
Пример #29
0
		/// <summary>
		/// Deletes NWS_ContentSource values from Database based on the 'bySource' search.
		/// </summary>
		/// <param name="IDSource_search_in">IDSource search condition</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		public static void delRecord_bySource(
			long IDSource_search_in, 
			DBConnection dbConnection_in
		) {
			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDSource_search_", DbType.Int64, ParameterDirection.Input, IDSource_search_in, 0)
			};
			_connection.Execute_SQLFunction(
				"sp0_NWS_ContentSource_Record_delete_bySource", 
				_dataparameters
			);
			if (dbConnection_in == null) { _connection.Dispose(); }
		}
Пример #30
0
		/// <summary>
		/// Selects FRM_Question values from Database and assigns them to the appropriate DO_FRM_Question property.
		/// </summary>
		/// <param name="IDQuestion_in">IDQuestion</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if FRM_Question doesn't exists at Database</returns>
		public static SO_FRM_Question getObject(
			long IDQuestion_in, 
			DBConnection dbConnection_in
		) {
			SO_FRM_Question _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__Utilities.DBConnection_createInstance(
					DO__Utilities.DBServerType,
					DO__Utilities.DBConnectionstring,
					DO__Utilities.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IDQuestion_", DbType.Int64, ParameterDirection.InputOutput, IDQuestion_in, 0), 
				_connection.newDBDataParameter("IFQuestion__parent_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFQuestiontype_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("TX_Question_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("TX_Details_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IsRequired_", DbType.Boolean, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IsTemplate_", DbType.Boolean, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFUser__audit_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Date__audit_", DbType.DateTime, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_FRM_Question_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_FRM_Question();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDQuestion = 0L;
				} else {
					_output.IDQuestion = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFQuestion__parent_isNull = true;
				} else {
					_output.IFQuestion__parent = (long)_dataparameters[1].Value;
				}
				if (_dataparameters[2].Value == System.DBNull.Value) {
					_output.IFQuestiontype_isNull = true;
				} else {
					_output.IFQuestiontype = (int)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.TX_Question_isNull = true;
				} else {
					_output.TX_Question = (long)_dataparameters[3].Value;
				}
				if (_dataparameters[4].Value == System.DBNull.Value) {
					_output.TX_Details_isNull = true;
				} else {
					_output.TX_Details = (long)_dataparameters[4].Value;
				}
				if (_dataparameters[5].Value == System.DBNull.Value) {
					_output.IsRequired_isNull = true;
				} else {
					_output.IsRequired = (bool)_dataparameters[5].Value;
				}
				if (_dataparameters[6].Value == System.DBNull.Value) {
					_output.IsTemplate_isNull = true;
				} else {
					_output.IsTemplate = (bool)_dataparameters[6].Value;
				}
				if (_dataparameters[7].Value == System.DBNull.Value) {
					_output.IFApplication_isNull = true;
				} else {
					_output.IFApplication = (int)_dataparameters[7].Value;
				}
				if (_dataparameters[8].Value == System.DBNull.Value) {
					_output.IFUser__audit = 0L;
				} else {
					_output.IFUser__audit = (long)_dataparameters[8].Value;
				}
				if (_dataparameters[9].Value == System.DBNull.Value) {
					_output.Date__audit = new DateTime(1900, 1, 1);
				} else {
					_output.Date__audit = (DateTime)_dataparameters[9].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}