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


C# DataClasses1DataContext.Dispose方法代码示例

本文整理汇总了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;
 }
开发者ID:spencer-langley,项目名称:AlohaKumu,代码行数:24,代码来源:DataAccessor.cs

示例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;
 }
开发者ID:neoml,项目名称:print,代码行数:50,代码来源:DeliveryPrintDA.cs


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