Ejemplo n.º 1
0
        public LastConnectionRow GetLastConnection(string machineName)
        {
            string clause = MachineNameFn.AsSqlClausePair();

            LastConnectionRow row =
                GetRows(
                    clause,
                    Lists.Of(new SQLiteParameter(MachineNameFn, machineName))
                    ).Select(RowConverter.Convert <LastConnectionRow>).FirstOrDefault();

            return(row);
        }
		private void SaveLastConnection(
			long groupId,
			long templateId
		)
		{
			ConnectionType cnnType = SelectedConnectionType;

			if (cnnType != null)
			{
				string machineName = Environment.MachineName;

				LastConnectionProtocolRow lastConnectionProt = new LastConnectionProtocolRow
				{
					GroupId     = groupId,
					TemplateId  = templateId,
					MachineName = machineName,
					DbType      = cnnType.Id
				};

				long? lastConnectionId = this._storage.LastConnectionProtocolTable
					.SaveLastConnection(lastConnectionProt);

				if (lastConnectionId != null)
				{
					LastConnectionRow lastConnectionRow = new LastConnectionRow
					{
						MachineName              = machineName,
						LastConnectionProtocolId = lastConnectionId.Value
					};

					this._storage.LastConnectionTable
						.SaveLastConnection(lastConnectionRow);
				}
			}
		}
 public void SaveLastConnection(LastConnectionRow row)
 {
     this.InsertOrUpdateRow(row);
 }
Ejemplo n.º 4
0
 public void SaveLastConnection(LastConnectionRow row)
 {
     this.InsertOrUpdateRow(row);
 }