fix again
This commit is contained in:
parent
044b7c9fec
commit
5a2ff316e2
@ -16,7 +16,6 @@ namespace ResoursesManager.Controllers
|
|||||||
{
|
{
|
||||||
private ApplicationDbContext db = new ApplicationDbContext();
|
private ApplicationDbContext db = new ApplicationDbContext();
|
||||||
|
|
||||||
// GET: Statistics
|
|
||||||
public ActionResult Index(StatisticType? statTypeId, int? resId)
|
public ActionResult Index(StatisticType? statTypeId, int? resId)
|
||||||
{
|
{
|
||||||
if (statTypeId == null)
|
if (statTypeId == null)
|
||||||
@ -42,46 +41,6 @@ namespace ResoursesManager.Controllers
|
|||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string getResourceName(int id)
|
|
||||||
{
|
|
||||||
return db.Resources.FirstOrDefault(k => k.Id == id).Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string getStatisticTypeName(StatisticType type)
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case StatisticType.ResourceCreate:
|
|
||||||
return "Create resource";
|
|
||||||
case StatisticType.ResourceModified:
|
|
||||||
return "Modify resource";
|
|
||||||
case StatisticType.ResourceDelete:
|
|
||||||
return "Delete resource";
|
|
||||||
case StatisticType.Reserv:
|
|
||||||
return "Reservation";
|
|
||||||
case StatisticType.ReservartionModified:
|
|
||||||
return "Reservation modify";
|
|
||||||
case StatisticType.ReservationDelete:
|
|
||||||
return "Reservation delete";
|
|
||||||
case StatisticType.Subscribe:
|
|
||||||
return "Subscribe";
|
|
||||||
case StatisticType.Unsubscirbe:
|
|
||||||
return "Unsubscirbe";
|
|
||||||
case StatisticType.SubscribeAll:
|
|
||||||
return "Subscribe all resource";
|
|
||||||
case StatisticType.UnsubscirbeAll:
|
|
||||||
return "Unsubscribe all resource";
|
|
||||||
case StatisticType.Register:
|
|
||||||
return "New registration";
|
|
||||||
case StatisticType.Login:
|
|
||||||
return "Log in";
|
|
||||||
case StatisticType.Logout:
|
|
||||||
return "Log out";
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing)
|
if (disposing)
|
||||||
|
@ -8,30 +8,7 @@ namespace ResoursesManager.Models
|
|||||||
{
|
{
|
||||||
public enum StatisticType
|
public enum StatisticType
|
||||||
{
|
{
|
||||||
[Description("Resource create")]
|
ResourceCreate, ResourceModified, ResourceDelete, Reserv, ReservartionModified, ReservationDelete, Subscribe, Unsubscirbe, SubscribeAll, UnsubscirbeAll, Register, Login, Logout
|
||||||
ResourceCreate,
|
|
||||||
[Description("Resource modifie")]
|
|
||||||
ResourceModified,
|
|
||||||
[Description("Resource delete")]
|
|
||||||
ResourceDelete,
|
|
||||||
[Description("Reservation")]
|
|
||||||
Reserv,
|
|
||||||
[Description("Reservation modifie")]
|
|
||||||
ReservartionModified,
|
|
||||||
[Description("Reservation delete")]
|
|
||||||
ReservationDelete,
|
|
||||||
Subscribe,
|
|
||||||
Unsubscirbe,
|
|
||||||
[Description("Subscribe to all resource")]
|
|
||||||
SubscribeAll,
|
|
||||||
[Description("Unsubscribe from all resource")]
|
|
||||||
UnsubscirbeAll,
|
|
||||||
[Description("New registration")]
|
|
||||||
Register,
|
|
||||||
[Description("Log in")]
|
|
||||||
Login,
|
|
||||||
[Description("Log out")]
|
|
||||||
Logout
|
|
||||||
}
|
}
|
||||||
public class StatisticModel
|
public class StatisticModel
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user