本文整理汇总了C#中Event.Parse方法的典型用法代码示例。如果您正苦于以下问题:C# Event.Parse方法的具体用法?C# Event.Parse怎么用?C# Event.Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event.Parse方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewNominations
public ActionResult NewNominations(string dtStart = "", string dtEnd = "", string league = "0")
{
ViewData["PageTitle"] = "Twoje nowe nominacje";
((List<BreadcrumbHelper>)ViewData["breadcrumbs"]).Add(
new BreadcrumbHelper { Href = "#", Text = "Nowe nominacje" }
);
if (CurrentReferee != null)
{
var NominatedReferees = Unit.NominatedRepository.Get(filter: n => n.RefereeId == CurrentReferee.Id && !n.Confirmed); //GNRepository.Get();
List<int> RefNominationsIDS = new List<int>();
foreach (var nominated in NominatedReferees)
{
RefNominationsIDS.Add(nominated.NominationId);
}
var Nominations = Unit.NominationRepository.Get(n => n.Published && RefNominationsIDS.Contains(n.Id), n => n.OrderByDescending(o => o.PublishDate));
FillSearchNominationsForm(Nominations, dtStart, dtEnd, league);
List<NominationDetails> NominationEvents = new List<NominationDetails>();
foreach (Nomination _nomination in Nominations)
{
Event _event = new Event();
if (_nomination.GameId != null)
{
_event.Parse(_nomination.Game, "game");
}
else if (_nomination.TournamentId != null)
{
_event.Parse(_nomination.Tournament, "tournament");
}
else
{
throw new Exception("Brak typu nominacji");
}
NominationEvents.Add(new NominationDetails { Event = _event, Nomination = _nomination, NominatedReferees = _nomination.Nominateds });
}
ViewBag.Games = NominationEvents;
return View("ListNominations", NominationEvents);
}
else
{
return RedirectToAction("Index");
}
}
示例2: Profile
public ActionResult Profile()
{
if (this.CurrentUser != null)
{
string UserName = CurrentUser.UserName;
RefereeEntity refereeentity = Unit.RefereeRepository.Get(filter: r => r.Mailadr == UserName).FirstOrDefault();
if (refereeentity == null)
{
return RedirectToAction("Index");
}
ViewData["PageTitle"] = String.Format("Profil: {0} {1}", refereeentity.FirstName, refereeentity.LastName);
((List<BreadcrumbHelper>)ViewData["breadcrumbs"]).Add(
new BreadcrumbHelper { Href = "#", Text = refereeentity.FirstName + " " + refereeentity.LastName }
);
var NominatedReferees = Unit.NominatedRepository.Get(filter: n => n.RefereeId == refereeentity.Id); //GNRepository.Get();
List<int> RefNominationsIDS = new List<int>();
foreach (var nominated in NominatedReferees)
{
RefNominationsIDS.Add(nominated.NominationId);
}
var Nominations = Unit.NominationRepository.Get(n => n.Published && RefNominationsIDS.Contains(n.Id), n => n.OrderByDescending(o => o.PublishDate));
List<NominationDetails> NominationEvents = new List<NominationDetails>();
foreach (Nomination _nomination in Nominations)
{
Event _event = new Event();
if (_nomination.GameId != null)
{
_event.Parse(_nomination.Game, "game");
}
else if (_nomination.TournamentId != null)
{
_event.Parse(_nomination.Tournament, "tournament");
}
else
{
throw new Exception("Brak typu nominacji");
}
NominationEvents.Add(new NominationDetails { Event = _event, Nomination = _nomination, NominatedReferees = _nomination.Nominateds });
}
ViewBag.Games = NominationEvents;
return View("../Referee/Details", refereeentity);
}
return RedirectToAction("Index");
}
示例3: Details
public ViewResult Details(Guid id)
{
RefereeEntity refereeentity = Unit.RefereeRepository.GetById(id);
var RefereeService = new RefereeEntityService(refereeentity);
ViewBag.DaysOfNonAvilable = RefereeService.DaysOfNonAvailability(refereeentity.Availabilities.ToList<Availability>());
ViewData["PageTitle"] = String.Format("Dane sędziego: {0} {1}", refereeentity.FirstName, refereeentity.LastName);
((List<BreadcrumbHelper>)ViewData["breadcrumbs"]).Add(
new BreadcrumbHelper { Href = "#", Text = refereeentity.FirstName + " " + refereeentity.LastName }
);
ViewData["breadlinks"] = new List<BreadcrumbHelper>
{
new BreadcrumbHelper { Href = "/Referee", Text = "Listuj sędziów" },
new BreadcrumbHelper { Href = "/Referee/Create", Text = "Dodaj sędziego", Role = HelperRoles.Administrator }
};
//GamesNominatedRepository GNRepository = new GamesNominatedRepository(id);
var NominatedReferees = Unit.NominatedRepository.Get(filter: n => n.RefereeId == id); //GNRepository.Get();
List<int> RefNominationsIDS = new List<int>();
foreach (var nominated in NominatedReferees)
{
RefNominationsIDS.Add(nominated.NominationId);
}
var Nominations = Unit.NominationRepository.Get(n => n.Published && RefNominationsIDS.Contains(n.Id), n => n.OrderByDescending(o => o.PublishDate));
List<NominationDetails> NominationEvents = new List<NominationDetails>();
foreach (Nomination _nomination in Nominations)
{
Event _event = new Event();
if (_nomination.GameId != null)
{
_event.Parse(_nomination.Game, "game");
}
else if (_nomination.TournamentId != null)
{
_event.Parse(_nomination.Tournament, "tournament");
}
else
{
throw new Exception("Brak typu nominacji");
}
NominationEvents.Add(new NominationDetails { Event = _event, Nomination = _nomination, NominatedReferees = _nomination.Nominateds });
}
ViewBag.Games = NominationEvents;
return View(refereeentity);
}
示例4: Create
public ActionResult Create(int EventId, string Type)
{
Event Event = new Event();
switch (Type)
{
case "tournament":
int tournamentId = EventId;
if (tournamentId > 0)
{
Event.Parse(Unit.TournamentRepository.GetById(tournamentId), Type);
}
break;
case "game":
default:
int gameId = EventId;
if (gameId > 0)
{
var g = Unit.NominationRepository.Get(filter: n => n.GameId == gameId);
if (g.Count() > 0)
{
return RedirectToAction("Edit", new { id = g.FirstOrDefault().Id });
}
Event.Parse(Unit.GameRepository.GetById(gameId), Type);
}
break;
}
if (Event.Name == null)
{
throw new Exception("Unknown event. Could not parse this event from given ident");
}
ViewData["PageTitle"] = "Dodaj nową obsadę";
((List<BreadcrumbHelper>)ViewData["breadcrumbs"]).Add(
new BreadcrumbHelper { Href = "#", Text = "Nowa obsada" }
);
ViewData["breadlinks"] = new List<BreadcrumbHelper>
{
new BreadcrumbHelper { Href = "/Nomination", Text = "Pokaż nominacje" }
};
ViewBag.Event = Event;
ViewBag.Conflicts = GetConflictNominations(Event.MinDate, Event.MaxDate);
return View();
}
示例5: CreateEvent
private Event CreateEvent(Nomination nomination)
{
Event Event = new Event();
if (nomination.GameId != null)
{
Event.Parse(nomination.Game, "game");
}
else
{
Event.Parse(nomination.Tournament, "tournament");
}
return Event;
}
示例6: Index
//
// GET: /Nomination/
//[Authorize(Roles = HelperRoles.Sedzia)]
public ViewResult Index(string dtStart = "", string dtEnd = "", string league = "0", bool Published = false, bool NotPublished = false)
{
var Nominations = FillSearchNominationsForm(Unit.NominationRepository.Get(), dtStart, dtEnd, league, Published, NotPublished);
List<NominationDetails> NominationEvents = new List<NominationDetails>();
foreach (Nomination _nomination in Nominations)
{
Event _event = new Event();
if (_nomination.GameId != null)
{
_event.Parse(_nomination.Game, "game");
}
else if (_nomination.TournamentId != null)
{
_event.Parse(_nomination.Tournament, "tournament");
}
else
{
throw new Exception("Brak typu nominacji");
}
NominationEvents.Add(new NominationDetails { Event = _event, Nomination = _nomination, NominatedReferees = _nomination.Nominateds } );
}
if (!Request.IsAuthenticated)
{
return View("ListNominationsUnauthorized", NominationEvents.OrderByDescending(x => x.Event.MinDate));
}
return View("ListNominations", NominationEvents.OrderByDescending(x => x.Event.MinDate));
}
示例7: Edit
public ActionResult Edit(int id)
{
Nomination nomination = Unit.NominationRepository.GetById(id);
string Type = "";
if (nomination.GameId != null)
{
Type = "game";
}
else if (nomination.TournamentId != null)
{
Type = "tournament";
}
Event Event = new Event();
switch (Type)
{
case "tournament":
int TournamentId = (int)nomination.TournamentId;
if (TournamentId > 0)
{
Event.Parse(Unit.TournamentRepository.GetById(TournamentId), Type);
}
break;
case "game":
default:
int gameId = (int)nomination.GameId;
if (gameId > 0)
{
Event.Parse(Unit.GameRepository.GetById(gameId), Type);
}
break;
}
if (Event.Name == null)
{
throw new Exception("Unknown event. Could not parse this event from given ident");
}
ViewData["PageTitle"] = "Edytuj obsadę";
((List<BreadcrumbHelper>)ViewData["breadcrumbs"]).Add(
new BreadcrumbHelper { Href = "#", Text = String.Format("Obsada dla {0}", Event.Name) }
);
ViewData["breadlinks"] = new List<BreadcrumbHelper>
{
new BreadcrumbHelper { Href = "/Nomination", Text = "Pokaż nominacje" }
};
ViewData["RefereeId"] = Unit.RefereeRepository.Get();
ViewData["FunctionId"] = Unit.FunctionRepository.Get();
ViewBag.Event = Event;
return View(nomination);
}