Exemplo n.º 1
0
        /// <summary>
        /// 存取款
        /// </summary>
        /// <param name="custNo">客户编号</param>
        /// <returns></returns>
        public ActionResult PayGetMoney_Server(string custNo)
        {
            CommonResult result = new CommonResult();

            try
            {
                var endcode    = Session["EndCode"] ?? "0";
                var payMoney   = Request["payMoney"] ?? "0";
                var sRemark    = "";
                var iUserID    = Session["UserID"].ToString().ToInt();
                var sReceiptNo = "";
                DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
                var flag = DbServer.Account_DepositOperate(endcode.ToString().ToInt32(), custNo.ToInt32(), payMoney.ToDouble(), sRemark, iUserID, sReceiptNo);
                if (flag.IsSuccess)
                {
                    result.Success = true;
                    result.Data1   = flag.StrData1;
                }
                else
                {
                    result.ErrorMessage = flag.ErrorMsg;
                    result.Success      = false;
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(ToJsonContentDate(result));
        }
Exemplo n.º 2
0
        public ActionResult Update_Server(DbServiceReference.PriceType info)
        {
            //检查用户是否有权限,否则抛出MyDenyAccessException异常
            base.CheckAuthorized(AuthorizeKey.UpdateKey);
            CommonResult result = new CommonResult();

            try
            {
                //调用后台服务获取集中器信息
                DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
                var flag = DbServer.PriceType_Upd(info);
                if (flag == "0")
                {
                    result.Success = true;
                }
                else
                {
                    result.ErrorMessage = flag;
                }
            }
            catch (Exception ex)
            {
                LogTextHelper.Error(ex);//错误记录
                result.ErrorMessage = ex.Message;
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 3
0
        public ActionResult CollectChartJson()
        {
            var start        = Request["dtStart"].ToDateTime();
            var end          = Request["dtEnd"].ToDateTime();
            var endcode      = Session["EndCode"] ?? "";
            var customerinfo = new DbServiceReference.Customer();
            var dt           = new DbServiceReference.ServiceDbClient().CollectData_Qry(endcode.ToString().ToInt(), customerinfo, start, end);
            var chart        = new ChartDataSimple()
            {
                categories = new List <string>(),
                series     = new List <ChartDataSimple.SeriesItem>()
            };
            var si = new ChartDataSimple.SeriesItem()
            {
                data = new List <decimal?>(), name = "用量"
            };

            for (var now = start; now <= end; now = now.AddDays(1))
            {
                chart.categories.Add(now.ToYyyyMMdd());
                var rows = dt.Select("DteFreeze='{0}'".FormatWith(now.ToYyyyMMdd()));
                if (rows.Count() > 0)
                {
                    si.data.Add(rows[0]["NumReading"].ToString().ToDecimalOrZero());
                }
                else
                {
                    si.data.Add(0);
                }
            }
            chart.series.Add(si);
            return(ToJsonContentDate(chart));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 打印扣费信息
        /// </summary>
        /// <param name="IntFeeID">客户编号</param>
        /// <returns></returns>
        public ActionResult PrintTicketDetail(int IntFeeID)
        {
            var endcode  = Session["EndCode"] ?? "0";
            var DtStart  = Request["WHC_DtStart"] ?? DateTime.Now.ToString();
            var Dtend    = Request["WHC_DtEnd"] ?? DateTime.Now.ToString();;
            var custinfo = new DbServiceReference.Customer();
            var dt       = new DbServiceReference.ServiceDbClient().Account_GetPaymentDetail(endcode.ToString().ToInt(), IntFeeID, DtStart.ToDateTime(), Dtend.ToDateTime(), custinfo);

            if (dt.Rows.Count > 0)
            {
                ViewBag.IntCustNo  = dt.Rows[0]["IntCustNo"].ToString();
                ViewBag.NvcName    = dt.Rows[0]["NvcName"].ToString();
                ViewBag.VcRoomNum  = dt.Rows[0]["VcRoomNum"].ToString();
                ViewBag.NvcVillage = dt.Rows[0]["NvcVillage"].ToString();
                ViewBag.NvcAddr    = dt.Rows[0]["NvcAddr"].ToString();
                ViewBag.IntYearMon = dt.Rows[0]["IntYearMon"].ToString();
                ViewBag.DteFee     = dt.Rows[0]["DteFee"].ToString();
                var MonFee = dt.Rows[0]["MonFee"].ToString().ToDouble();
                ViewBag.MonFee = MonFee.ToString("#0.00");
                var MonPenalty = dt.Rows[0]["MonPenalty"].ToString().ToDouble();
                ViewBag.MonPenalty = MonPenalty.ToString("#0.00");;
                ViewBag.IntDays    = dt.Rows[0]["IntDays"].ToString();
                ViewBag.VcFlowNo   = dt.Rows[0]["VcFlowNo"].ToString();
                ViewBag.IntPayUnit = dt.Rows[0]["IntPayUnit"].ToString();
                ViewBag.VcChargeNo = dt.Rows[0]["VcChargeNo"].ToString();
            }
            return(View());
        }
Exemplo n.º 5
0
        public ActionResult Insert_Server(DbServiceReference.PriceType info)
        {
            //检查用户是否有权限,否则抛出MyDenyAccessException异常
            base.CheckAuthorized(AuthorizeKey.InsertKey);
            CommonResult result = new CommonResult();

            try
            {
                var endcode = Session["EndCode"] ?? "0";
                //调用后台服务获取集中器信息
                DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
                var flag = DbServer.PriceType_Ins(endcode.ToString().ToInt32(), info);
                if (flag == "0")
                {
                    result.Success = true;
                }
                else
                {
                    result.ErrorMessage = flag;
                }
            }
            catch (Exception ex)
            {
                LogTextHelper.Error(ex);//错误记录
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 6
0
        public ActionResult StatDepositDataTotal_Server()
        {
            CommonResult result     = new CommonResult();
            var          endcode    = Session["IntEndCode"] ?? "0";
            var          DteBegin   = Request["WHC_dtStart"].ToDateTime();
            var          DteEnd     = Request["WHC_dtEnd"].ToDateTime();
            var          StatMode   = Request["WHC_iStatMode"] ?? "0";
            var          paramMode  = Request["WHC_paramMode"] ?? "0";
            var          paramValue = Request["WHC_paramValue"] ?? "";

            try
            {
                var rs = new DbServiceReference.ServiceDbClient().StatDepositData(endcode.ToString().ToInt(), paramMode.ToInt(), paramValue, StatMode.ToInt(), DteBegin, DteEnd);
                if (rs.IsSuccess)
                {
                    result.Data1 = rs.StrData1;
                    result.Data2 = rs.StrData2;
                }
                else
                {
                    result.ErrorMessage = rs.ErrorMsg;
                    result.Success      = false;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMessage = "查询失败!错误如下:" + ex.Message;
            }
            return(ToJsonContentDate(result));
        }
Exemplo n.º 7
0
        public ActionResult StatClientArcDataTotal_Server()
        {
            CommonResult result   = new CommonResult();
            var          endcode  = Session["IntEndCode"] ?? "0";
            var          DteBegin = Request["WHC_dtStart"].ToDateTime();
            var          DteEnd   = Request["WHC_dtEnd"].ToDateTime();

            try
            {
                var rs = new DbServiceReference.ServiceDbClient().StatClientArcData(endcode.ToString().ToInt(), DteBegin, DteEnd);
                if (rs.IsSuccess)
                {
                    DataTable dts = JsonConvert.DeserializeObject <DataTable>(rs.StrData1);
                    if (dts.Rows.Count > 0)
                    {
                        result.Data1 = dts.Rows.Count.ToString();
                    }
                }
                else
                {
                    result.ErrorMessage = rs.ErrorMsg;
                    result.Success      = false;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMessage = "查询失败!错误如下:" + ex.Message;
            }
            return(ToJsonContentDate(result));
        }
Exemplo n.º 8
0
        //柜台冲正数据
        public ActionResult CounterReverseDataByIntCustNo_Server()
        {
            var custno  = Request["WHC_IntCustNo"] ?? "0";
            var endcode = Session["EndCode"] ?? "0";

            DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
            var       dts  = DbServer.Account_GetWriteoffByCustNo(endcode.ToString().ToInt32(), custno.ToInt32());
            int       rows = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            int       page = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            DataTable dat  = new DataTable();

            //复制源的架构和约束
            dat = dts.Clone();
            // 清除目标的所有数据
            dat.Clear();
            //对数据进行分页
            for (int i = (page - 1) * rows; i < page * rows && i < dts.Rows.Count; i++)
            {
                dat.ImportRow(dts.Rows[i]);
            }
            //最重要的是在后台取数据放在json中要添加个参数total来存放数据的总行数,如果没有这个参数则不能分页
            int total  = dts.Rows.Count;
            var result = new { total, rows = dat };

            return(ToJsonContentDate(result));
        }
Exemplo n.º 9
0
        public ActionResult TemplateList_Server()
        {
            var endcode          = Session["EndCode"] ?? "0";
            var Status           = Request["WHC_IntStatus"] ?? "-1";
            var id               = Request["WHC_IntID"] ?? "0";
            var SmsTemplate_info = new DbServiceReference.SmsTemplate
            {
                NvcName   = Request["WHC_TempName"] ?? "",
                IntID     = id == "" ? 0 : id.ToInt32(),
                IntStatus = Status == "" ? 0 : Status.ToInt32()
            };

            DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
            var       dts  = DbServer.SMS_Template_Qry(endcode.ToString().ToInt32(), SmsTemplate_info);
            int       rows = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            int       page = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            DataTable dat  = new DataTable();

            //复制源的架构和约束
            dat = dts.Clone();
            // 清除目标的所有数据
            dat.Clear();
            //对数据进行分页
            for (int i = (page - 1) * rows; i < page * rows && i < dts.Rows.Count; i++)
            {
                dat.ImportRow(dts.Rows[i]);
            }
            //最重要的是在后台取数据放在json中要添加个参数total来存放数据的总行数,如果没有这个参数则不能分页
            int total  = dts.Rows.Count;
            var result = new { total, rows = dat };

            return(ToJsonContentDate(result));
        }
Exemplo n.º 10
0
        public ActionResult CloseAccount_Close_Server(string custNo)
        {
            CommonResult result = new CommonResult();

            try
            {
                var endcode   = Session["EndCode"].ToString() ?? "0";
                var intcustno = custNo ?? "0";
                var flag      = new DbServiceReference.ServiceDbClient().ArcCloseAccount(endcode.ToInt32(), intcustno.ToInt32());

                if (flag == "0")
                {
                    result.Success = true;
                }
                else
                {
                    result.ErrorMessage = "操作失败! " + flag;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMessage = "操作失败!错误如下:" + ex.Message;
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 11
0
        public ActionResult InsOrUpd_Server(DbServiceReference.SmsTemplate info)
        {
            CommonResult result = new CommonResult();

            try
            {
                DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();
                var flag = DbServer.SMS_Template_InsOrUpd(info);
                info.DtLstUpd = DateTime.Now;
                if (flag == "0")
                {
                    result.Success = true;
                }
                else
                {
                    result.ErrorMessage = flag;
                }
            }
            catch (Exception ex)
            {
                LogTextHelper.Error(ex);//错误记录
                result.ErrorMessage = ex.Message;
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 12
0
        public ActionResult GetTreeJson_Server()
        {
            var endcode = Session["EndCode"] ?? "0";

            //调用后台服务获取集中器信息
            DbServiceReference.ServiceDbClient DbServer = new DbServiceReference.ServiceDbClient();

            var dts = DbServer.PriceType_GetTreeJson(endcode.ToString().ToInt32());

            return(ToJsonContentDate(dts));
        }
Exemplo n.º 13
0
        public ActionResult CollectStatJsonTotal_Server()
        {
            CommonResult result             = new CommonResult();
            var          endcode            = Session["EndCode"] ?? "";
            var          WHC_StartDteFreeze = Request["WHC_StratDteFreeze"].ToDateTime();
            var          WHC_EndDteFreeze   = Request["WHC_EndDteFreeze"].ToDateTime();
            var          fuji         = Request["WHC_Fuji"];
            var          Text         = Request["WHC_Text"];
            var          Strlevel     = Request["WHC_Treelevel"];
            var          ParentText   = Request["WHC_TreePrentText"];
            var          customerinfo = new DbServiceReference.Customer()
            {
                NvcName  = Request["WHC_NvcName"] ?? "",
                VcMobile = Request["WHC_VcMobile"] ?? "",
            };
            var custno = Request["WHC_IntCustNo"] ?? "0";

            customerinfo.IntNo = custno == "" ? 0 : custno.ToInt();

            if (Strlevel == "1")
            {
                customerinfo.NvcVillage = "所有小区";
            }
            ;
            if (Strlevel == "2")
            {
                customerinfo.NvcVillage = Text;
            }
            if (Strlevel == "3")
            {
                customerinfo.NvcVillage = fuji;
                customerinfo.VcBuilding = Text;
            }
            if (Strlevel == "4")
            {
                customerinfo.NvcVillage = ParentText;
                customerinfo.VcBuilding = fuji;
                customerinfo.VcUnitNum  = Text;
            }
            //调用后台服务获取集中器信息
            var dts = new DbServiceReference.ServiceDbClient().CollectStatus_Qry(endcode.ToString().ToInt(), customerinfo, WHC_StartDteFreeze, WHC_EndDteFreeze);
            var m   = new CollectStatModel();

            foreach (DataRow item in dts.Rows)
            {
                m.Used += item["Reading"].ToString().ToDecimalOrZero();
            }
            result.Data1 = dts.Rows.Count.ToString();
            result.Data2 = m.Used.ToString();
            return(ToJsonContentDate(result));
        }
Exemplo n.º 14
0
        public ActionResult StatDepositData_Server()
        {
            CommonResult result     = new CommonResult();
            var          endcode    = Session["IntEndCode"] ?? "0";
            var          DteBegin   = Request["WHC_dtStart"].ToDateTime();
            var          DteEnd     = Request["WHC_dtEnd"].ToDateTime();
            var          StatMode   = Request["WHC_iStatMode"] ?? "0";
            var          paramMode  = Request["WHC_paramMode"] ?? "0";
            var          paramValue = Request["WHC_paramValue"] ?? "";

            try
            {
                var rs = new DbServiceReference.ServiceDbClient().StatDepositData(endcode.ToString().ToInt(), paramMode.ToInt(), paramValue, StatMode.ToInt(), DteBegin, DteEnd);
                if (rs.IsSuccess)
                {
                    DataTable dts = JsonConvert.DeserializeObject <DataTable>(rs.StrData3);
                    if (dts.Rows.Count > 0)
                    {
                        int       rows = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
                        int       page = Request["page"] == null ? 1 : int.Parse(Request["page"]);
                        DataTable dat  = new DataTable();
                        //复制源的架构和约束
                        dat = dts.Clone();
                        // 清除目标的所有数据
                        dat.Clear();
                        //对数据进行分页
                        for (int i = (page - 1) * rows; i < page * rows && i < dts.Rows.Count; i++)
                        {
                            dat.ImportRow(dts.Rows[i]);
                        }
                        //最重要的是在后台取数据放在json中要添加个参数total来存放数据的总行数,如果没有这个参数则不能分页
                        int total = dts.Rows.Count;
                        var dt    = new { total, rows = dat };
                        result.Success = true;
                        return(ToJsonContentDate(dt));
                    }
                }
                else
                {
                    result.ErrorMessage = rs.ErrorMsg;
                    result.Success      = false;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMessage = "查询失败!错误如下:" + ex.Message;
            }
            return(ToJsonContentDate(result));
        }
Exemplo n.º 15
0
        /// <summary>
        /// 获取未收财务
        /// </summary>
        /// <returns></returns>
        public ActionResult GetPaymentNoticeList_Server()
        {
            var endcode  = Session["IntEndCode"] ?? "0";
            var CustNo   = Request["WHC_IntCustNo"] ?? "";
            var NvcName  = Request["WHC_NvcName"] ?? "";
            var NvcAddr  = Request["WHC_NvcAddr"] ?? "";
            var VcMobile = Request["WHC_VcMobile"] ?? "";
            var custinfo = new DbServiceReference.Customer
            {
                IntNo    = CustNo == "" ? 0 : CustNo.ToInt(),
                NvcName  = NvcName,
                NvcAddr  = NvcAddr,
                VcMobile = VcMobile
            };
            var dt     = new DbServiceReference.ServiceDbClient().Account_GetPaymentNotice(endcode.ToString().ToInt(), custinfo);
            var result = new { total = dt.Rows.Count, rows = dt };

            return(ToJsonContentDate(result));
        }
Exemplo n.º 16
0
        public ActionResult PaymentNoticeExport()
        {
            var endcode  = Session["IntEndCode"] ?? "0";
            var CustNo   = Request["WHC_IntCustNo"];
            var NvcName  = Request["WHC_NvcName"];
            var NvcAddr  = Request["WHC_NvcAddr"];
            var VcMobile = Request["WHC_VcMobile"];
            var custinfo = new DbServiceReference.Customer
            {
                IntNo    = CustNo == "" ? 0 : CustNo.ToInt(),
                NvcName  = NvcName,
                NvcAddr  = NvcAddr,
                VcMobile = VcMobile
            };
            var dt = new DbServiceReference.ServiceDbClient().Account_GetPaymentNotice(endcode.ToString().ToInt(), custinfo);

            if (dt.Rows.Count > 0)
            {
                //导出目录创建与清空
                var root = Server.MapPath("~\\");
                var dir  = new System.IO.DirectoryInfo(root + "temp\\");
                if (dir.Exists == false)
                {
                    dir.Create();
                }
                try
                {
                    foreach (var item in dir.GetFiles())
                    {
                        item.Delete();
                    }
                }
                catch { }
                var filename = dir + Guid.NewGuid().ToString() + ".xls";
                var ds       = new System.Data.DataSet();
                ds.Tables.Add(dt);
                ExcelHelper.DataSetToExcel(ds, filename);
                return(Redirect(filename.Replace(root, "/").Replace("\\", "/")));
            }
            return(View());
        }
Exemplo n.º 17
0
        public ActionResult WriteNumReading_Server()
        {
            CommonResult result     = new CommonResult();
            var          endcode    = Session["EndCode"] ?? "0";
            var          IntCustNo  = Request["IntCustNo"];
            var          VcAddr     = Request["VcAddr"];
            var          DteFreeze  = Request["DteFreeze"].ToDateTime();
            var          NumReading = Request["NumReading"].ToDouble();
            var          rs         = new DbServiceReference.ServiceDbClient().CollectData_Ins(endcode.ToString().ToInt(), IntCustNo.ToInt32(), VcAddr, DteFreeze, NumReading, Session["UserID"].ToString());

            if (rs == "0")
            {
                result.Success = true;
            }
            else
            {
                result.Success      = false;
                result.ErrorMessage = rs;
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 18
0
        public ActionResult CounterReverseData_Server()
        {
            var endcode  = Session["EndCode"] ?? "0";
            var CustNo   = Request["WHC_IntCustNo"] ?? "";
            var NvcName  = Request["WHC_NvcName"] ?? "";
            var NvcAddr  = Request["WHC_NvcAddr"] ?? "";
            var VcMobile = Request["WHC_VcMobile"] ?? DateTime.Now.ToString();
            var DtStart  = Request["WHC_DtStart"] ?? DateTime.Now.ToString();
            var Dtend    = Request["WHC_DtEnd"] ?? "";
            var custinfo = new DbServiceReference.Customer
            {
                IntNo    = CustNo == "" ? 0 : CustNo.ToInt(),
                NvcName  = NvcName,
                NvcAddr  = NvcAddr,
                VcMobile = VcMobile
            };
            var dt     = new DbServiceReference.ServiceDbClient().Account_GetPaymentDetail(endcode.ToString().ToInt(), 0, DtStart.ToDateTime(), Dtend.ToDateTime(), custinfo);
            var result = new { total = dt.Rows.Count, rows = dt };

            return(ToJsonContentDate(result));
        }
Exemplo n.º 19
0
        /// <summary>
        ///  打印存取款收据
        /// </summary>
        public ActionResult PayGetMoneyPrint(string flowNo)
        {
            var endcode = Session["EndCode"] ?? "0";

            var dt = new DbServiceReference.ServiceDbClient().Account_GetDepositInvoiceInfo(endcode.ToString().ToInt32(), flowNo);

            if (dt.Rows.Count > 0)
            {
                ViewBag.IntCustNo  = dt.Rows[0]["IntCustNo"].ToString();
                ViewBag.NvcName    = dt.Rows[0]["NvcName"].ToString();
                ViewBag.VcRoomNum  = dt.Rows[0]["VcRoomNum"].ToString();
                ViewBag.NvcVillage = dt.Rows[0]["NvcVillage"].ToString();
                ViewBag.NvcAddr    = dt.Rows[0]["NvcAddr"].ToString();
                ViewBag.VcType     = dt.Rows[0]["VcType"].ToString();
                var MonAmount = dt.Rows[0]["MonAmount"].ToString().ToDouble();
                ViewBag.MonAmount  = MonAmount.ToString("#0.00");
                ViewBag.DteAccount = dt.Rows[0]["DteAccount"].ToString();
                ViewBag.VcFlowNo   = dt.Rows[0]["VcFlowNo"].ToString();
                ViewBag.UserName   = dt.Rows[0]["UserName"].ToString();
            }
            return(View());
        }
Exemplo n.º 20
0
        public ActionResult CloseAccount_Query_Server(string custNo)
        {
            CommonResult result    = new CommonResult();
            var          endcode   = Session["EndCode"].ToString() ?? "0";
            var          intcustno = custNo ?? "0";

            try
            {
                var rs = new DbServiceReference.ServiceDbClient().Account_GetBillByCustNo(endcode.ToInt32(), intcustno.ToInt32());
                if (rs.IsSuccess)
                {
                    if (rs.Tbl1.Rows.Count > 0)
                    {
                        result.Data1 = Newtonsoft.Json.JsonConvert.SerializeObject(rs.Tbl1);
                        var dt = new { total = rs.Tbl2.Rows.Count, rows = rs.Tbl2 };
                        result.Success = true;
                        result.Obj1    = dt;
                        result.Data2   = rs.Tbl2.Rows.Count.ToString();
                        //result.Data2 = "2";
                    }
                    else
                    {
                        result.ErrorMessage = "未查询到用户号为:【" + custNo + "】 的用户档案";
                    }
                }
                else
                {
                    result.ErrorMessage = "查询欠费失败!错误如下:" + rs.ErrorMsg;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMessage = "查询欠费失败!错误如下:" + ex.Message;
            }
            return(ToJsonContent(result));
        }
Exemplo n.º 21
0
        public ActionResult ListJson_Server()
        {
            var endcode            = Session["EndCode"] ?? "";
            var WHC_StartDteFreeze = Request["WHC_StratDteFreeze"].ToDateTime();
            var WHC_EndDteFreeze   = Request["WHC_EndDteFreeze"].ToDateTime();
            var fuji         = Request["WHC_Fuji"];
            var Text         = Request["WHC_Text"];
            var Strlevel     = Request["WHC_Treelevel"];
            var ParentText   = Request["WHC_TreePrentText"];
            var customerinfo = new DbServiceReference.Customer()
            {
                NvcName  = Request["WHC_NvcName"] ?? "",
                VcMobile = Request["WHC_VcMobile"] ?? "",
            };
            var custno = Request["WHC_IntCustNo"] ?? "0";

            customerinfo.IntNo = custno == "" ? 0 : custno.ToInt();

            if (Strlevel == "1")
            {
                customerinfo.NvcVillage = "所有小区";
            }
            ;
            if (Strlevel == "2")
            {
                customerinfo.NvcVillage = Text;
            }
            if (Strlevel == "3")
            {
                customerinfo.NvcVillage = fuji;
                customerinfo.VcBuilding = Text;
            }
            if (Strlevel == "4")
            {
                customerinfo.NvcVillage = ParentText;
                customerinfo.VcBuilding = fuji;
                customerinfo.VcUnitNum  = Text;
            }
            //调用后台服务获取集中器信息
            var dts = new DbServiceReference.ServiceDbClient().CollectData_Qry(endcode.ToString().ToInt(), customerinfo, WHC_StartDteFreeze, WHC_EndDteFreeze);

            int rows = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            int page = Request["page"] == null ? 1 : int.Parse(Request["page"]);

            DataTable dat = new DataTable();

            //复制源的架构和约束
            dat = dts.Clone();
            // 清除目标的所有数据
            dat.Clear();
            //对数据进行分页
            for (int i = (page - 1) * rows; i < page * rows && i < dts.Rows.Count; i++)
            {
                dat.ImportRow(dts.Rows[i]);
            }
            //最重要的是在后台取数据放在json中要添加个参数total来存放数据的总行数,如果没有这个参数则不能分页
            int total  = dts.Rows.Count;
            var result = new { total = total, rows = dat };

            return(ToJsonContentDate(result));
        }