Exemple #1
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     out int[] errors_out
     )
 {
     throw new Exception("your not calling the remoting server, but the client's remoting server implementation");
 }
Exemple #2
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     out int[] errors_out
     )
 {
     bo_.updObject(
         sessionGuid_in,
         ip_forLogPurposes_in,
         highlight_in,
         out errors_out
         );
 }
Exemple #3
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     out int[] errors_out
     )
 {
     OGen.NTier.Kick.Libraries.BusinessLayer.SBO_NWS_Highlight.updObject(
         sessionGuid_in,
         (Utilities.ResetClientIP)
                                 ? (string)System.Runtime.Remoting.Messaging.CallContext.GetData("ClientIPAddress")
                                 : ip_forLogPurposes_in,
         highlight_in,
         out errors_out
         );
 }
Exemple #4
0
 public long insObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     bool selectIdentity_in,
     out int[] errors_out
     )
 {
     return(bo_.insObject(
                sessionGuid_in,
                ip_forLogPurposes_in,
                highlight_in,
                selectIdentity_in,
                out errors_out
                ));
 }
Exemple #5
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     out int[] errors_out
     )
 {
     OGen.NTier.Kick.Libraries.BusinessLayer.SBO_NWS_Highlight.updObject(
         sessionGuid_in,
         (Utilities.ResetClientIP)
                                 ? HttpContext.Current.Request.UserHostAddress
                                 : ip_forLogPurposes_in,
         highlight_in,
         out errors_out
         );
 }
Exemple #6
0
 public void updObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     out int[] errors_out
     )
 {
     object[] results = this.Invoke(
         "updObject",
         new object[] {
         sessionGuid_in,
         ip_forLogPurposes_in,
         highlight_in
     }
         );
     errors_out = (int[])results[0];
 }
Exemple #7
0
 public long insObject(
     string sessionGuid_in,
     string ip_forLogPurposes_in,
     OGen.NTier.Kick.Libraries.DataLayer.Shared.Structures.SO_NWS_Highlight highlight_in,
     bool selectIdentity_in,
     out int[] errors_out
     )
 {
     object[] results = this.Invoke(
         "insObject",
         new object[] {
         sessionGuid_in,
         ip_forLogPurposes_in,
         highlight_in,
         selectIdentity_in
     }
         );
     errors_out = (int[])results[1];
     return((long)results[0]);
 }
Exemple #8
0
		/// <summary>
		/// Updates NWS_Highlight 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_Highlight NWS_Highlight_in, 
			bool forceUpdate_in
		) {
			updObject(
				NWS_Highlight_in, 
				forceUpdate_in, 
				null
			);
		}
Exemple #9
0
		public static DataTable getDataTable(
			SO_NWS_Highlight[] serializableObjects_in
		) {
			DataTable _output = new DataTable();
			_output.Locale = System.Globalization.CultureInfo.CurrentCulture;
			DataRow _dr;

			DataColumn _dc_idhighlight = new DataColumn("IDHighlight", typeof(long));
			_output.Columns.Add(_dc_idhighlight);
			DataColumn _dc_ifapplication = new DataColumn("IFApplication", typeof(int));
			_output.Columns.Add(_dc_ifapplication);
			DataColumn _dc_ifhighlight__parent = new DataColumn("IFHighlight__parent", typeof(long));
			_output.Columns.Add(_dc_ifhighlight__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_Highlight _serializableObject in serializableObjects_in) {
				_dr = _output.NewRow();

				_dr[_dc_idhighlight] = _serializableObject.IDHighlight;
				_dr[_dc_ifapplication] = _serializableObject.IFApplication;
				_dr[_dc_ifhighlight__parent] = _serializableObject.IFHighlight__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;
		}
Exemple #10
0
		public static long insObject(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			SO_NWS_Highlight highlight_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 highlight_in,

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

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

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

			errors_out = _errorlist.ToArray();
			return _output;
		} 
Exemple #11
0
		private static SO_NWS_Highlight[] getRecord(
			DataTable dataTable_in
		) {
			DataColumn _dc_idhighlight = null;
			DataColumn _dc_ifapplication = null;
			DataColumn _dc_ifhighlight__parent = null;
			DataColumn _dc_name = null;
			DataColumn _dc_ifuser__approved = null;
			DataColumn _dc_approved_date = null;

			SO_NWS_Highlight[] _output 
				= new SO_NWS_Highlight[dataTable_in.Rows.Count];
			for (int r = 0; r < dataTable_in.Rows.Count; r++) {
				if (r == 0) {
					_dc_idhighlight = dataTable_in.Columns["IDHighlight"];
					_dc_ifapplication = dataTable_in.Columns["IFApplication"];
					_dc_ifhighlight__parent = dataTable_in.Columns["IFHighlight__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_Highlight();
				if (dataTable_in.Rows[r][_dc_idhighlight] == System.DBNull.Value) {
					_output[r].IDHighlight = 0L;
				} else {
					_output[r].IDHighlight = (long)dataTable_in.Rows[r][_dc_idhighlight];
				}
				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_ifhighlight__parent] == System.DBNull.Value) {
					_output[r].IFHighlight__parent_isNull = true;
				} else {
					_output[r].IFHighlight__parent = (long)dataTable_in.Rows[r][_dc_ifhighlight__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;
		}
Exemple #12
0
		/// <summary>
		/// Selects NWS_Highlight values from Database and assigns them to the appropriate DO_NWS_Highlight property.
		/// </summary>
		/// <param name="IDHighlight_in">IDHighlight</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_Highlight doesn't exists at Database</returns>
		public static SO_NWS_Highlight getObject(
			long IDHighlight_in, 
			DBConnection dbConnection_in
		) {
			SO_NWS_Highlight _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("IDHighlight_", DbType.Int64, ParameterDirection.InputOutput, IDHighlight_in, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFHighlight__parent_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 100), 
				_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_Highlight_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

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

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IDHighlight = 0L;
				} else {
					_output.IDHighlight = (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.IFHighlight__parent_isNull = true;
				} else {
					_output.IFHighlight__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;
		}
Exemple #13
0
		public static void updObject(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			SO_NWS_Highlight highlight_in,

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

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

				ref highlight_in,

				out _sessionguid,
				out _sessionuser,
				out _errorlist
			)) {
				errors_out = _errorlist.ToArray();
				return;
			}
			#endregion
			#region check existence . . .
			SO_NWS_Highlight _highlight;
			if (
				highlight_in.IDHighlight <= 0
				||
				(
					(_highlight = DO_NWS_Highlight.getObject(
						highlight_in.IDHighlight
					)) == null
				)
			) {
				_errorlist.Add(ErrorType.data__not_found);
				errors_out = _errorlist.ToArray();
				return;
			}
			#endregion

			if (
				_highlight.IFUser__Approved_isNull
				||
				_highlight.Approved_date_isNull
			) {
				if (_sessionuser.hasPermission(PermissionType.Highlight__approve)) {
					highlight_in.Approved_date = DateTime.Now;
					highlight_in.IFUser__Approved = _sessionuser.IDUser;
				} else {
					highlight_in.Approved_date_isNull = true;
					highlight_in.IFUser__Approved_isNull = true;
				}
			} else {
				highlight_in.Approved_date = _highlight.Approved_date;
				highlight_in.IFUser__Approved = _highlight.IFUser__Approved;
			}

			highlight_in.IFApplication = _highlight.IFApplication;
			DO_NWS_Highlight.updObject(
				highlight_in,
				true,

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

			errors_out = _errorlist.ToArray();
		}
Exemple #14
0
		/// <summary>
		/// Updates NWS_Highlight 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_Highlight NWS_Highlight_in, 
			bool forceUpdate_in, 
			DBConnection dbConnection_in
		) {
			if (forceUpdate_in || NWS_Highlight_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("IDHighlight_", DbType.Int64, ParameterDirection.Input, NWS_Highlight_in.IDHighlight, 0), 
					_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, NWS_Highlight_in.IFApplication_isNull ? null : (object)NWS_Highlight_in.IFApplication, 0), 
					_connection.newDBDataParameter("IFHighlight__parent_", DbType.Int64, ParameterDirection.Input, NWS_Highlight_in.IFHighlight__parent_isNull ? null : (object)NWS_Highlight_in.IFHighlight__parent, 0), 
					_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Input, NWS_Highlight_in.Name, 100), 
					_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Input, NWS_Highlight_in.IFUser__Approved_isNull ? null : (object)NWS_Highlight_in.IFUser__Approved, 0), 
					_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Input, NWS_Highlight_in.Approved_date_isNull ? null : (object)NWS_Highlight_in.Approved_date, 0)
				};
				_connection.Execute_SQLFunction(
					"sp0_NWS_Highlight_updObject", 
					_dataparameters
				);
				if (dbConnection_in == null) { _connection.Dispose(); }
				NWS_Highlight_in.HasChanges = false;
			}
		}
Exemple #15
0
		/// <summary>
		/// Inserts NWS_Highlight 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_Highlight NWS_Highlight_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("IDHighlight_", DbType.Int64, ParameterDirection.Output, null, 0), 
				_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Input, NWS_Highlight_in.IFApplication_isNull ? null : (object)NWS_Highlight_in.IFApplication, 0), 
				_connection.newDBDataParameter("IFHighlight__parent_", DbType.Int64, ParameterDirection.Input, NWS_Highlight_in.IFHighlight__parent_isNull ? null : (object)NWS_Highlight_in.IFHighlight__parent, 0), 
				_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Input, NWS_Highlight_in.Name, 100), 
				_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Input, NWS_Highlight_in.IFUser__Approved_isNull ? null : (object)NWS_Highlight_in.IFUser__Approved, 0), 
				_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Input, NWS_Highlight_in.Approved_date_isNull ? null : (object)NWS_Highlight_in.Approved_date, 0), 

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

			NWS_Highlight_in.IDHighlight = (long)_dataparameters[0].Value;NWS_Highlight_in.HasChanges = false;
			

			return NWS_Highlight_in.IDHighlight;
		}
Exemple #16
0
		/// <summary>
		/// Inserts NWS_Highlight 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_Highlight NWS_Highlight_in, 
			bool selectIdentity_in
		) {
			return insObject(
				NWS_Highlight_in, 
				selectIdentity_in, 
				null
			);
		}
		private void btn_save_click(
			ref SO_NWS_Highlight highlight_ref
		) {
			highlight_ref.Name = this.TXT_Name.Text;
			#region highlight_ref.IFHighlight__parent = long.Parse(DDL_Highlight_parent.SelectedValue);
			if (string.IsNullOrEmpty(this.DDL_Highlight_parent.SelectedValue)) {
				highlight_ref.IFHighlight__parent_isNull = true;
			} else {
				//highlight_ref.IFHighlight__parent = DDL_Highlight_parent.Kick.SelectedValue__get<long>();
				highlight_ref.IFHighlight__parent = long.Parse(
					this.DDL_Highlight_parent.SelectedValue,
					System.Globalization.NumberStyles.Integer,
					System.Globalization.CultureInfo.CurrentCulture
				);
			}
			#endregion
		}
		public void BTN_Save_Click(object sender, EventArgs e) {
			int[] _errors;
			SO_NWS_Highlight _highlight;
			if (
				#region ((_highlight = ...) != null)
				(this.IDHighlight > 0)
				&&
				(
					(_highlight = BusinessInstances.NWS_Highlight.InstanceClient.getObject(
						Utilities.User.SessionGuid,
						Utilities.ClientIPAddress,
						this.IDHighlight,
						out _errors
					))
					!=
					null
				)
				&&
				!this.Master__base.Error_add(_errors)
				#endregion
			) {

				this.btn_save_click(
					ref _highlight
				);

				BusinessInstances.NWS_Highlight.InstanceClient.updObject(
					Utilities.User.SessionGuid,
					Utilities.ClientIPAddress,
					_highlight,
					out _errors
				);
			} else {
				_highlight = new SO_NWS_Highlight();

				this.btn_save_click(
					ref _highlight
				);

				_highlight.Approved_date_isNull = true;
				_highlight.IFUser__Approved_isNull = true;
				_highlight.IFApplication = Utilities.IDApplication;
				BusinessInstances.NWS_Highlight.InstanceClient.insObject(
					Utilities.User.SessionGuid,
					Utilities.ClientIPAddress,
					_highlight,
					false,
					out _errors
				);
			}
			if (!this.Master__base.Error_add(_errors)) {
				Response.Redirect(
					"NWS-NewsHighlight-list.aspx",
					true
				);
			}
		}
Exemple #19
0
		private static bool check(
			string sessionGuid_in,
			string ip_forLogPurposes_in, 

			ref SO_NWS_Highlight highlight_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.Highlight__insert,
					PermissionType.Highlight__update
				)
			) {
				errorlist_out.Add(ErrorType.highlight__lack_of_permissions_to_write);
				return false;
			}

			if (
				!sessionUser_out.hasPermission(PermissionType.Highlight__approve)
				&&
				(
					!highlight_ref.Approved_date_isNull
					||
					!highlight_ref.IFUser__Approved_isNull
				)
			) {
				errorlist_out.Add(ErrorType.highlight__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 (highlight_ref.IFHighlight__parent <= 0) {
				highlight_ref.IFHighlight__parent_isNull = true;
			}

			#region check Highlight ...
			if (
				(highlight_ref.Name = highlight_ref.Name.Trim()).Length == 0
			) {
				errorlist_out.Add(ErrorType.highlight__invalid_name);
				return false;
			}
			#endregion

			return true;
		}