Esempio n. 1
0
        public SQLNET InternalValue(SqlString keyString, Type type, object value)
        {
            var key = keyString.Value;
            var item = Item;
            var sqlnet = this;

            SQLNETParallelItem parallelValue;

            // CREATE a new SQLNET from the root
            if (ValueParallel == 0)
            {
                sqlnet = new SQLNET {ValueSerializable = ValueSerializable, ValueParallel = item.GetNextCountAndAddParallel()};
                parallelValue = item.AddParallelValue(sqlnet.ValueParallel);
            }
            else
            {
                parallelValue = item.GetParallelValue(sqlnet.ValueParallel);
            }

            if (!item.IsCompiled)
            {
                //parallelValue.ParameterValues[key] = value;
                parallelValue.ParameterValues.Add(key, value);

                // Try to add type only if it's not compiled yet
                item.ParameterTypes.TryAdd(key, type);
            }
            else
            {
                // AddOrUpdate value
                parallelValue.ParameterValues[key] = value;
            }

            return sqlnet;
        }
Esempio n. 2
0
        /// <summary>Add or update a value associated with the specified key.</summary>
        /// <param name="key">The key of the value to add or update.</param>
        /// <param name="value">The value to add or update associated with the specified key.</param>
        /// <returns>A fluent SQLNET object.</returns>
        public SQLNET ValNullable(SqlString key, object value)
        {
            Type type;
            value = SqlTypeHelper.ConvertToType(value);

            // CHECK for key containing type: int? x
            if (key.Value.Contains(" "))
            {
                var split = key.Value.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);

                if (split.Length == 1)
                {
                    type = value.GetType();
                    key = key.Value.Trim();
                }
                else if (split.Length == 2)
                {
                    type = TypeHelper.GetTypeFromName(split[0]);
                    key = split[1];
                }
                else
                {
                    throw new Exception(string.Format(ExceptionMessage.Invalid_ValueKey, key));
                }
            }
            else
            {
                type = value.GetType();
            }

            return InternalValue(key, type, value);
        }
Esempio n. 3
0
 public static object Box(SqlString a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
        public static void String_Distances_Filler(object distances, 
            out SqlString fromString, out SqlString toString, out SqlDouble Hamming_Distance, 
            out SqlDouble Jaccard_Distance, out SqlDouble Jaro_Distance, out SqlDouble Jaro_Winkler_Distance, 
            out SqlDouble Levenshtein_Distance, out SqlDouble Levenshtein_Distance_Lower_Bound,
            out SqlDouble Levenshtein_Distance_Upper_Bound, out SqlDouble Normalized_Levenshtein_Distance,
            out SqlDouble Overlap_Coefficient, out SqlDouble Ratcliff_Obershelp_Similarity,
            out SqlDouble Sorensen_Dice_Index, out SqlDouble Sorensen_Dice_Distance, 
            out SqlDouble Tanimoto_Coefficient) {

            AllDistanceMetrics adm = (AllDistanceMetrics)distances;
            fromString = adm.fromString;
            toString = adm.toString;
            Hamming_Distance = adm.Hamming_Distance;
            Jaccard_Distance = adm.Jaccard_Distance;
            Jaro_Distance = adm.Jaro_Distance;
            Jaro_Winkler_Distance = adm.Jaro_Winkler_Distance;
            Levenshtein_Distance = adm.Levenshtein_Distance;
            Levenshtein_Distance_Lower_Bound = adm.Levenshtein_Distance_Lower_Bound;
            Levenshtein_Distance_Upper_Bound = adm.Levenshtein_Distance_Upper_Bound;
            Normalized_Levenshtein_Distance = adm.Normalized_Levenshtein_Distance;
            Overlap_Coefficient = adm.Overlap_Coefficient;
            Ratcliff_Obershelp_Similarity = adm.Ratcliff_Obershelp_Similarity;
            Sorensen_Dice_Index = adm.Sorensen_Dice_Index;
            Sorensen_Dice_Distance = adm.Sorensen_Dice_Distance;
            Tanimoto_Coefficient = adm.Tanimoto_Coefficient;
        }
 public void GetReady()
 {
         Test1 = new SqlString ("First TestString");
         Test2 = new SqlString ("This is just a test SqlString");
         Test3 = new SqlString ("This is just a test SqlString");
         Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-AU");
 }
Esempio n. 6
0
 public void Accumulate(SqlString value)
 {
     if (!value.IsNull)
     {
         builder.Append(value);
     }
 }
 internal static SqlString TrimEnd(SqlString src, SqlChars des)
 {
     if (IsAllNull(des)) return src;
     if (IsAllNull(src)) return SqlString.Null;
     string _s = src.Value;
     return new SqlString(_s.TrimEnd(des.Value));
 }
Esempio n. 8
0
 public cHistory(SqlString hisDate, SqlString hisWork, SqlString hisPlace, SqlString hisAchie)
 {
     strDate = hisDate;
     strWork = hisWork;
     strPlace = hisPlace;
     strAchievement = hisAchie;
 }
Esempio n. 9
0
        public static SqlXml ExecQuery(SqlString Sql, SqlXml Options, SqlXml Input)
        {
            var XOutput = new XDocument(new XElement("root"));

            try
            {
                using (var q = new SqlCommand())
                {
                    q.Connection = new SqlConnection("context connection=true");
                    q.CommandType = CommandType.Text;

                    q.CommandText = Sql.Value;
                    q.InitOptions(Options.Value);
                    q.Parameters.SetInput(Input.Value);

                    q.Connection.Open();
                    var Result = q.ExecuteXmlReader();
                    if (Result.Read())
                        XOutput.Root.Element("content").Add(
                            XElement.Load(Result, LoadOptions.None));
                    q.Connection.Close();
                }
            }
            catch (Exception ex)
            {
                XOutput.Root.Add(ex.ExceptionSerialize());
            }

            return new SqlXml(XOutput.CreateReader());
        }
Esempio n. 10
0
		public void Create()
		{
			// SqlString (String)
			SqlString TestString = new SqlString ("Test");
			Assert.AreEqual ("Test", TestString.Value, "#A01");

			// SqlString (String, int)
			TestString = new SqlString ("Test", "en-GB");
			Assert.AreEqual ("en-GB", TestString.Name, "#A02");

			// SqlString (int, SqlCompareOptions, byte[])
			TestString = new SqlString ("en-GB",
				SqlCompareOptions.BinarySort|SqlCompareOptions.IgnoreCase,
				new byte [2] {123, 221});
			Assert.AreEqual ("en-GB", TestString.CompareInfo.Name, "#A03");

			// SqlString(string, int, SqlCompareOptions)
			TestString = new SqlString ("Test", "en-GB", SqlCompareOptions.IgnoreNonSpace);
			Assert.IsTrue (!TestString.IsNull, "#A04");

			// SqlString (int, SqlCompareOptions, byte[], int, int)
			TestString = new SqlString ("en-GB", SqlCompareOptions.BinarySort, new byte [2] {113, 100}, 0, 2);
			Assert.IsTrue (!TestString.IsNull, "#A07");

			// SqlString (int, SqlCompareOptions, byte[], int, int, bool)
			TestString = new SqlString ("en-GB", SqlCompareOptions.IgnoreCase, new byte [3] {123, 111, 222}, 1, 2);
			Assert.IsTrue (!TestString.IsNull, "#A09");
		}
Esempio n. 11
0
        public static SqlXml ExecScript(SqlString Sql, SqlXml Options, SqlXml Input)
        {
            var XOutput = new XDocument(
                new XElement("root",
                    new XElement("content")));

            try
            {
                using (var q = new SqlCommand())
                {
                    q.Connection = new SqlConnection("context connection=true");
                    q.CommandType = CommandType.Text;

                    q.CommandText = Sql.Value;
                    q.InitOptions(Options.Value);
                    q.Parameters.SetInput(Input.Value);

                    q.Connection.Open();
                    q.ExecuteNonQuery();
                    XOutput.Root.Add(q.Parameters.GetOutput());
                    q.Connection.Close();
                }
            }
            catch (Exception ex)
            {
                XOutput.Root.Add(ex.ExceptionSerialize());
            }

            return new SqlXml(XOutput.CreateReader());
        }
Esempio n. 12
0
		public void GetReady()
		{
            Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-AU";
			Test1 = new SqlString ("First TestString");
			Test2 = new SqlString ("This is just a test SqlString");
			Test3 = new SqlString ("This is just a test SqlString");
		}
Esempio n. 13
0
 public static void RunWorkflowForSql(SqlString serverUri, SqlString recordsetName)
 {
     new Workflows().RunWorkflowForSqlImpl(new SqlCtx(),
         serverUri.IsNull ? null : serverUri.Value,
         recordsetName.IsNull ? null : recordsetName.Value
         );
 }
 public static void NextSplitRow(Object obj, /*out SqlString sentence, */out SqlString match)
 {
     /*String[] row = (String[])obj;
     sentence = new SqlString(row[0]);
     match = new SqlString(row[1]);*/
     match = new SqlString(obj.ToString());
 }
Esempio n. 15
0
        public void Execute(SqlString command)
        {

            SqlConnection conn = null;
            try
            {

                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))
                {
                    String connectionString = CreateConnectionStringToContextDatabase();
                    conn = new SqlConnection(connectionString);

                    conn.Open();

                    SqlCommand cmd = new SqlCommand();
                    cmd.Connection = conn;
                    cmd.CommandText = command.ToString();
                    cmd.ExecuteNonQuery();
                }
            }
            catch (SecurityException se)
            {
                throw new CommandExecutorException("Error connecting to database. You may need to create tSQLt assembly with EXTERNAL_ACCESS.", se);
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
        }
Esempio n. 16
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);
        }
 public void DetermineInDelTest()
 {
     SqlString indel = new SqlString("30-TCTC	47-T	59+A	74-C	");
     SqlInt64 posStart = new SqlInt64(47152571);
     IEnumerable resultList = UserDefinedFunctions.DetermineInDel(posStart, indel);
     Assert.AreEqual(4, ((ArrayList)resultList).Count);
 }
Esempio n. 18
0
        public void UpdateIPP(SqlString nIPPId,SqlInt32 nPaymentId)
        {
            myRP.NNullIPPId = nIPPId;
            myRP.NPaymentID = nPaymentId;

            myRP.UpdateAllWnIPP_PaymentIDLogic();
        }
 public static void FormatE_FillRow(
     object inputObject,
     out SqlInt32 lineNumber,
     out SqlString programNumber,
     out SqlString platformId,
     out DateTime transmissionDate,
     out DateTime? locationDate,
     out float? latitude,
     out float? longitude,
     out float? altitude,
     out char? locationClass,
     out Byte[] message)
 {
     var transmission = (ArgosTransmission) inputObject;
     lineNumber = transmission.LineNumber;
     programNumber = transmission.ProgramId;
     platformId = transmission.PlatformId;
     transmissionDate = transmission.DateTime;
     locationDate = transmission.Location == null ? (DateTime?) null : transmission.Location.DateTime;
     latitude = transmission.Location == null ? (float?) null : transmission.Location.Latitude;
     longitude = transmission.Location == null ? (float?)null : transmission.Location.Longitude;
     altitude = transmission.Location == null ? (float?)null : transmission.Location.Altitude;
     locationClass = transmission.Location == null ? (char?)null : transmission.Location.Class;
     message = transmission.Message;
 }
 public static IEnumerable Match(SqlString pattern, SqlString subject)
 {
     var list = new List<MatchContent>();
     var regex = new Regex(pattern.Value);
     var match = regex.Match(subject.Value);
     var groupNames = regex.GetGroupNames();
     var num = 0;
     while (match.Success)
     {
         num++;
         var array = groupNames;
         foreach (var text in array)
         {
             list.AddRange(match.Groups[text].Captures
                 .Cast<Capture>()
                 .Select(capture =>
                     new MatchContent
                     {
                         MatchNumber = num,
                         GroupName = text,
                         CaptureNumber = capture.Index,
                         Value = capture.Value
                     }));
         }
         match = match.NextMatch();
     }
     return list;
 }
 private static void throwExceptionIfSchemaIsEmpty(SqlString command, DataTable schema)
 {
     if (schema == null) 
     {
         throw new InvalidResultSetException("The command [" + command.ToString() + "] did not return a result set");
     }
 }
Esempio n. 22
0
        // 全ての件数を取得
        public int[] countUsbLog()
        {
            int[] arrCount = new int[2];

            DateTime dtToday = DateTime.Now;
            string today     = dtToday.ToString("yyyy-MM-dd");

            try {
                db.conn.Open();
                // 最初のループで今日のレコード件数について取得
                for (int i = 0; i < 2; i++) {
                    MySqlCommand commCountUsbLog = new MySqlCommand("SELECT COUNT(log_id) FROM t_log", db.conn);
                    // 最初の実行で今日のログを取得するSQLを実行
                    if (i == 0) {
                        SqlString condition =  new SqlString(" WHERE log_time LIKE '" + today + "%'");
                        commCountUsbLog.CommandText += condition.ToString();
                    }

                    db.debugSql = commCountUsbLog.CommandText;
                    arrCount[i] = Convert.ToInt32(commCountUsbLog.ExecuteScalar());
                }

                db.conn.Close();
            } catch (MySqlException e) {
                db.exceptionMsg = "エラーコード:" + e.ErrorCode + "<br>エラー内容:" + e.Message + "<br>エラー原因:" + e.Source;
                Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
                Debug.WriteLine(db.exceptionMsg);
                Debug.WriteLine(db.debugSql);
            }

            return arrCount;
        }
Esempio n. 23
0
        public BelboonResults(SqlString eventdate,
				SqlString programmid,
		SqlString programmname,
		  SqlString eventcurrency,
		 SqlString clicks,
		 SqlString clickcommission,
		 SqlString views,
		 SqlString viewcommission,
		 SqlString leads,
		 SqlString leadcommission,
		 SqlString sales,
		 SqlString salecommission,
		 SqlString totalcommission,
		SqlString clickthroughrate,
		 SqlString leadconversionrate,
		 SqlString saleconversionrate)
        {
            this.eventdate = eventdate;
            this.programmid = programmid;
            this.programmname = programmname;
            this.eventcurrency = eventcurrency;
            this.clicks = clicks;
            this.clickcommission = clickcommission;
            this.views = views;
            this.viewcommission = viewcommission;
            this.leads = leads;
            this.leadcommission = leadcommission;
            this.sales = sales;
            this.salecommission = salecommission;
            this.totalcommission = totalcommission;
            this.leadconversionrate = leadconversionrate;
            this.clickthroughrate = clickthroughrate;
            this.saleconversionrate = saleconversionrate;
        }
Esempio n. 24
0
 public cArticle(SqlString artName, SqlString artField, SqlString artMag, SqlDateTime artDate)
 {
     strName = artName;
     strField = artField;
     strMagazine = artMag;
     dtmDate = artDate;
 }
 public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords, SqlInt32 sortType, SqlInt32 upToLevel)
 {
     SPMultipleSkylineBNLLevel skyline = new SPMultipleSkylineBNLLevel();
     string[] additionalParameters = new string[5];
     additionalParameters[4] = upToLevel.ToString();
     skyline.GetSkylineTable(strQuery.ToString(), strOperators.ToString(), numberOfRecords.Value, false, Helper.CnnStringSqlclr, Helper.ProviderClr, additionalParameters, sortType.Value, true);
 }
Esempio n. 26
0
 /// <summary>
 /// Class constructor which set blank values to the local variable.
 /// </summary>
 public vwRights()
 {
     this._nRightLevelID = 0;
     this._nRightsID = 0;
     this._nEmployeeID = 0;
     this._strFunctionName = "";
 }
Esempio n. 27
0
        public void sendSelectedResultSetToSqlContext(SqlInt32 resultsetNo, SqlString command)
        {
            validateResultSetNumber(resultsetNo);

            SqlDataReader dataReader = testDatabaseFacade.executeCommand(command);

            int ResultsetCount = 0;
            if (dataReader.FieldCount > 0)
            {
                do
                {
                    ResultsetCount++;
                    if (ResultsetCount == resultsetNo)
                    {
                        sendResultsetRecords(dataReader);
                        break;
                    }
                } while (dataReader.NextResult());
            }
            dataReader.Close();

            if(ResultsetCount < resultsetNo)
            {
                throw new InvalidResultSetException("Execution returned only " + ResultsetCount.ToString() + " ResultSets. ResultSet [" + resultsetNo.ToString() + "] does not exist.");
            }
        }
Esempio n. 28
0
        /// <summary>
        /// Initializes parallel block during the call to <see cref="Parallel_Declare"/> stored procedure
        /// </summary>
        /// <param name="name"></param>
        public ParallelBlock(SqlString name)
        {
            string dbName = null;
            _startedThreads = new List<string>();
            _name = name.IsNull ? string.Empty : name.Value;

            //let's get current server name
            SqlConnectionStringBuilder connStrBuilder = new SqlConnectionStringBuilder();
            connStrBuilder.ContextConnection = true;
            using (SqlConnection conn = new SqlConnection(connStrBuilder.ConnectionString))
            {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "SELECT DB_NAME()";
                    cmd.CommandType = CommandType.Text;
                    dbName = (string)cmd.ExecuteScalar();
                }
            }
            //build connection string, which will be used to execute sql in threads
            connStrBuilder = new SqlConnectionStringBuilder();
            connStrBuilder.DataSource = "(local)";
            connStrBuilder.InitialCatalog = dbName;
            connStrBuilder.IntegratedSecurity = true;
            connStrBuilder.MultipleActiveResultSets = false;
            connStrBuilder.Pooling = true;

            connStrBuilder.MaxPoolSize = 30;
            connStrBuilder.ConnectTimeout = 30;
            //Enlisting will be done when connecting to server if transaction is enabled
            connStrBuilder.Enlist = false;
            _connectionString = connStrBuilder.ConnectionString;

            _threads = new List<ThreadSql>();
        }
Esempio n. 29
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);
        }
Esempio n. 30
0
 public static SqlChars GetAlterStatementWithoutSchemaBinding(SqlString createStatement)
 {
     var startPosition = GetStartPosition(createStatement);
     var regex = new Regex(@"CREATE\s+VIEW(\s*.*?\s*)WITH\s+SCHEMABINDING\s+AS");
     var output = regex.Replace(createStatement.ToString(), @"ALTER VIEW$1AS", 1, startPosition);
     return new SqlChars(output);
 }
Esempio n. 31
0
        public object[] SQLWS([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] System.Data.SqlTypes.SqlString msg)
        {
            object[] results = this.Invoke("SQLWS", new object[] {
                msg
            });

            return((object[])(results[0]));
        }
Esempio n. 32
0
 /// <remarks/>
 public void SQLWSAsync(System.Data.SqlTypes.SqlString msg, object userState)
 {
     if ((this.SQLWSOperationCompleted == null))
     {
         this.SQLWSOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSQLWSOperationCompleted);
     }
     this.InvokeAsync("SQLWS", new object[] {
         msg
     }, this.SQLWSOperationCompleted, userState);
 }
Esempio n. 33
0
 /// <remarks/>
 public void SQLWSAsync(System.Data.SqlTypes.SqlString msg)
 {
     this.SQLWSAsync(msg, null);
 }
Esempio n. 34
0
 public static SqlString Add(SqlString x, SqlString y)
 {
     return(x + y);
 }
Esempio n. 35
0
        //--------------------------------------------------
        // Alternative methods for overloaded operators
        //--------------------------------------------------

        // Alternative method for operator +
        public static SqlString Concat(SqlString x, SqlString y)
        {
            return(x + y);
        }
Esempio n. 36
0
 // Alternative method for operator !=
 public static SqlBoolean NotEquals(SqlString x, SqlString y)
 {
     return(x != y);
 }
Esempio n. 37
0
 // Alternative method for operator ==
 public static SqlBoolean Equals(SqlString x, SqlString y)
 {
     return(x == y);
 }
Esempio n. 38
0
 // Alternative method for operator >
 public static SqlBoolean GreaterThan(SqlString x, SqlString y)
 {
     return(x > y);
 }
Esempio n. 39
0
 // Alternative method for operator <
 public static SqlBoolean LessThan(SqlString x, SqlString y)
 {
     return(x < y);
 }
Esempio n. 40
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. 41
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_JobIdWasUpdated = false;
            this.col_JobIdWasSet     = false;
            this.col_JobId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_DescriptionWasUpdated = false;
            this.col_DescriptionWasSet     = false;
            this.col_Description           = System.Data.SqlTypes.SqlString.Null;

            this.col_JobPartTypeIdWasUpdated = false;
            this.col_JobPartTypeIdWasSet     = false;
            this.col_JobPartTypeId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_UnitsWasUpdated = false;
            this.col_UnitsWasSet     = false;
            this.col_Units           = System.Data.SqlTypes.SqlDecimal.Null;

            this.col_PricePerUnitWasUpdated = false;
            this.col_PricePerUnitWasSet     = false;
            this.col_PricePerUnit           = System.Data.SqlTypes.SqlMoney.Null;

            this.col_TotalPriceWasUpdated = false;
            this.col_TotalPriceWasSet     = false;
            this.col_TotalPrice           = System.Data.SqlTypes.SqlMoney.Null;

            bool alreadyOpened = false;

            Params.spS_JobPart Param = new Params.spS_JobPart(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_JobPartId.IsNull)
            {
                Param.Param_JobPartId = this.col_JobPartId;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_JobPart Sp = new SPs.spS_JobPart(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex))
                    {
                        this.col_JobId = sqlDataReader.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex))
                    {
                        this.col_Description = sqlDataReader.GetSqlString(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex))
                    {
                        this.col_JobPartTypeId = sqlDataReader.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex))
                    {
                        this.col_Units = sqlDataReader.GetSqlDecimal(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex))
                    {
                        this.col_PricePerUnit = sqlDataReader.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.ColumnIndex))
                    {
                        this.col_TotalPrice = sqlDataReader.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.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.JobPart_Record", "Refresh");
            }
        }
Esempio n. 42
0
 internal void CaptureOutputToLogTable(System.Data.SqlTypes.SqlString command)
 {
     ExecuteCommand(command);
     testDatabaseFacade.logCapturedOutput(testDatabaseFacade.InfoMessage);
 }
Esempio n. 43
0
        internal void ExecuteCommand(System.Data.SqlTypes.SqlString command)
        {
            SqlDataReader reader = testDatabaseFacade.executeCommand(command);

            reader.Close();
        }
Esempio n. 44
0
 internal void SuppressOutput(System.Data.SqlTypes.SqlString command)
 {
     ExecuteCommand(command);
 }
Esempio n. 45
0
 // Create a SqlChars from a SqlString
 public SqlChars(SqlString value) : this(value.IsNull ? null : value.Value.ToCharArray())
 {
 }
Esempio n. 46
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_TitleWasUpdated = false;
            this.col_TitleWasSet     = false;
            this.col_Title           = System.Data.SqlTypes.SqlString.Null;

            bool alreadyOpened = false;

            Params.spS_Title Param = new Params.spS_Title(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_TitleId.IsNull)
            {
                Param.Param_TitleId = this.col_TitleId;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_Title Sp = new SPs.spS_Title(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_Title.Resultset1.Fields.Column_Title.ColumnIndex))
                    {
                        this.col_Title = sqlDataReader.GetSqlString(SPs.spS_Title.Resultset1.Fields.Column_Title.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.Title", "Refresh");
            }
        }
Esempio n. 47
0
 // Alternative method for operator <=
 public static SqlBoolean LessThanOrEqual(SqlString x, SqlString y)
 {
     return(x <= y);
 }
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_Pro_StrNameWasUpdated = false;
            this.col_Pro_StrNameWasSet     = false;
            this.col_Pro_StrName           = System.Data.SqlTypes.SqlString.Null;

            this.col_Pro_CurPriceWasUpdated = false;
            this.col_Pro_CurPriceWasSet     = false;
            this.col_Pro_CurPrice           = System.Data.SqlTypes.SqlMoney.Null;

            this.col_Pro_LngCategoryIDWasUpdated = false;
            this.col_Pro_LngCategoryIDWasSet     = false;
            this.col_Pro_LngCategoryID           = System.Data.SqlTypes.SqlInt32.Null;

            bool alreadyOpened = false;

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

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

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

            if (!this.col_Pro_GuidID.IsNull)
            {
                Param.Param_Pro_GuidID = this.col_Pro_GuidID;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_tblProduct Sp = new SPs.spS_tblProduct(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_StrName.ColumnIndex))
                    {
                        this.col_Pro_StrName = sqlDataReader.GetSqlString(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_StrName.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_CurPrice.ColumnIndex))
                    {
                        this.col_Pro_CurPrice = sqlDataReader.GetSqlMoney(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_CurPrice.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_LngCategoryID.ColumnIndex))
                    {
                        this.col_Pro_LngCategoryID = sqlDataReader.GetSqlInt32(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_LngCategoryID.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 OlymarsDemo.DataClasses.CustomException(Param, "OlymarsDemo.BusinessComponents.Product", "Refresh");
            }
        }
Esempio n. 49
0
 // Alternative method for operator >=
 public static SqlBoolean GreaterThanOrEqual(SqlString x, SqlString y)
 {
     return(x >= y);
 }
Esempio n. 50
0
 /// <remarks/>
 public void hello_worldAsync(System.Data.SqlTypes.SqlString msg)
 {
     this.hello_worldAsync(msg, null);
 }