internal SmiQueryMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3, bool allowsDBNull, string serverName, string catalogName, string schemaName, string tableName, string columnName, SqlBoolean isKey, bool isIdentity, bool isColumnSet, bool isReadOnly, SqlBoolean isExpression, SqlBoolean isAliased, SqlBoolean isHidden) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties, name, typeSpecificNamePart1, typeSpecificNamePart2, typeSpecificNamePart3, allowsDBNull, serverName, catalogName, schemaName, tableName, columnName, isKey, isIdentity, isColumnSet)
 {
     this._isReadOnly = isReadOnly;
     this._isExpression = isExpression;
     this._isAliased = isAliased;
     this._isHidden = isHidden;
 }
Esempio n. 2
0
        public void And()
        {
            SqlBoolean SqlTrue2 = new SqlBoolean(true);
            SqlBoolean SqlFalse2 = new SqlBoolean(false);

            // One result value
            SqlBoolean sqlResult;

            // true && false
            sqlResult = SqlBoolean.And(_sqlTrue, _sqlFalse);
            Assert.True(!sqlResult.Value);
            sqlResult = SqlBoolean.And(_sqlFalse, _sqlTrue);
            Assert.True(!sqlResult.Value);

            // true && true
            sqlResult = SqlBoolean.And(_sqlTrue, SqlTrue2);
            Assert.True(sqlResult.Value);

            sqlResult = SqlBoolean.And(_sqlTrue, _sqlTrue);
            Assert.True(sqlResult.Value);

            // false && false
            sqlResult = SqlBoolean.And(_sqlFalse, SqlFalse2);
            Assert.True(!sqlResult.Value);
            sqlResult = SqlBoolean.And(_sqlFalse, _sqlFalse);
            Assert.True(!sqlResult.Value);
        }
Esempio n. 3
0
		public void GetReady() {
			
			Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
			SqlTrue = new SqlBoolean(true);
			SqlFalse = new SqlBoolean(false);

		}
Esempio n. 4
0
		public void And() {

			SqlBoolean SqlTrue2 = new SqlBoolean(true);
			SqlBoolean SqlFalse2 = new SqlBoolean(false);

			// One result value
			SqlBoolean sqlResult;

			// true && false
			sqlResult = SqlBoolean.And(SqlTrue, SqlFalse);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (true && false)");
			sqlResult = SqlBoolean.And(SqlFalse, SqlTrue);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && true)");

			// true && true
			sqlResult = SqlBoolean.And(SqlTrue, SqlTrue2);
			Assert.IsTrue (sqlResult.Value, "And method does not work correctly (true && true)");

			sqlResult = SqlBoolean.And(SqlTrue, SqlTrue);
			Assert.IsTrue (sqlResult.Value, "And method does not work correctly (true && true2)");

			// false && false
			sqlResult = SqlBoolean.And(SqlFalse, SqlFalse2);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && false)");
			sqlResult = SqlBoolean.And(SqlFalse, SqlFalse);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && false2)");

		}
Esempio n. 5
0
        public static void ChangeContainerPublicAccessMethod(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,            
            SqlGuid LeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Enumerations.ContainerPublicReadAccess cpraNew;
            if (!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
            {
                StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
                foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
                    sb.Append("\"" + s + "\" ");
                throw new ArgumentException(sb.ToString());
            }

            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);

            Enumerations.ContainerPublicReadAccess cpra;
            SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
Esempio n. 6
0
        public static void AddContainerACL(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,
            SqlString accessPolicyId,
            SqlDateTime start, SqlDateTime expiry,
            SqlBoolean canRead,
            SqlBoolean canWrite,
            SqlBoolean canDeleteBlobs,
            SqlBoolean canListBlobs,
            SqlGuid LeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Enumerations.ContainerPublicReadAccess cpraNew;
            if(!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
            {
                StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
                foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
                    sb.Append("\"" + s + "\" ");
                throw new ArgumentException(sb.ToString());
            }

            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);

            Enumerations.ContainerPublicReadAccess cpra;
            SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            string strPermissions = "";
            if (canRead.IsTrue)
                strPermissions += "r";
            if (canWrite.IsTrue)
                strPermissions += "w";
            if (canDeleteBlobs.IsTrue)
                strPermissions += "d";
            if (canListBlobs.IsTrue)
                strPermissions += "l";

            SharedAccessSignature.AccessPolicy ap = new SharedAccessSignature.AccessPolicy()
            {
                Start = start.Value,
                Expiry = expiry.Value,
                Permission = strPermissions
            };

            sasACL.SignedIdentifier.Add(new SharedAccessSignature.SignedIdentifier()
                {
                    AccessPolicy = ap,
                    Id = accessPolicyId.Value
                });

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
		public void GetReady() {
			
			Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-US";
			SqlTrue = new SqlBoolean(true);
			SqlFalse = new SqlBoolean(false);

		}
Esempio n. 8
0
        public void Accumulate(string value, string delimiter)
        {
            // if this is the first value => get it
            if (!this.hasValue)
            {
                this.result.Append(value);
            }

            // if the result is null => leave it as is
            else if (string.IsNullOrEmpty(this.result.ToString()))
            {
            }

            // if the new value is null => do not add it to the resulting string
            else if (string.IsNullOrEmpty(value))
            {
            }

            // in all other cases append the delimiter and value to the result
            else
            {
                this.result.Append(delimiter);
                this.result.Append(value);
            }

            // mark that the result already contains some value
            this.hasValue = true;
        }
Esempio n. 9
0
        public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords,
            SqlInt32 sortType, SqlInt32 count, SqlInt32 dimension, SqlString algorithm, SqlBoolean hasIncomparable)
        {
            try
            {
                Type strategyType = Type.GetType("prefSQL.SQLSkyline." + algorithm.ToString());

                if (!typeof (SkylineStrategy).IsAssignableFrom(strategyType))
                {
                    throw new Exception("passed algorithm is not of type SkylineStrategy.");
                }

                var strategy = (SkylineStrategy) Activator.CreateInstance(strategyType);

                strategy.Provider = Helper.ProviderClr;
                strategy.ConnectionString = Helper.CnnStringSqlclr;
                strategy.RecordAmountLimit = numberOfRecords.Value;
                strategy.HasIncomparablePreferences = hasIncomparable.Value;
                strategy.SortType = sortType.Value;

                var skylineSample = new SkylineSampling
                {
                    SubsetCount = count.Value,
                    SubsetDimension = dimension.Value,
                    SelectedStrategy = strategy
                };

                DataTable dataTableReturn = skylineSample.GetSkylineTable(strQuery.ToString(), strOperators.ToString());
                SqlDataRecord dataRecordTemplate = skylineSample.DataRecordTemplateForStoredProcedure;

                //throw new Exception(dataTableReturn.Rows[0].Table.Columns.Count.ToString());

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.SendResultsStart(dataRecordTemplate);

                    foreach (DataRow recSkyline in dataTableReturn.Rows)
                    {
                        for (var i = 0; i < recSkyline.Table.Columns.Count; i++)
                        {
                            dataRecordTemplate.SetValue(i, recSkyline[i]);
                        }
                        SqlContext.Pipe.SendResultsRow(dataRecordTemplate);
                    }
                    SqlContext.Pipe.SendResultsEnd();
                }
            }
            catch (Exception ex)
            {
                //Pack Errormessage in a SQL and return the result
                var strError = "Error in prefSQL_SkylineSampling: ";
                strError += ex.Message;

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.Send(strError);
                }
            }
        }
Esempio n. 10
0
 public static void CreateTable(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlString xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ats.CreateTable(tableName.Value, xmsclientrequestId != null ? xmsclientrequestId.Value : null);
 }
Esempio n. 11
0
        public static void AddInputEndpointToPersistentVM(
            SqlString certificateThumbprint,
            SqlGuid sgSubscriptionId,
            SqlString serviceName,
            SqlString deploymentSlots,
            SqlString vmName,
            SqlString EndpointName,
            SqlInt32 LocalPort,
            SqlBoolean EnableDirectServerReturn,
            SqlInt32 Port,
            SqlString Protocol,
            SqlString Vip,
            SqlBoolean fBlocking)
        {
            X509Certificate2 certificate = RetrieveCertificateInStore(certificateThumbprint.Value);
            Azure.Management.Deployment result = Azure.Internal.Management.GetDeployments(
                certificate,
                sgSubscriptionId.Value,
                serviceName.Value,
                deploymentSlots.Value);

            var vmToAdd = (ITPCfSQL.Azure.Management.PersistentVMRole)result.RoleList.FirstOrDefault(item => item.RoleName.Equals(vmName.Value, StringComparison.InvariantCultureIgnoreCase));

            if (vmToAdd == null)
                throw new ArgumentException("No PersistentVMRole with name " + vmName.Value + " found in sgSubscriptionId = " +
                    sgSubscriptionId.Value + ", serviceName = " + serviceName.Value + ", deploymentSlots = "
                    + deploymentSlots.Value + ".");

            ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint[] driiesTemp = new
                    ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint[vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints.Length + 1];

            Array.Copy(vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints, driiesTemp, vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints.Length);

            driiesTemp[driiesTemp.Length - 1] = new ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint()
            {
                Name = EndpointName.Value,
                LocalPort = LocalPort.Value,
                EnableDirectServerReturn = EnableDirectServerReturn.Value,
                Port = Port.Value,
                Protocol = Protocol.Value,
                Vip = Vip.Value
            };

            vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints = driiesTemp;

            var output = ITPCfSQL.Azure.Internal.Management.UpdatePersistentVMRole(
                certificate,
                sgSubscriptionId.Value,
                serviceName.Value,
                result.Name,
                vmToAdd);

            PushOperationStatus(
                certificate,
                sgSubscriptionId.Value,
                new Guid(output[ITPCfSQL.Azure.Internal.Constants.HEADER_REQUEST_ID]),
                fBlocking.IsNull ? false : fBlocking.Value);
        }
Esempio n. 12
0
 public static void GetRanking(SqlString strQuery, SqlString strSelectExtremas, SqlInt32 numberOfRecords, SqlString strRankingWeights, SqlString strRankingExpressions, SqlBoolean showInternalAttr, SqlString strColumnNames)
 {
     SPRanking ranking = new SPRanking();
     ranking.Provider = Helper.ProviderClr;
     ranking.ConnectionString = Helper.CnnStringSqlclr;
     ranking.RecordAmountLimit = numberOfRecords.Value;
     ranking.ShowInternalAttributes = showInternalAttr.Value;
     ranking.GetRankingTable(strQuery.ToString(), false, strSelectExtremas.ToString(), strRankingWeights.ToString(), strRankingExpressions.ToString(), strColumnNames.ToString());
 }
Esempio n. 13
0
    public static void FillRowFromExtraAndMissingNuc(object tableTypeObject, out SqlInt64 inDelStartPos, out SqlBoolean inDel, out SqlInt32 chainLen, out SqlString nucChain)
    {
        var tableType = (InDelRow)tableTypeObject;

        inDelStartPos = tableType.InDelStartPos;
        inDel = tableType.InDel;
        chainLen = tableType.ChainLen;
        nucChain = tableType.NucChain;
    }
Esempio n. 14
0
 public static void DropTable(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlGuid xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ats.GetTable(tableName.Value).Drop(
         xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
 }
Esempio n. 15
0
        public void Create()
        {
            SqlBoolean SqlTrue2 = new SqlBoolean(1);
            SqlBoolean SqlFalse2 = new SqlBoolean(0);

            Assert.True(_sqlTrue.Value);
            Assert.True(SqlTrue2.Value);
            Assert.True(!_sqlFalse.Value);
            Assert.True(!SqlFalse2.Value);
        }
Esempio n. 16
0
 public static void CreateQueue(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString queueName,
     SqlInt32 timeoutSeconds,
     SqlGuid xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureQueueService aqs = new AzureQueueService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     aqs.CreateQueue(queueName.Value, timeoutSeconds.Value,
         xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
 }
		public void Create ()
			{
				SqlBoolean SqlTrue2 = new SqlBoolean(1);
				SqlBoolean SqlFalse2 = new SqlBoolean(0);

				Assert("Creation of SqlBoolean failed", SqlTrue.Value);
				Assert("Creation of SqlBoolean failed", SqlTrue2.Value);
				Assert("Creation of SqlBoolean failed", !SqlFalse.Value);
				Assert("Creation of SqlBoolean failed", !SqlFalse2.Value);

			}
        public static SqlString RegExReplace(SqlString input, SqlString pattern, SqlString replacement, SqlBoolean ignoreCase)
        {
            //If either input is NULL, return NULL
            if (input.IsNull || pattern.IsNull)
            {
                return SqlString.Null;
            }

            //Execute the regular expression and return the result
            return new SqlString(Regex.Replace(input.Value, pattern.Value, replacement.Value, ignoreCase.Value ? RegexOptions.IgnoreCase : RegexOptions.None));
        }
Esempio n. 19
0
		public void Create ()
		{
			SqlBoolean SqlTrue2 = new SqlBoolean(1);
			SqlBoolean SqlFalse2 = new SqlBoolean(0);

			Assert.IsTrue (SqlTrue.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (SqlTrue2.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (!SqlFalse.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (!SqlFalse2.Value, "Creation of SqlBoolean failed");

		}
        public static IEnumerable RegExMatches(SqlString input, SqlString pattern, SqlBoolean ignoreCase)
        {
            //If either input is NULL, return NULL
            if (input.IsNull || pattern.IsNull)
            {
                return null;
            }

            //Execute the regular expression and return the result
            return Regex.Matches(input.Value, pattern.Value, ignoreCase.Value ? RegexOptions.IgnoreCase : RegexOptions.None);
        }
Esempio n. 21
0
        public static void CreateActivity(SqlString url, SqlString username, SqlString password, SqlString token, SqlDateTime createdDT, SqlBoolean externalMessage, SqlString employeeId, SqlString actUrl, SqlString actTitle, SqlString actBody)
        {
            IChatterSoapService service = new ChatterSoapService(url.Value);
            service.AllowUntrustedConnection();
            service.Login(username.Value, password.Value, token.Value);

            service.CreateProfileActivity(employeeId.IsNull ? null : employeeId.Value, actUrl.IsNull ? null : actUrl.Value, actTitle.IsNull ? null : actTitle.Value, actBody.IsNull ? null : actBody.Value, createdDT.Value);
            if (externalMessage.IsTrue)
            {
                service.CreateExternalMessage(actUrl.IsNull ? null : actUrl.Value, actTitle.IsNull ? null : actTitle.Value, actBody.IsNull ? null : actBody.Value, employeeId.IsNull ? null : employeeId.Value);
            }
        }
 internal SmiStorageMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3, bool allowsDBNull, string serverName, string catalogName, string schemaName, string tableName, string columnName, SqlBoolean isKey, bool isIdentity, bool isColumnSet) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties, name, typeSpecificNamePart1, typeSpecificNamePart2, typeSpecificNamePart3)
 {
     this._allowsDBNull = allowsDBNull;
     this._serverName = serverName;
     this._catalogName = catalogName;
     this._schemaName = schemaName;
     this._tableName = tableName;
     this._columnName = columnName;
     this._isKey = isKey;
     this._isIdentity = isIdentity;
     this._isColumnSet = isColumnSet;
 }
Esempio n. 23
0
 public static void DeleteEntity(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlString partitionKey,
     SqlString rowKey,
     SqlString xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ITPCfSQL.Azure.Table table = ats.GetTable(tableName.Value);
     table.Delete(new ITPCfSQL.Azure.TableEntity() { RowKey = rowKey.Value, PartitionKey = partitionKey.Value, TimeStamp = DateTime.Now },
         (xmsclientrequestId != null ? xmsclientrequestId.Value : null));
 }
Esempio n. 24
0
    public static void Refunds_FillRow(object tableObject, out SqlInt64 RefundID, out SqlDateTime CreatedAt, out SqlString Note, out SqlBoolean Restock, out SqlInt64 UserID,
        out SqlInt32 RefundLineItems, out SqlInt32 Transactions)
    {
        Refund r = (Refund)tableObject;
        RefundID = r.id;
        CreatedAt = r.created_at != null ? Convert.ToDateTime(r.created_at) : SqlDateTime.Null;
        Note = r.note != null ? r.note.ToString() : SqlString.Null;
        Restock = Convert.ToBoolean(r.restock);
        UserID = r.user_id;

        RefundLineItems = r.refund_line_items.Count;
        Transactions = r.transactions.Count;
    }
Esempio n. 25
0
    public static IEnumerable Codes(String AText, String AOperators, String ASigns, SqlBoolean AParams)
    {
        if (String.IsNullOrEmpty(AText)) return null;
          Boolean LParams = AParams.IsTrue;

          List<CodesRow> rows = new List<CodesRow>();

          int     pos   = 0;
          int     start = pos;
          bool    first = true;

          String  operation = "+";
          String  sign;
          String  code;
          String  param;

          while (pos < AText.Length)
          {
        start = pos;

        // If not first parse Operation
        if (!first)
          if(!TryParseOperation(AText, AOperators, out operation, ref pos))
            throw new Exception(String.Format("TryParseOperator: Incorrect syntax near '{0}'", AText.Substring(start)));

        TryParseOperation(AText, ASigns, out sign, ref pos);

        // Parse Code
        if (TryParseCode(AText, LParams, out code, out param, ref pos))
        {
        //          if (operation == null)
        //            throw new Exception(String.Format("TryParseCode: Incorrect syntax near '{0}'", AText.Substring(start)));
          CodesRow row = new CodesRow();
          row.Index     = rows.Count + 1;
          row.Code      = code;
          row.Sign      = sign;
          row.Operation = operation; // == "," ? "+" : operation;
          row.Params    = param;
          rows.Add(row);
          operation = null;
          code = null;
        }
        else
          throw new Exception(String.Format("TryParseCode: Incorrect syntax near '{0}'", AText.Substring(start)));

        first = false;
          }
          return rows;
    }
Esempio n. 26
0
        private void AddToWindow(object[] newTuple, string[] operators, ArrayList resultCollection, ArrayList resultstringCollection, SqlDataRecord record, SqlBoolean isFrameworkMode, int level, DataTable dtResult)
        {
            //Erste Spalte ist die ID
            long?[] recordInt = new long?[operators.GetUpperBound(0) + 1];
            string[] recordstring = new string[operators.GetUpperBound(0) + 1];
            DataRow row = dtResult.NewRow();

            for (int iCol = 0; iCol <= newTuple.GetUpperBound(0); iCol++)
            {
                //Only the real columns (skyline columns are not output fields)
                if (iCol <= operators.GetUpperBound(0))
                {
                    //LOW und HIGH Spalte in record abfüllen
                    if (operators[iCol].Equals("LOW"))
                    {
                        if (newTuple[iCol] == DBNull.Value)
                            recordInt[iCol] = null;
                        else
                            recordInt[iCol] = (long)newTuple[iCol];

                        //Check if long value is incomparable
                        if (iCol + 1 <= recordInt.GetUpperBound(0) && operators[iCol + 1].Equals("INCOMPARABLE"))
                        {
                            //Incomparable field is always the next one
                            recordstring[iCol] = (string)newTuple[iCol + 1];
                        }
                    }

                }
                else
                {
                    row[iCol - (operators.GetUpperBound(0) + 1)] = newTuple[iCol];
                    record.SetValue(iCol - (operators.GetUpperBound(0) + 1), newTuple[iCol]);
                }
            }
            row[record.FieldCount - 1] = level;
            record.SetValue(record.FieldCount - 1, level);

            if (isFrameworkMode == true)
            {
                dtResult.Rows.Add(row);
            }
            else
            {
                SqlContext.Pipe.SendResultsRow(record);
            }
            resultCollection.Add(recordInt);
            resultstringCollection.Add(recordstring);
        }
Esempio n. 27
0
 public static void Risks_FillRow(object tableObject, out SqlInt64 RiskID, out SqlInt64 OrderID, 
     out SqlInt64 CheckOutID, out SqlString Source, out SqlString Score, out SqlString Recommendation, out SqlBoolean Display, 
     out SqlString CauseCancel, out SqlString Message, out SqlString MerchantMessage)
 {
     OrderRisk r = (OrderRisk)tableObject;
     RiskID = r.id;
     OrderID = r.order_id;
     CheckOutID = r.checkout_id;
     Source = r.source;
     Score = r.score;
     Recommendation = r.recommendation;
     Display = r.display;
     CauseCancel = r.cause_cancel != null ? r.cause_cancel.ToString() : SqlString.Null;
     Message = r.message;
     MerchantMessage = r.merchant_message;
 }
Esempio n. 28
0
        public static void SendMessage(SqlString HostName, SqlInt32 Port, SqlString Message, out SqlBoolean Result)
        {
            using (var udpClient = new UdpClient())
            { 
                try
                {
                    udpClient.Connect(HostName.Value, Port.Value);
                    var sendBytes = UTF8.GetBytes(Message.Value);
                    udpClient.Send(sendBytes, sendBytes.Length);
                    udpClient.Close();
                }
                catch
                {
                    Result = false;
                    return;
                }
            Result = true;
}
        }
Esempio n. 29
0
        public static void AcquireBlobInfiniteLease(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString blobName,
            SqlGuid proposedLeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);
            Blob blob = cont.GetBlob(blobName.Value);

            Responses.LeaseBlobResponse lbr = blob.AcquireInfiniteLease(
                proposedLeaseId.IsNull ? (Guid?)null : proposedLeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            PushLeaseBlobResponse(lbr);
        }
Esempio n. 30
0
 // Alternative method for operator >
 public static SqlBoolean GreaterThan(SqlBoolean x, SqlBoolean y)
 {
     return(x > y);
 }
Esempio n. 31
0
 // Alternative method for operator !=
 public static SqlBoolean LessThanOrEquals(SqlBoolean x, SqlBoolean y)
 {
     return(x <= y);
 }
Esempio n. 32
0
 // Alternative method for operator <=
 public static SqlBoolean GreaterThanOrEquals(SqlBoolean x, SqlBoolean y)
 {
     return(x >= y);
 }
Esempio n. 33
0
 // Alternative method for operator |
 /// <include file='doc\SQLBoolean.uex' path='docs/doc[@for="SqlBoolean.Or"]/*' />
 public static SqlBoolean Or(SqlBoolean x, SqlBoolean y)
 {
     return(x | y);
 }
Esempio n. 34
0
        //--------------------------------------------------
        // Alternative methods for overloaded operators
        //--------------------------------------------------

        // Alternative method for operator ~
        /// <include file='doc\SQLBoolean.uex' path='docs/doc[@for="SqlBoolean.OnesComplement"]/*' />
        public static SqlBoolean OnesComplement(SqlBoolean x)
        {
            return(~x);
        }
Esempio n. 35
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_CompanyNameWasUpdated = false;
            this.col_CompanyNameWasSet     = false;
            this.col_CompanyName           = System.Data.SqlTypes.SqlString.Null;

            this.col_ContactNameWasUpdated = false;
            this.col_ContactNameWasSet     = false;
            this.col_ContactName           = System.Data.SqlTypes.SqlString.Null;

            this.col_TitleIdWasUpdated = false;
            this.col_TitleIdWasSet     = false;
            this.col_TitleId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_AddressWasUpdated = false;
            this.col_AddressWasSet     = false;
            this.col_Address           = System.Data.SqlTypes.SqlString.Null;

            this.col_CityWasUpdated = false;
            this.col_CityWasSet     = false;
            this.col_City           = System.Data.SqlTypes.SqlString.Null;

            this.col_PostalCodeWasUpdated = false;
            this.col_PostalCodeWasSet     = false;
            this.col_PostalCode           = System.Data.SqlTypes.SqlString.Null;

            this.col_PhoneWasUpdated = false;
            this.col_PhoneWasSet     = false;
            this.col_Phone           = System.Data.SqlTypes.SqlString.Null;

            this.col_EmailWasUpdated = false;
            this.col_EmailWasSet     = false;
            this.col_Email           = System.Data.SqlTypes.SqlString.Null;

            this.col_WebAddressWasUpdated = false;
            this.col_WebAddressWasSet     = false;
            this.col_WebAddress           = System.Data.SqlTypes.SqlString.Null;

            this.col_FaxWasUpdated = false;
            this.col_FaxWasSet     = false;
            this.col_Fax           = System.Data.SqlTypes.SqlString.Null;

            this.col_ActiveWasUpdated = false;
            this.col_ActiveWasSet     = false;
            this.col_Active           = System.Data.SqlTypes.SqlBoolean.Null;

            bool alreadyOpened = false;

            Params.spS_Customers Param = new Params.spS_Customers(true);
            Param.CommandTimeOut = this.selectCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case Bob.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case Bob.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case Bob.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            if (!this.col_CustomerID.IsNull)
            {
                Param.Param_CustomerID = this.col_CustomerID;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_Customers Sp = new SPs.spS_Customers(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_CompanyName.ColumnIndex))
                    {
                        this.col_CompanyName = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_CompanyName.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_ContactName.ColumnIndex))
                    {
                        this.col_ContactName = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_ContactName.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_TitleId.ColumnIndex))
                    {
                        this.col_TitleId = sqlDataReader.GetSqlInt32(SPs.spS_Customers.Resultset1.Fields.Column_TitleId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Address.ColumnIndex))
                    {
                        this.col_Address = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Address.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_City.ColumnIndex))
                    {
                        this.col_City = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_City.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_PostalCode.ColumnIndex))
                    {
                        this.col_PostalCode = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_PostalCode.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Phone.ColumnIndex))
                    {
                        this.col_Phone = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Phone.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Email.ColumnIndex))
                    {
                        this.col_Email = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Email.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_WebAddress.ColumnIndex))
                    {
                        this.col_WebAddress = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_WebAddress.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Fax.ColumnIndex))
                    {
                        this.col_Fax = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Fax.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Active.ColumnIndex))
                    {
                        this.col_Active = sqlDataReader.GetSqlBoolean(SPs.spS_Customers.Resultset1.Fields.Column_Active.ColumnIndex);
                    }

                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = true;

                    return(true);
                }
                else
                {
                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = false;

                    return(false);
                }
            }
            else
            {
                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                throw new Bob.DataClasses.CustomException(Param, "Bob.BusinessComponents.Customer", "Refresh");
            }
        }
Esempio n. 36
0
 // Alternative method for operator ^
 /// <include file='doc\SQLBoolean.uex' path='docs/doc[@for="SqlBoolean.Xor"]/*' />
 public static SqlBoolean Xor(SqlBoolean x, SqlBoolean y)
 {
     return(x ^ y);
 }
Esempio n. 37
0
 // Alternative method for operator !=
 /// <include file='doc\SQLBoolean.uex' path='docs/doc[@for="SqlBoolean.NotEquals"]/*' />
 public static SqlBoolean NotEquals(SqlBoolean x, SqlBoolean y)
 {
     return(x != y);
 }
Esempio n. 38
0
 public static SqlBoolean And(SqlBoolean x, SqlBoolean y)
 {
     return(x & y);
 }
Esempio n. 39
0
 public static SqlBoolean Equals(SqlBoolean x, SqlBoolean y)
 {
     return(x == y);
 }
Esempio n. 40
0
 // Alternative method for operator <
 public static SqlBoolean LessThan(SqlBoolean x, SqlBoolean y)
 {
     return(x < y);
 }
Esempio n. 41
-1
    public void Accumulate(SqlDouble Value)
    {
        if (start)
        {
            min = Value;
            max = Value;
            start = false;
        }
        else
        {
            if (Value < min)
                min = Value;

            if (Value > max)
                max = Value;

            result = max - min;
        }
    }