当前位置: 首页>>代码示例>>C#>>正文


C# SqlTypes.SqlInt64类代码示例

本文整理汇总了C#中System.Data.SqlTypes.SqlInt64的典型用法代码示例。如果您正苦于以下问题:C# SqlInt64类的具体用法?C# SqlInt64怎么用?C# SqlInt64使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlInt64类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlInt64类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Box

 public static object Box(SqlInt64 a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
开发者ID:valery-shinkevich,项目名称:sooda,代码行数:7,代码来源:SoodaNullable.cs

示例2: IsNucX

 public static SqlInt32 IsNucX(SqlInt64 posStart, SqlString misMNuc, SqlInt64 refPos, SqlString refNuc, SqlString countNuc)
 {
     SqlInt32 result;
     Dictionary<long, string> mutationPositions = new Dictionary<long, string>();
     string mutationPattern = @"[0-9]+ [ACGTN]+";
     MatchCollection matches = Regex.Matches(misMNuc.Value, mutationPattern);
     foreach (Match match in matches)
     {
         var foundMutation = match.Value;
         string[] foundMutParts = foundMutation.Split(' ');
         long mutStartPos = posStart.Value + Int32.Parse(foundMutParts[0]);
         var mutNuc = foundMutParts[1];
         mutationPositions.Add(mutStartPos, mutNuc);
     }
     string mutValue;
     if (mutationPositions.TryGetValue(refPos.Value, out mutValue))
     {
         result = new SqlInt32(countNuc.Value.Equals(mutValue) ? 1 : 0);
     }
     else
     {
         result = new SqlInt32(countNuc.Value.Equals(refNuc.Value) ? 1 : 0);
     }
     return result;
 }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:25,代码来源:IsNucX.cs

示例3: DetermineInDelTest

 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);
 }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:7,代码来源:UserDefinedFunctionsTest.cs

示例4: DetRefPosCov

 public static IEnumerable DetRefPosCov(SqlInt64 refPosStart, SqlBinary refSeq, SqlInt64 sreadPosStart, SqlInt64 sreadPosEnd,
     SqlString misMNuc, SqlString indel)
 {
     ArrayList result = new ArrayList();
     // The following contains plus one because of length-determination:
     int sreadSeqLength = (int)(sreadPosEnd.Value - sreadPosStart.Value) + 1;
     List<long> deletionPositions = DetermineDelPositions(sreadPosStart.Value, indel.Value);
     long actRefPos = sreadPosStart.Value;
     int refIndex = 0;
     while (refIndex < sreadSeqLength)
     {
         if (deletionPositions.Contains(actRefPos))
         {
             result.Add(new RefPosCoverage
             {
                 refPos = actRefPos,
                 coverage = 0
             });
         }
         else
         {
             result.Add(new RefPosCoverage
             {
                 refPos = actRefPos,
                 coverage = 1
             });
         }
         refIndex++;
         actRefPos++;
     }
     return result;
 }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:32,代码来源:DetNucDistr.cs

示例5: ArithmeticMethods

		public void ArithmeticMethods ()
		{
			SqlInt64 Test64 = new SqlInt64 (64);
			SqlInt64 Test0 = new SqlInt64 (0);
			SqlInt64 Test164 = new SqlInt64 (164);
			SqlInt64 TestMax = new SqlInt64 (SqlInt64.MaxValue.Value);

			// Add()
			Assert.AreEqual ((long) 64, SqlInt64.Add (Test64, Test0).Value, "#D01");
			Assert.AreEqual ((long) 228, SqlInt64.Add (Test64, Test164).Value, "#D02");
			Assert.AreEqual ((long) 164, SqlInt64.Add (Test0, Test164).Value, "#D03");
			Assert.AreEqual ((long) SqlInt64.MaxValue, SqlInt64.Add (TestMax, Test0).Value, "#D04");

			try {
				SqlInt64.Add (TestMax, Test64);
				Assert.Fail ("#D05");
			} catch (OverflowException e) {
				Assert.AreEqual (typeof (OverflowException), e.GetType (), "#D06");
			}

			// Divide()
			Assert.AreEqual ((long) 2, SqlInt64.Divide (Test164, Test64).Value, "#D07");
			Assert.AreEqual ((long) 0, SqlInt64.Divide (Test64, Test164).Value, "#D08");

			try {
				SqlInt64.Divide (Test64, Test0);
				Assert.Fail ("#D09");
			} catch (DivideByZeroException e) {
				Assert.AreEqual (typeof (DivideByZeroException), e.GetType (), "#D10");
			}

			// Mod()
			Assert.AreEqual ((SqlInt64) 36, SqlInt64.Mod (Test164, Test64), "#D11");
			Assert.AreEqual ((SqlInt64) 64, SqlInt64.Mod (Test64, Test164), "#D12");

			// Multiply()
			Assert.AreEqual ((long) 10496, SqlInt64.Multiply (Test64, Test164).Value, "#D13");
			Assert.AreEqual ((long) 0, SqlInt64.Multiply (Test64, Test0).Value, "#D14");

			try {
				SqlInt64.Multiply (TestMax, Test64);
				Assert.Fail ("#D15");
			} catch (OverflowException e) {
				Assert.AreEqual (typeof (OverflowException), e.GetType (), "#D16");
			}

			// Subtract()
			Assert.AreEqual ((long) 100, SqlInt64.Subtract (Test164, Test64).Value, "#D17");

			try {
				SqlInt64.Subtract (SqlInt64.MinValue, Test164);
				Assert.Fail ("#D18");
			} catch (OverflowException e) {
				Assert.AreEqual (typeof (OverflowException), e.GetType (), "#D19");
			}

			// Modulus ()
			Assert.AreEqual ((SqlInt64)36, SqlInt64.Modulus (Test164, Test64), "#D20");
			Assert.AreEqual ((SqlInt64)64, SqlInt64.Modulus (Test64, Test164), "#D21");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:60,代码来源:SqlInt64Test.cs

示例6: FillRowFromSeqStartEnd

    public static void FillRowFromSeqStartEnd(object tableTypeObject, out SqlString substr, out SqlInt64 cnt)
    {
        var tableType = (SubstrCount)tableTypeObject;

        substr = tableType.Substr;
        cnt = tableType.Cnt;
    }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:7,代码来源:DetSubstrCount.cs

示例7: Create

                public void Create()
                {
                        SqlInt64 TestLong = new SqlInt64 (29);
                        AssertEquals ("#A01", (long)29, TestLong.Value);

                        TestLong = new SqlInt64 (-9000);
                        AssertEquals ("#A02", (long)-9000, TestLong.Value);
                 }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:SqlInt64Test.cs

示例8: Create

		public void Create ()
		{
			SqlInt64 TestLong = new SqlInt64 (29);
			Assert.AreEqual ((long) 29, TestLong.Value, "#A01");

			TestLong = new SqlInt64 (-9000);
			Assert.AreEqual ((long) -9000, TestLong.Value, "#A02");
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:8,代码来源:SqlInt64Test.cs

示例9: Create

        public void Create()
        {
            SqlInt64 TestLong = new SqlInt64(29);
            Assert.Equal(29, TestLong.Value);

            TestLong = new SqlInt64(-9000);
            Assert.Equal(-9000, TestLong.Value);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlInt64Test.cs

示例10: ToGuid

    public static SqlGuid ToGuid(SqlInt64 numTop, SqlInt64 numBottom)
    {
        if (numTop.IsNull || numBottom.IsNull) return SqlGuid.Null;

        var guid = ConvertToGuid(numTop.Value, numBottom.Value);

        return new SqlGuid(guid);
    }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:8,代码来源:AsGuid.cs

示例11: Shop_AddProductVariant

    public static void Shop_AddProductVariant(string StoreName, string APIKey, string Password, long ProductID, string JsonString, out SqlInt64 VariantID)
    {
        ShopifyClient sp = new ShopifyClient(StoreName, APIKey, Password);
        VariantID = sp.AddProductVariant(ProductID, JsonString);

        if (!String.IsNullOrEmpty(sp.ErrMsg))
            RaiseErr(sp.ErrMsg);
    }
开发者ID:mpoerwito,项目名称:RestCallCLR,代码行数:8,代码来源:Procedure.cs

示例12: Properties

        public void Properties()
        {
            SqlInt64 Test5443 = new SqlInt64(5443);
            SqlInt64 Test1 = new SqlInt64(1);

            Assert.True(SqlInt64.Null.IsNull);
            Assert.Equal(5443, Test5443.Value);
            Assert.Equal(1, Test1.Value);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:SqlInt64Test.cs

示例13: FillRowFromExtraAndMissingNuc

    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;
    }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:9,代码来源:DetermineInDel.cs

示例14: Properties

		public void Properties ()
		{
			SqlInt64 Test5443 = new SqlInt64 (5443);
			SqlInt64 Test1 = new SqlInt64 (1);

			Assert.IsTrue (SqlInt64.Null.IsNull, "#C01");
			Assert.AreEqual ((long) 5443, Test5443.Value, "#C02");
			Assert.AreEqual ((long) 1, Test1.Value, "#C03");
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:9,代码来源:SqlInt64Test.cs

示例15: Properties

                public void Properties()
                {
                        SqlInt64 Test5443 = new SqlInt64 (5443);
                        SqlInt64 Test1 = new SqlInt64 (1);

                        Assert ("#C01", SqlInt64.Null.IsNull);
                        AssertEquals ("#C02", (long)5443, Test5443.Value);
                        AssertEquals ("#C03", (long)1, Test1.Value);
                }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:SqlInt64Test.cs


注:本文中的System.Data.SqlTypes.SqlInt64类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。