markus / MarkusLogview / MARKUS_LOGVIEW / Controllers / LicenseController.cs @ 84578b97
이력 | 보기 | 이력해설 | 다운로드 (1.03 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel.DataAnnotations; |
4 |
using System.Linq; |
5 |
using System.Web; |
6 |
using System.Web.Mvc; |
7 |
|
8 |
namespace MARKUS_LOGVIEW.Controllers |
9 |
{ |
10 |
public class LicenseController : Controller |
11 |
{ |
12 |
[DisplayFormat(DataFormatString = "yyyy-mm-dd")] |
13 |
public DateTime? beforeDate { get; set; } |
14 |
[DisplayFormat(DataFormatString = "yyyy-mm-dd")] |
15 |
public DateTime? afterDate { get; set; } |
16 |
|
17 |
// GET: License |
18 |
public ActionResult Index() |
19 |
{ |
20 |
|
21 |
if (Session["accessToken"] != null) |
22 |
{ |
23 |
|
24 |
beforeDate = DateTime.Today.AddDays(-1); |
25 |
afterDate = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59); |
26 |
|
27 |
ViewBag.startDate = beforeDate.Value.ToString("yyyy-MM-dd"); |
28 |
ViewBag.endDate = afterDate.Value.ToString("yyyy-MM-dd"); |
29 |
|
30 |
return View(); |
31 |
|
32 |
} |
33 |
else |
34 |
{ |
35 |
return Redirect("/Login/Index"); |
36 |
} |
37 |
|
38 |
} |
39 |
} |
40 |
} |