public static RFeedback Db_CreateRow(this ICsspFeedback packet, RIdentity owner)
		{
			var feedback = owner.DataSet.RFeedbacks.NewRow();
			packet.CopyTo(feedback);
			feedback.RIdentity = owner;
			feedback.Table.Add(feedback);

			owner.RFeedbackCount++;

			return feedback;
		}
		public static RLog Db_CreateRow(this ICsspLog packet, RIdentity owner)
		{
			var log = owner.DataSet.RLogs.NewRow();
			packet.CopyTo(log);
			log.RIdentity = owner;
			log.Table.Add(log);

			owner.RLogCount++;

			return log;
		}
		public static RException Db_CreateRow(this ICsspException packet, RIdentity owner)
		{
			var exception = owner.DataSet.RExceptions.NewRow();
			packet.CopyTo(exception);

			exception.RIdentity = owner;
			exception.Table.Add(exception);

			owner.RExceptionCount++;

			return exception;
		}
示例#4
0
		private void ProcessPacket(CssPacket packet)
		{
			if (packet is CsspIdentity)
			{
				bool created;
				Identity = ((CsspIdentity) packet).Db_GetOrCreate(CsoContext.Db, out created);

				if (created)
				{
					PostAction_Append(() => Identity.Db_Notify_CauseCreated(_urlHelper.Action("View", "RIdentity", new {Identity.Id}, _urlHelper.RequestContext.HttpContext.Request.Url.Scheme)));
					_notifycationCreated = true;
				}

				((CsspIdentity) packet).InnerPackets.ForEach(ProcessPacket);
			}
			else if (packet is CsspException)
			{
				var parsedPacket = (CsspException) packet;
				var rException = parsedPacket.Db_CreateRow(Identity);
				PostAction_Append(() => rException.Db_Notify_CauseCreated(_urlHelper.Action("View", "RException", new { rException.Id }, _urlHelper.RequestContext.HttpContext.Request.Url.Scheme)));
				PostAction_Append(() => RemoteUpdates.Send.IdentityExceptionsChanged(Identity));
				_notifycationCreated = true;
			}
			else if (packet is CsspLog)
			{
				var parsedPacket = (CsspLog) packet;
				var rLog = parsedPacket.Db_CreateRow(Identity);

				if (rLog.Severity == CsspLog.LogSeverity.Priority)
					PostAction_Append(() => rLog.Db_Notify_CauseCreated(_urlHelper.Action("View", "RLog", new { rLog.Id }, _urlHelper.RequestContext.HttpContext.Request.Url.Scheme)));

				PostAction_Append(() => RemoteUpdates.Send.IdentityLogsChanged(Identity));
				_notifycationCreated = true;
			}
			else if (packet is CsspFeedback)
			{
				var parsedPacket = (CsspFeedback) packet;
				var rFeedback = parsedPacket.Db_CreateRow(Identity);

				PostAction_Append(() => rFeedback.Db_Notify_CauseCreated(_urlHelper.Action("View", "RFeedback", new { rFeedback.Id }, _urlHelper.RequestContext.HttpContext.Request.Url.Scheme)));

				PostAction_Append(() => RemoteUpdates.Send.IdentityFeedbacksChanged(Identity));
				_notifycationCreated = true;
			}
			else if (packet is CsspInfoIdentity)
			{
				((CsspInfoIdentity) packet).Db_Apply(Identity);
			}
			else if (packet is CsspInfoApplication)
			{
				((CsspInfoApplication) packet).Db_Apply(Identity.ApplicationRelease.Application);
			}
			else if (packet is CsspInfoComputer)
			{
				((CsspInfoComputer) packet).Db_Apply(Identity.RUser.RComputer);
			}
			else if (packet is CsspInfoUser)
			{
				((CsspInfoUser) packet).Db_Apply(Identity.RUser);
			}
		}
示例#5
0
		public ViewModel(RIdentity identity)
		{
			Identity = identity;
			ComputerViewModel = new RComputerModel.ViewModel(identity.RUser.RComputer);
			UserViewModel = new RUserModels.ViewModel(identity.RUser);
		}
		public static void Db_Apply(this ICsspInfoIdentity packet, RIdentity identity)
		{
			packet.CopyTo(identity);
		}
示例#7
0
		private static DefaultHtmlMail.Part GetPartWithDetails(string title, DateTime time,  RIdentity identity)
		{
			return new DefaultHtmlMail.Part
			{
				Title = title,
				Message = $"Datum: {time}" + "\r\n" +
						$"Applikation: {identity.ApplicationRelease}" + "\r\n" +
						$"Computer/User: {identity.RUser.RComputer.Name}/{identity.RUser.Name} ({identity.RUser.FullName})" + "\r\n\r\n" +
						$"Startups: {identity.StartupCount}" + "\r\n" +
						$"Benutzungsdauer: {identity.UsageTime.ToString("hh\\:mm\\:ss")}"
			};
		}