Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public ActionResult ContractStandingBookGrid(tk_ContractSearch ContractSearch)
 {
     if (ModelState.IsValid)
     {
         Acc_Account account = GAccount.GetAccountInfo();
         string      unit    = account.UnitID.ToString();
         string where = " and a.Unit = '" + unit + "'";
         string strCurPage;
         string strRowNum;
         string Cname      = ContractSearch.Cname;
         string ContractID = ContractSearch.ContractID;
         if (Request["curpage"] != null)
         {
             strCurPage = Request["curpage"].ToString();
         }
         if (Request["rownum"] != null)
         {
             strRowNum = Request["rownum"].ToString();
         }
         else
         {
             strRowNum = "10";
         }
         if (Cname != "" && Cname != null)
         {
             where += " and a.Cname like '%" + Cname + "%'";
         }
         if (ContractID != "" && ContractID != null)
         {
             where += " and a.ContractID like '%" + ContractID + "%'";
         }
         UIDataTable udtTask = ContractMan.getNewStandingBookGrid(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));
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = false, Msg = "查询条件验证不通过" }));
     }
 }