/// <summary> /// /// </summary> /// <returns></returns> public ActionResult StaySettlementGrid() { string where = " and DATEDIFF(DAY,GETDATE(),a.CPlanEndTime) <= 7"; string strCurPage; string strRowNum; string BusinessType = Request["businessType"].ToString(); if (Request["curpage"] != null) { strCurPage = Request["curpage"].ToString(); } if (Request["rownum"] != null) { strRowNum = Request["rownum"].ToString(); } else { strRowNum = "10"; } if (BusinessType != "") { where += " and a.BusinessType = '" + BusinessType + "'"; } UIDataTable udtTask = ContractMan.getNewContractGrid(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)); }
/// <summary> /// 可以 /// </summary> /// <returns></returns> public ActionResult ContractGrid(tk_ContractSearch ContractSearch) { if (ModelState.IsValid) { string where = ""; Acc_Account account = GAccount.GetAccountInfo(); string unit = account.UnitID.ToString(); if (unit == "32" || unit == "46") { where += ""; } else { where += " and a.Unit = '" + unit + "'"; } if (account.UserRole == "3") { where += " and a.BusinessType = 'BT5'"; } 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.getNewContractGrid(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 = "查询条件验证不通过" })); } }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult StayReturnCashGrid(tk_ContractSearch ContractSearch) { if (ModelState.IsValid) { Acc_Account account = GAccount.GetAccountInfo(); string unit = account.UnitID.ToString(); string where = ""; string time = ContractMan.getNewReturnTime(); if (time == "") { where = " and a.Unit = '" + unit + "' and a.state != '2' and DATEDIFF(MONTH,GETDATE(),a.CPlanEndTime) <= '2'"; } else { where = " and a.Unit = '" + unit + "' and a.state != '2' and DATEDIFF(MONTH,GETDATE(),a.CPlanEndTime) <= '" + time + "'"; } string strCurPage; string strRowNum; //string PayOrIncome = Request["payOrIncome"].ToString(); 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 (PayOrIncome != "") // where += " and a.PayOrIncome = '" + PayOrIncome + "'"; if (Cname != "" && Cname != null) { where += " and a.Cname like '%" + Cname + "%'"; } if (ContractID != "" && ContractID != null) { where += " and a.ContractID = '" + ContractID + "'"; } UIDataTable udtTask = ContractMan.getNewContractGrid(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 = "查询条件验证不通过" })); } }