本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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");
}
示例6: FillRowFromSeqStartEnd
public static void FillRowFromSeqStartEnd(object tableTypeObject, out SqlString substr, out SqlInt64 cnt)
{
var tableType = (SubstrCount)tableTypeObject;
substr = tableType.Substr;
cnt = tableType.Cnt;
}
示例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);
}
示例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");
}
示例9: Create
public void Create()
{
SqlInt64 TestLong = new SqlInt64(29);
Assert.Equal(29, TestLong.Value);
TestLong = new SqlInt64(-9000);
Assert.Equal(-9000, TestLong.Value);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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");
}
示例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);
}