Esempio n. 1
0
        public ActionResult InsertContent()
        {
            var    type   = Request["Type"];
            var    text   = Request["Text"];
            string strErr = "";

            if (SystemProjectMan.InsertNewContent(type, text, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
Esempio n. 2
0
        public ActionResult DeleteContent()
        {
            var    xid    = Request["data1"];
            var    type   = Request["data2"];
            string strErr = "";

            if (SystemProjectMan.DeleteNewContent(xid, type, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
Esempio n. 3
0
        public ActionResult upNewContent()
        {
            var    XID    = Request["XID"];
            var    Type   = Request["Type"];
            var    Text   = Request["Text"];
            string strErr = "";

            if (SystemProjectMan.UpdateNewContent(XID, Type, Text, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
Esempio n. 4
0
        public ActionResult BasicGrid()
        {
            string strCurPage;
            string strRowNum;

            string where = "";
            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            string type = Request["sel"].ToString();

            if (type != "")
            {
                where += " and a.Type ='" + type + "' ";
            }
            UIDataTable udtTask = new UIDataTable();

            if (where != "")
            {
                udtTask = SystemProjectMan.getNewBasicGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
            }
            string strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }