本文整理汇总了C#中DataClasses1DataContext.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# DataClasses1DataContext.Dispose方法的具体用法?C# DataClasses1DataContext.Dispose怎么用?C# DataClasses1DataContext.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataClasses1DataContext
的用法示例。
在下文中一共展示了DataClasses1DataContext.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: evalPerformance
public bool evalPerformance(DataClasses1DataContext database, int blockID, double target, int SID, int UID)
{
//double target = test.Study.TargetWordsPerMinute;
double latency = 0.0;
List<Trial> trials = (from t in database.Trials
where t.TrialBlockID == blockID
select t).OrderBy(x => x.TimeOptionClicked).ToList();
int correct = 0;
foreach (Trial t in trials)
{
latency = latency + (t.TimeOptionClicked - t.TimeSecondIDclicked);
if (t.OptionIDClicked == t.WordID)
{
correct++;
}
}
if ( ((trials.Count / (latency / 60000)) >= target) && (correct == trials.Count))
{
//return advanceUserInStudy(database, SID, UID);
database.Dispose();
return advanceUserInStudy(SID, UID);
}
return false;
}
示例2: GetorderNum
//public DataTable G(string sellename, string hdname, string time, string isclose)
//{
// dataContext = new DataClasses1DataContext();
// var G = from j in dataContext.ProductOrderInfo
// join k in dataContext.ProductOrderDetil
// on j.Tid equals k.tid
// where j.addTime > Convert.ToDateTime(time) && j.Seller_nick == sellename && j.hdname == hdname &&
// j.Paccount.Contains("退款") && j.Paccount.Contains("废弃") && j.Paccount.Contains("代发") && j.IsClose.Value == true
// select j;
//}
/// <summary>
/// 订单数量查询 alezh
/// </summary>
/// <param name="sellename"></param>
/// <param name="hdname"></param>
/// <param name="time"></param>
/// <param name="isclose"></param>
/// <returns></returns>
public string[] GetorderNum(string sellename, string hdname, string time)
{
//List<ProductOrderInfo> pd = new List<ProductOrderInfo>();
List<string> st = new List<string>();
string[] sr;
int isprint=0;//打印数量
int noprint=0;//未打印数量
int outNum=0;//已经出库
int count = 0;//总数
dataContext = new DataClasses1DataContext();
var td = from x in dataContext.ProductOrderInfo
where x.addTime > Convert.ToDateTime(time) && x.hdname == hdname &&
x.Seller_nick == sellename
select x;
foreach (ProductOrderInfo ds in td)
{
count++;
if (ds.IsPrint.Value)
isprint++;
else
noprint++;
if (ds.rongyu3!=null)
outNum++;
}
sr = new string[] { isprint.ToString(), noprint.ToString(), outNum.ToString(), count.ToString() };
st.Add(isprint.ToString());
st.Add(noprint.ToString());
st.Add(outNum.ToString());
st.Add(count.ToString());
dataContext.Dispose();
return sr;
}