コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult AptitudeWarnGrid()
        {
            string where = "";
            Acc_Account account = GAccount.GetAccountInfo();

            where = " and a.Unit = '" + account.UnitID + "'";
            string num = UserAptitudeMan.getNewAptitudeTime();

            if (num == "")
            {
                where += " and DATEDIFF(MONTH,GETDATE(),a.CertificatDate) <= '2'";
            }
            else
            {
                where += "  and DATEDIFF(MONTH,GETDATE(),a.CertificatDate) <= '" + num + "'";
            }
            string strCurPage;
            string strRowNum;
            string UserName     = Request["userName"].ToString();
            string BusinessType = Request["businessType"].ToString();
            string TecoName     = Request["tecoName"].ToString();

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (UserName != "")
            {
                where += " and a.UserName like '%" + UserName + "%'";
            }
            if (BusinessType != "")
            {
                where += " and a.BusinessType = '" + BusinessType + "'";
            }
            if (TecoName != "")
            {
                where += " and a.TecoName like '%" + TecoName + "%'";
            }
            UIDataTable udtTask = UserAptitudeMan.getNewAptitudeGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, account.UnitID);
            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));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult AptitudeGrid()
        {
            Acc_Account account = GAccount.GetAccountInfo();

            string where = "";
            string strCurPage;
            string strRowNum;
            string UserID = "";

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (Request["userid"] != null)
            {
                UserID = Request["userid"].ToString();
            }
            if (UserID != "")
            {
                where += " and a.UserID = '" + UserID + "'";
            }
            UIDataTable udtTask = new UIDataTable();

            if (where != "")
            {
                udtTask = UserAptitudeMan.getNewAptitudeGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, account.UnitID);
            }
            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));
        }