Beispiel #1
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     out int[] errors_out
     )
 {
     throw new Exception("your not calling the remoting server, but the client's remoting server implementation");
 }
Beispiel #2
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     out int[] errors_out
     )
 {
     bo_.updObject(
         sessionGuid_in,
         ip_forLogPurposes_in,
         source_in,
         out errors_out
         );
 }
Beispiel #3
0
 public long insObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     bool selectIdentity_in,
     out int[] errors_out
     )
 {
     return(bo_.insObject(
                sessionGuid_in,
                ip_forLogPurposes_in,
                source_in,
                selectIdentity_in,
                out errors_out
                ));
 }
Beispiel #4
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     out int[] errors_out
     )
 {
     OGen.NTier.Kick.Libraries.BusinessLayer.SBO_NWS_Source.updObject(
         sessionGuid_in,
         (Utilities.ResetClientIP)
                                 ? HttpContext.Current.Request.UserHostAddress
                                 : ip_forLogPurposes_in,
         source_in,
         out errors_out
         );
 }
Beispiel #5
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     out int[] errors_out
     )
 {
     OGen.NTier.Kick.Libraries.BusinessLayer.SBO_NWS_Source.updObject(
         sessionGuid_in,
         (Utilities.ResetClientIP)
                                 ? (string)System.Runtime.Remoting.Messaging.CallContext.GetData("ClientIPAddress")
                                 : ip_forLogPurposes_in,
         source_in,
         out errors_out
         );
 }
Beispiel #6
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     out int[] errors_out
     )
 {
     object[] results = this.Invoke(
         "updObject",
         new object[] {
         sessionGuid_in,
         ip_forLogPurposes_in,
         source_in
     }
         );
     errors_out = (int[])results[0];
 }
Beispiel #7
0
 public long insObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Source source_in,
     bool selectIdentity_in,
     out int[] errors_out
     )
 {
     object[] results = this.Invoke(
         "insObject",
         new object[] {
         sessionGuid_in,
         ip_forLogPurposes_in,
         source_in,
         selectIdentity_in
     }
         );
     errors_out = (int[])results[1];
     return((long)results[0]);
 }
Beispiel #8
0
		/// <summary>
		/// Selects NWS_Source values from Database and assigns them to the appropriate DO_NWS_Source property.
		/// </summary>
		/// <param name="IDSource_in">IDSource</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_Source doesn't exists at Database</returns>
		public static SO_NWS_Source getObject(
			long IDSource_in, 
			DBConnection dbConnection_in
		) {
			SO_NWS_Source _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("IDSource_", DbType.Int64, ParameterDirection.InputOutput, IDSource_in, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFSource__parent_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 255), 
				_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Output, null, 0)
			};
			_connection.Execute_SQLFunction("sp0_NWS_Source_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

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

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDSource = 0L;
				} else {
					_output.IDSource = (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.IFSource__parent_isNull = true;
				} else {
					_output.IFSource__parent = (long)_dataparameters[2].Value;
				}
				if (_dataparameters[3].Value == System.DBNull.Value) {
					_output.Name = string.Empty;
				} else {
					_output.Name = (string)_dataparameters[3].Value;
				}
				if (_dataparameters[4].Value == System.DBNull.Value) {
					_output.IFUser__Approved_isNull = true;
				} else {
					_output.IFUser__Approved = (long)_dataparameters[4].Value;
				}
				if (_dataparameters[5].Value == System.DBNull.Value) {
					_output.Approved_date_isNull = true;
				} else {
					_output.Approved_date = (DateTime)_dataparameters[5].Value;
				}

				_output.HasChanges = false;
				return _output;
			}

			return null;
		}
Beispiel #9
0
		private static SO_NWS_Source[] getRecord(
			DataTable dataTable_in
		) {
			DataColumn _dc_idsource = null;
			DataColumn _dc_ifapplication = null;
			DataColumn _dc_ifsource__parent = null;
			DataColumn _dc_name = null;
			DataColumn _dc_ifuser__approved = null;
			DataColumn _dc_approved_date = null;

			SO_NWS_Source[] _output 
				= new SO_NWS_Source[dataTable_in.Rows.Count];
			for (int r = 0; r < dataTable_in.Rows.Count; r++) {
				if (r == 0) {
					_dc_idsource = dataTable_in.Columns["IDSource"];
					_dc_ifapplication = dataTable_in.Columns["IFApplication"];
					_dc_ifsource__parent = dataTable_in.Columns["IFSource__parent"];
					_dc_name = dataTable_in.Columns["Name"];
					_dc_ifuser__approved = dataTable_in.Columns["IFUser__Approved"];
					_dc_approved_date = dataTable_in.Columns["Approved_date"];
				}

				_output[r] = new SO_NWS_Source();
				if (dataTable_in.Rows[r][_dc_idsource] == System.DBNull.Value) {
					_output[r].IDSource = 0L;
				} else {
					_output[r].IDSource = (long)dataTable_in.Rows[r][_dc_idsource];
				}
				if (dataTable_in.Rows[r][_dc_ifapplication] == System.DBNull.Value) {
					_output[r].IFApplication_isNull = true;
				} else {
					_output[r].IFApplication = (int)dataTable_in.Rows[r][_dc_ifapplication];
				}
				if (dataTable_in.Rows[r][_dc_ifsource__parent] == System.DBNull.Value) {
					_output[r].IFSource__parent_isNull = true;
				} else {
					_output[r].IFSource__parent = (long)dataTable_in.Rows[r][_dc_ifsource__parent];
				}
				if (dataTable_in.Rows[r][_dc_name] == System.DBNull.Value) {
					_output[r].Name = string.Empty;
				} else {
					_output[r].Name = (string)dataTable_in.Rows[r][_dc_name];
				}
				if (dataTable_in.Rows[r][_dc_ifuser__approved] == System.DBNull.Value) {
					_output[r].IFUser__Approved_isNull = true;
				} else {
					_output[r].IFUser__Approved = (long)dataTable_in.Rows[r][_dc_ifuser__approved];
				}
				if (dataTable_in.Rows[r][_dc_approved_date] == System.DBNull.Value) {
					_output[r].Approved_date_isNull = true;
				} else {
					_output[r].Approved_date = (DateTime)dataTable_in.Rows[r][_dc_approved_date];
				}

				_output[r].HasChanges = false;
			}

			return _output;
		}
Beispiel #10
0
		/// <summary>
		/// Updates NWS_Source 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_NWS_Source NWS_Source_in, 
			bool forceUpdate_in, 
			DBConnection dbConnection_in
		) {
			if (forceUpdate_in || NWS_Source_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("IDSource_", DbType.Int64, ParameterDirection.Input, NWS_Source_in.IDSource, 0), 
					_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, NWS_Source_in.IFApplication_isNull ? null : (object)NWS_Source_in.IFApplication, 0), 
					_connection.newDBDataParameter("IFSource__parent_", DbType.Int64, ParameterDirection.Input, NWS_Source_in.IFSource__parent_isNull ? null : (object)NWS_Source_in.IFSource__parent, 0), 
					_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Input, NWS_Source_in.Name, 255), 
					_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Input, NWS_Source_in.IFUser__Approved_isNull ? null : (object)NWS_Source_in.IFUser__Approved, 0), 
					_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Input, NWS_Source_in.Approved_date_isNull ? null : (object)NWS_Source_in.Approved_date, 0)
				};
				_connection.Execute_SQLFunction(
					"sp0_NWS_Source_updObject", 
					_dataparameters
				);
				if (dbConnection_in == null) { _connection.Dispose(); }
				NWS_Source_in.HasChanges = false;
			}
		}
Beispiel #11
0
		/// <summary>
		/// Updates NWS_Source 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>
		public static void updObject(
			SO_NWS_Source NWS_Source_in, 
			bool forceUpdate_in
		) {
			updObject(
				NWS_Source_in, 
				forceUpdate_in, 
				null
			);
		}
Beispiel #12
0
		public static void updObject(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			SO_NWS_Source source_in,

			out int[] errors_out
		) {
			Guid _sessionguid;
			Sessionuser _sessionuser;

			#region check...
			List<int> _errorlist;
			if (!check(
				sessionGuid_in,
				ip_forLogPurposes_in,

				ref source_in,

				out _sessionguid,
				out _sessionuser,
				out _errorlist
			)) {
				errors_out = _errorlist.ToArray();
				return;
			}
			#endregion
			#region check existence . . .
			SO_NWS_Source _source;
			if (
				source_in.IDSource <= 0
				||
				(
					(_source = DO_NWS_Source.getObject(
						source_in.IDSource
					)) == null
				)
			) {
				_errorlist.Add(ErrorType.data__not_found);
				errors_out = _errorlist.ToArray();
				return;
			}
			#endregion

			if (
				_source.IFUser__Approved_isNull
				||
				_source.Approved_date_isNull
			) {
				if (_sessionuser.hasPermission(PermissionType.Source__approve)) {
					source_in.Approved_date = DateTime.Now;
					source_in.IFUser__Approved = _sessionuser.IDUser;
				} else {
					source_in.Approved_date_isNull = true;
					source_in.IFUser__Approved_isNull = true;
				}
			} else {
				source_in.Approved_date = _source.Approved_date;
				source_in.IFUser__Approved = _source.IFUser__Approved;
			}

			source_in.IFApplication = _source.IFApplication;
			DO_NWS_Source.updObject(
				source_in,
				true,

				null
			);
			_errorlist.Add(ErrorType.source__successfully_updated__WARNING);

			errors_out = _errorlist.ToArray();
		}
Beispiel #13
0
		private void btn_save_click(
			ref SO_NWS_Source source_ref
		) {
			source_ref.Name = this.TXT_Name.Text;
			#region source_ref.IFSource__parent = long.Parse(this.DDL_Source_parent.SelectedValue);
			if (string.IsNullOrEmpty(this.DDL_Source_parent.SelectedValue)) {
				source_ref.IFSource__parent_isNull = true;
			} else {
				//source_ref.IFSource__parent = DDL_Source_parent.Kick.SelectedValue__get<long>();
				source_ref.IFSource__parent = long.Parse(
					this.DDL_Source_parent.SelectedValue,
					System.Globalization.NumberStyles.Integer,
					System.Globalization.CultureInfo.CurrentCulture
				);
			}
			#endregion
		}
Beispiel #14
0
		public static DataTable getDataTable(
			SO_NWS_Source[] serializableObjects_in
		) {
			DataTable _output = new DataTable();
			_output.Locale = System.Globalization.CultureInfo.CurrentCulture;
			DataRow _dr;

			DataColumn _dc_idsource = new DataColumn("IDSource", typeof(long));
			_output.Columns.Add(_dc_idsource);
			DataColumn _dc_ifapplication = new DataColumn("IFApplication", typeof(int));
			_output.Columns.Add(_dc_ifapplication);
			DataColumn _dc_ifsource__parent = new DataColumn("IFSource__parent", typeof(long));
			_output.Columns.Add(_dc_ifsource__parent);
			DataColumn _dc_name = new DataColumn("Name", typeof(string));
			_output.Columns.Add(_dc_name);
			DataColumn _dc_ifuser__approved = new DataColumn("IFUser__Approved", typeof(long));
			_output.Columns.Add(_dc_ifuser__approved);
			DataColumn _dc_approved_date = new DataColumn("Approved_date", typeof(DateTime));
			_output.Columns.Add(_dc_approved_date);

			foreach (SO_NWS_Source _serializableObject in serializableObjects_in) {
				_dr = _output.NewRow();

				_dr[_dc_idsource] = _serializableObject.IDSource;
				_dr[_dc_ifapplication] = _serializableObject.IFApplication;
				_dr[_dc_ifsource__parent] = _serializableObject.IFSource__parent;
				_dr[_dc_name] = _serializableObject.Name;
				_dr[_dc_ifuser__approved] = _serializableObject.IFUser__Approved;
				_dr[_dc_approved_date] = _serializableObject.Approved_date;

				_output.Rows.Add(_dr);
			}

			return _output;
		}
Beispiel #15
0
		private static bool check(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			ref SO_NWS_Source source_ref,

			out Guid sessionGuid_out,
			out Sessionuser sessionUser_out,
			out List<int> errorlist_out
		) {
			#region check...
			if (!SBO_CRD_Authentication.isSessionGuid_valid(
				sessionGuid_in,
				ip_forLogPurposes_in,
				out sessionGuid_out,
				out sessionUser_out,
				out errorlist_out
			)) {
				return false;
			}
			#endregion
			#region check Permissions . . .
			if (
				!sessionUser_out.hasPermission(
					false, 
					PermissionType.Source__insert,
					PermissionType.Source__update
				)
			) {
				errorlist_out.Add(ErrorType.source__lack_of_permissions_to_write);
				return false;
			}

			if (
				!sessionUser_out.hasPermission(PermissionType.Source__approve)
				&&
				(
					!source_ref.Approved_date_isNull
					||
					!source_ref.IFUser__Approved_isNull
				)
			) {
				errorlist_out.Add(ErrorType.source__lack_of_permissions_to_approve);
				return false;
			}
			#endregion

			// ToDos: here! check parent existence
			// ToDos: here! check if parent within same application
			// ToDos: here! check if any other checkings needed ...
			if (source_ref.IFSource__parent <= 0) {
				source_ref.IFSource__parent_isNull = true;
			}

			#region check Source ...
			if (
				(source_ref.Name = source_ref.Name.Trim()).Length == 0
			) {
				errorlist_out.Add(ErrorType.source__invalid_name);
				return false;
			}
			#endregion

			return true;
		} 
Beispiel #16
0
		public void BTN_Save_Click(object sender, EventArgs e) {
			int[] _errors;
			SO_NWS_Source _source;
			if (
				#region ((_source = ...) != null)
				(this.IDSource > 0)
				&&
				(
					(_source = BusinessInstances.NWS_Source.InstanceClient.getObject(
						Utilities.User.SessionGuid,
						Utilities.ClientIPAddress,
						this.IDSource,
						out _errors
					))
					!=
					null
				)
				&&
				!this.Master__base.Error_add(_errors)
				#endregion
			) {

				this.btn_save_click(
					ref _source
				);

				BusinessInstances.NWS_Source.InstanceClient.updObject(
					Utilities.User.SessionGuid,
					Utilities.ClientIPAddress,
					_source,
					out _errors
				);
			} else {
				_source = new SO_NWS_Source();

				this.btn_save_click(
					ref _source
				);

				_source.Approved_date_isNull = true;
				_source.IFUser__Approved_isNull = true;
				_source.IFApplication = Utilities.IDApplication;
				BusinessInstances.NWS_Source.InstanceClient.insObject(
					Utilities.User.SessionGuid,
					Utilities.ClientIPAddress,
					_source,
					false,
					out _errors
				);
			}
			if (!this.Master__base.Error_add(_errors)) {
				Response.Redirect(
					"NWS-NewsSource-list.aspx",
					true
				);
			}
		}
Beispiel #17
0
		/// <summary>
		/// Inserts NWS_Source 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>
		/// <returns>insertion sequence/identity seed</returns>
		public static long insObject(
			SO_NWS_Source NWS_Source_in, 
			bool selectIdentity_in
		) {
			return insObject(
				NWS_Source_in, 
				selectIdentity_in, 
				null
			);
		}
Beispiel #18
0
		/// <summary>
		/// Inserts NWS_Source 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_NWS_Source NWS_Source_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("IDSource_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, NWS_Source_in.IFApplication_isNull ? null : (object)NWS_Source_in.IFApplication, 0), 
				_connection.newDBDataParameter("IFSource__parent_", DbType.Int64, ParameterDirection.Input, NWS_Source_in.IFSource__parent_isNull ? null : (object)NWS_Source_in.IFSource__parent, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Input, NWS_Source_in.Name, 255), 
				_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Input, NWS_Source_in.IFUser__Approved_isNull ? null : (object)NWS_Source_in.IFUser__Approved, 0), 
				_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Input, NWS_Source_in.Approved_date_isNull ? null : (object)NWS_Source_in.Approved_date, 0), 

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

			NWS_Source_in.IDSource = (long)_dataparameters[0].Value;NWS_Source_in.HasChanges = false;
			

			return NWS_Source_in.IDSource;
		}
Beispiel #19
0
		public static long insObject(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			SO_NWS_Source source_in, 
			bool selectIdentity_in, 

			out int[] errors_out
		) {
			long _output = -1L;

			Guid _sessionguid;
			Sessionuser _sessionuser;

			#region check...
			List<int> _errorlist;
			if (!check(
				sessionGuid_in,
				ip_forLogPurposes_in, 

				ref source_in, 

				out _sessionguid,
				out _sessionuser,
				out _errorlist
			)) {
				errors_out = _errorlist.ToArray();
				return _output;
			} 
			#endregion

			if (_sessionuser.hasPermission(PermissionType.Source__approve)) {
				source_in.Approved_date = DateTime.Now;
				source_in.IFUser__Approved = _sessionuser.IDUser;
			} else {
				source_in.Approved_date_isNull = true;
				source_in.IFUser__Approved_isNull = true;
			}
			source_in.IFApplication = _sessionuser.IDApplication;
			_output = DO_NWS_Source.insObject(
				source_in,
				selectIdentity_in,

				null
			);
			_errorlist.Add(ErrorType.source__successfully_created__WARNING);

			errors_out = _errorlist.ToArray();
			return _output;
		}