Repository navigation
Expand file tree
/
Copy pathLogController.cs
More file actions
90 lines (83 loc) · 2.93 KB
/
Copy pathLogController.cs
File metadata and controls
90 lines (83 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebMvc.Controllers
{
public class LogController : MyController
{
//
// GET: /Log/
public ActionResult Index()
{
return Index(null);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Index(FormCollection collection)
{
string title = string.Empty;
string type = string.Empty;
string date1 = string.Empty;
string date2 = string.Empty;
string userid = string.Empty;
if (collection == null)
{
title = Request.QueryString["Title"];
type = Request.QueryString["Type"];
date1 = Request.QueryString["Date1"];
date2 = Request.QueryString["Date2"];
userid = Request.QueryString["UserID"];
}
else
{
title = collection["Title"];
type = collection["Type"];
date1 = collection["Date1"];
date2 = collection["Date2"];
userid = collection["UserID"];
}
ViewBag.Title1 = title;
ViewBag.Type = type;
ViewBag.Date1 = date1;
ViewBag.Date2 = date2;
ViewBag.UserID = userid;
Business.Platform.Log blog = new Business.Platform.Log();
string query = string.Format("&appid={0}&tabid={1}&Title={2}&Type={3}&Date1={4}&Date2={5}&UserID={6}",
Request.QueryString["appid"],
Request.QueryString["tabid"],
title.UrlEncode(),
type.UrlEncode(),
date1,
date2,
userid
);
string pager;
System.Data.DataTable dt = blog.GetPagerData(out pager, query, title, type, date1, date2, userid);
ViewBag.TypeOptions = blog.GetTypeOptions(type);
ViewBag.Pager = pager;
ViewBag.Query = query;
return View(dt);
}
public string GetData(string title="", string type="", string date1="", string date2="", string userid="")
{
string pager;
Business.Platform.Log blog = new Business.Platform.Log();
System.Data.DataTable dt = blog.GetPagerData(out pager, "", title, type, date1, date2, userid);
return Utility.Tools.DataTableToJsonString(dt);
}
public ActionResult Detail()
{
string id = Request.QueryString["id"];
if (id.IsGuid())
{
return View(new Business.Platform.Log().Get(id.ToGuid()));
}
else
{
return View(new Data.Model.Log());
}
}
}
}