本文整理汇总了C#中Model.List.Count方法的典型用法代码示例。如果您正苦于以下问题:C# List.Count方法的具体用法?C# List.Count怎么用?C# List.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model.List
的用法示例。
在下文中一共展示了List.Count方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DelSubject
public static void DelSubject(List<Priority> SP, List<String> SubjectID)
{
List<String> SB = new List<String>();
if (SubjectID != null)
{
foreach (var r in SP)
if (!SubjectID.Contains(r.SubjectID.ToString()))
SB.Add(r.SubjectID);
}
else
{
foreach (var r in SP)
SB.Add(r.SubjectID);
}
for (int i = 0; i < SB.Count(); i++)
{
var a = SB[i];
var nhom = (from m in InputHelper.db.nhoms
where m.MaMonHoc.Equals(a)
select m.Nhom1).ToList();
foreach (var r in nhom)
{
byte aByte = Convert.ToByte(r);
InputHelper.Groups.FirstOrDefault(m => m.Value.MaMonHoc == SB[i] && m.Value.Nhom == aByte).Value.IsIgnored = false;
}
OutputHelper.SaveOBJ("Groups", InputHelper.Groups);
}
}
示例2: SelectSuccess
public String SelectSuccess(List<String> SubjectID, List<long> Date, List<long> Time)
{
string paramInfo = "";
if (InputHelper.SubjectPriority.Count() != 0)
{
DelSubject(InputHelper.SubjectPriority, SubjectID);
}
InputHelper.SubjectPriority = new List<Priority>();
List<String> SB = new List<String>();
List<String> aClass = new List<String>();
List<String> Check = new List<String>();
if (SubjectID != null)
for (int i = 0; i < SubjectID.Count(); i++)
{
DateTime dt = (new DateTime(1970, 1, 1, 0, 0, 0, 0)).AddMilliseconds(Date[i]).Date;
InputHelper.SubjectPriority.Add(new Priority
{
SubjectID = SubjectID[i],
Date = dt,
Time = dt.AddMilliseconds(Time[i])
});
var a = SubjectID[i];
var nhom = (from m in InputHelper.db.nhoms
where m.MaMonHoc.Equals(a)
select m.Nhom1).ToList();
foreach (var r in nhom)
{
SB.Add(SubjectID[i]);
aClass.Add(r.ToString());
// Check.Add("undefined");
Check.Add("checked");
}
paramInfo += "MH:" + SubjectID[i] + " Ngay:" + Date[i] + "Gio:" + Time[i] + "<br /><br />";
}
OutputHelper.SaveOBJ("SubjectPriority", InputHelper.SubjectPriority);
string st = OutputHelper.SaveIgnoreGroups(SB, aClass, Check, true);
return paramInfo;
}
示例3: SelectSuccess
public String SelectSuccess(List<String> StudentID, List<String> SubjectID)
{
InputHelper.IgnoreStudents = new Dictionary<String,List<String>>();
string paramInfo = "";
if (StudentID != null)
{
for (int i = 0; i < StudentID.Count(); i++)
{
if (InputHelper.IgnoreStudents.ContainsKey(SubjectID[i]))
{
InputHelper.IgnoreStudents[SubjectID[i]].Add(StudentID[i]);
}
else
{
InputHelper.IgnoreStudents.Add(SubjectID[i], new List<String> { StudentID[i] });
}
paramInfo += "MH:" + SubjectID[i] + " SV: " + StudentID[i] + "<br /><br />";
}
}
OutputHelper.SaveOBJ("IgnoreStudents", InputHelper.IgnoreStudents);
return paramInfo;
}
示例4: ExampleTablesAfterParsing
//
// По аналогии с TreeList, Spreadsheet также должен находиться
// на в частичном представлении, которое включается в это представление.
//
public ActionResult ExampleTablesAfterParsing(long emailId)
{
List<Model.ParsedCells> workSheetCellsList = new List<Model.ParsedCells>();
List<List<Model.ParsedCells>> tableCellsList = new List<List<Model.ParsedCells>>();
List<List<List<Model.ParsedCells>>> cellsList = new List<List<List<Model.ParsedCells>>>();
Model.ParsedCells cellsWSC = new Model.ParsedCells();
if (emailId != 0)
{
var userId = UserHelper.GetUserByEmail(User.Identity.Name).Id;
if (IsUsersEmail(userId, emailId))
{
var cells = parsedCellsRepository.FindAll(w => w.EmailId_Id == emailId);
var distCellsByTable = cells.GroupBy(a => a.TableId_Id).Select(g => g.First()).OrderBy(i => i.TableId_Id).ToList();
foreach (var table in distCellsByTable)
{
var distCellsByWorkcheet = cells.Where(t => t.TableId_Id == table.TableId_Id)
.GroupBy(a => a.Worksheet).Select(g => g.First()).OrderBy(i => i.Worksheet).ToList();
foreach (var cell in distCellsByWorkcheet)
{
tableCellsList = new List<List<Model.ParsedCells>>();
workSheetCellsList = new List<Model.ParsedCells>();
var Cells = cells.Where(c => c.TableId_Id == table.TableId_Id && c.Worksheet == cell.Worksheet).OrderBy(i => i.Column).ToList();
foreach (var c in Cells)
{
c.ColumnName = GetColumnName(c.Column);
workSheetCellsList.Add(c);
}
tableCellsList.Add(workSheetCellsList);
cellsList.Add(tableCellsList);
}
}
}
}
if (cellsList.Count() != 0)
return View(cellsList);
else
return View("ExampleTablesAfterParsingNoData");
}
示例5: DataTable_IgnoreGroups
public JsonResult DataTable_IgnoreGroups(jQueryDataTableParamModel param, List<String> SubjectID = null, List<String> Class = null, List<String> Check = null, String Search = null, String ShowIgnore = null, String ShowNotIgnore = null)
{
if (SubjectID != null && Class != null && Check != null)
{
OutputHelper.SaveIgnoreGroups(SubjectID, Class, Check, false);
}
Dictionary<String, Group> dbGroups = Clone.Dictionary<String, Group>((Dictionary<String, Group>)(CurrentSession.Get("IgnoreGroups") ?? InputHelper.Groups));
//Dictionary<String, Group> dbGroups = InputHelper.Groups;
var Groups = from m in dbGroups.Values select m;
var total = Groups.Count();
if (!string.IsNullOrEmpty(Search))
{
Groups = Groups.Where(m => m.MaMonHoc.ToLower().Contains(Search.ToLower()) || m.TenMonHoc.ToLower().Contains(Search.ToLower()));
}
if (ShowIgnore != null && ShowNotIgnore != null)
{
if (ShowIgnore == "checked" && ShowNotIgnore != "checked")
{
Groups = Groups.Where(m => m.IsIgnored == true);
}
if (ShowIgnore != "checked" && ShowNotIgnore == "checked")
{
Groups = Groups.Where(m => m.IsIgnored == false);
}
if (ShowIgnore != "checked" && ShowNotIgnore != "checked")
{
Groups = Groups.Where(m => false);
}
}
var Result = new List<string[]>();
var MH = (from m in InputHelper.db.This
select new
{
MaMonHoc = m.MaMonHoc,
Nhom = m.Nhom,
}).Distinct();
Dictionary<String, List<String>> CheckMH = new Dictionary<string, List<string>>();
foreach (var m in MH)
{
if (CheckMH.ContainsKey(m.MaMonHoc))
CheckMH[m.MaMonHoc].Add(m.Nhom);
else
CheckMH.Add(m.MaMonHoc, new List<String> { m.Nhom });
}
foreach (var su in Groups.OrderBy(m => m.TenMonHoc))
{
if (CheckMH.ContainsKey(su.MaMonHoc))
{
if (!CheckGroup(CheckMH[su.MaMonHoc], su.Nhom.ToString()))
{
Result.Add(new string[] {
su.MaMonHoc,
su.TenMonHoc,
su.TenBoMon,
su.TenKhoa,
su.Nhom.ToString(),
su.SoLuongDK.ToString(),
su.IsIgnored ? "checked" : "",
}
);
}
}
else
{
Result.Add(new string[] {
su.MaMonHoc,
su.TenMonHoc,
su.TenBoMon,
su.TenKhoa,
su.Nhom.ToString(),
su.SoLuongDK.ToString(),
su.IsIgnored ? "checked" : "",
}
);
}
}
return Json(new
{
sEcho = param.sEcho,
iTotalRecords = Result.Count(),
iTotalDisplayRecords = Result.Count(),
//iTotalDisplayedRecords = Subjects.Count(),
aaData = Result.Skip(param.iDisplayStart).Take(param.iDisplayLength)
},
JsonRequestBehavior.AllowGet
);
}
示例6: GetTourGroupByTeId
public IList<Model.DJ_Workers> GetTourGroupByTeId(int id)
{
var listTg = Idjtourgroup.GetTourGroupByTEId(id).ToList();
var listGw = new List<Model.DJ_Group_Worker>();
var listGw2 = new List<Model.DJ_Group_Worker>();
List<DJ_Workers> Listdw = new List<DJ_Workers>();
foreach (var tg in listTg)
{
listGw.AddRange(tg.Workers.Where(x => x.DJ_Workers.WorkerType == Model.DJ_GroupWorkerType.导游).ToList<Model.DJ_Group_Worker>());
}
foreach (var item in listGw)
{
if (listGw2.Count(x => x.DJ_Workers.IDCard == item.DJ_Workers.IDCard) == 0)
{
listGw2.Add(item);
}
}
foreach (var item in listGw2)
{
Listdw.Add(item.DJ_Workers);
}
return Listdw;
}