本文整理汇总了C#中DataClasses1DataContext.GetTable方法的典型用法代码示例。如果您正苦于以下问题:C# DataClasses1DataContext.GetTable方法的具体用法?C# DataClasses1DataContext.GetTable怎么用?C# DataClasses1DataContext.GetTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataClasses1DataContext
的用法示例。
在下文中一共展示了DataClasses1DataContext.GetTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _getUser
private static User _getUser(string username, string pass)
{
DataClasses1DataContext dc1 = new DataClasses1DataContext();
var queryResult = (from user in dc1.GetTable<User>()
where (user.Username == username) &&
(user.Pass == pass)
select user).ToArray<User>();
if (queryResult.Count<User>() > 0)
return queryResult[0];
else return null;
}
示例2: _getZast
private static ZAST _getZast(string fname, string lname, string carnum)
{
DataClasses1DataContext dc = new DataClasses1DataContext();
var queryResult = (from zast in dc.GetTable<ZAST>()
where (zast.FName == fname) &&
(zast.LName == lname) &&
(zast.CarNum == carnum)
select zast).ToArray<ZAST>();
if (queryResult.Count<ZAST>() > 0)
return queryResult[0];
else return null;
}
示例3: ViewModel
public ViewModel()
{
DataClasses1DataContext db = new DataClasses1DataContext();
this.PaletteList = new ObservableCollection<string>();
PaletteList.Add((from a in db.GetTable<Bill>() select a).OrderByDescending(x => x.Date).FirstOrDefault().Date.Value.ToString("MMM-yy"));
int monthCh = getParts((from a in db.GetTable<Bill>() select a).OrderByDescending(x => x.Date).FirstOrDefault().Date.Value.ToString("MMM-yy"))[0];
this.AnnualStatus = new ObservableCollection<Model>();
var dataPoints1 = new List<Model>();
var bills1 = (from a in db.GetTable<Bill>() select a).ToList<Bill>();
List<String> months1 = new List<string>();
foreach (var bil in bills1)
{
if (!months1.Contains(bil.Department))
{
List<string> charges = (from a in db.GetTable<Bill>() where a.Department == bil.Department && a.Date.Value.Month == monthCh select a.Charge).ToList<string>();
AnnualStatus.Add(new Model { SocialNetwork = bil.Department, Status = sumCharges(charges) });
months1.Add(bil.Department);
//PaletteList.Add(bil.Date.Value.ToString("MMM-yy"));
}
}
//Active Users
this.ActiveUsers = new ObservableCollection<Model>();
var dataPoints = new List<Model>();
var bills = (from a in db.GetTable<Bill>() select a).ToList<Bill>();
List<String> months = new List<string>();
foreach (var bil in bills)
{
if (!months.Contains(bil.Authorization))
{
List<string> charges = (from a in db.GetTable<Bill>() where a.Authorization == bil.Authorization && a.Date.Value.Month == monthCh select a.Charge).ToList<string>();
dataPoints.Add(new Model { SocialNetwork = bil.Authorization, Status = sumCharges(charges) });
months.Add(bil.Authorization);
//PaletteList.Add(bil.Date.Value.ToString("MMM-yy"));
}
}
foreach (Model m in dataPoints.OrderByDescending(x => x.Status).Take(10))
{
ActiveUsers.Add(m);
}
}