Beispiel #1
0
        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;

            MyCreek.Platform.Log blog = new MyCreek.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));
        }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string title = context.Request.QueryString["title"];
            string page;

            System.Data.DataTable     dt = new MyCreek.Platform.Log().GetPagerData(out page, "", title, "", "", "", "");
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            foreach (System.Data.DataRow user in dt.Rows)
            {
                sb.Append("<tr><td value='" + user["ID"] + "'>" + user["Title"] + "</td><td>" + user["Type"] + "</td><td>" + user["UserName"] + "</td><td>" + user["WriteTime"] + "</td></tr>");
            }
            context.Response.Write("{\"count\":" + new MyCreek.Platform.Log().GetCount() + ",\"data\":\"" + sb.ToString() + "\"}");
        }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string values = context.Request.QueryString["values"];
            string xx;
            var    logs = new MyCreek.Platform.Log().GetPagerData(out xx, "", "", "", "", "", "");

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            foreach (System.Data.DataRow dr in logs.Rows)
            {
                string selected = ("," + values + ",").Contains("," + dr["ID"].ToString() + ",", StringComparison.CurrentCultureIgnoreCase)
                    ?" selected=\"selected\"":"";
                sb.AppendFormat("<option value=\"{0}\"{1}>{2}</option>", dr["ID"], selected, dr["Title"]);
            }
            context.Response.Write(sb.ToString());
        }
Beispiel #4
0
        public string GetData()
        {
            long   count  = 0;
            string title  = Request.QueryString["title"];
            string type   = Request.QueryString["type"];
            string date1  = Request.QueryString["date1"];
            string date2  = Request.QueryString["date2"];
            string userid = Request.QueryString["userid"];
            string size   = Request.QueryString["pagesize"];
            string number = Request.QueryString["pagenumber"];

            MyCreek.Platform.Log  blog = new MyCreek.Platform.Log();
            System.Data.DataTable dt   = new System.Data.DataTable();// blog.GetPagerData(out count, size.ToInt(), number.ToInt(), "", title, type, date1, date2, userid);
            string data = MyCreek.Utility.Tools.DataTableToJsonString(dt);

            return("{\"count\":" + count.ToString() + ",\"data\":" + data + "}");
        }
Beispiel #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string values = context.Request.QueryString["values"];

            System.Text.StringBuilder texts = new System.Text.StringBuilder();
            MyCreek.Platform.Log      Log   = new MyCreek.Platform.Log();
            foreach (string value in values.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (value.IsGuid())
                {
                    var log = Log.Get(value.ToGuid());
                    if (log != null)
                    {
                        texts.Append(log.Title);
                        texts.Append(",");
                    }
                }
            }
            context.Response.Write(texts.ToString().TrimEnd(','));
        }