Beispiel #1
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());
        }
Beispiel #2
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));
        }
Beispiel #3
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));
        }
Beispiel #4
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));
        }
Beispiel #5
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());
        }
Beispiel #6
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));
        }
Beispiel #7
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));
        }