예제 #1
0
        public string InvokeRequest(string postStr)
        {
            Model.Rsp34 rsp = new Model.Rsp34();

            try
            {
                Helper.LogWrite("SI34 Request:" + postStr);
                this.req = Helper.Deserialize <Model.Req34>(postStr);
                if (req.data.leasenum != "")
                {
                    DataTable dt = this.GetPendingPay(req.data.leasenum);
                    if (dt.Rows.Count > 0)
                    {
                        Aid.AttachRowId(dt);
                        rsp.data.result       = "100";
                        rsp.data.message      = "获取成功!";
                        rsp.data.customername = Helper.DbNull2Str(dt.Rows[0]["customername"]);
                        rsp.data.payinfonum   = Helper.DbNull2Int(dt.Rows.Count);
                        rsp.data.premisename  = Helper.DbNull2Str(dt.Rows[0]["premisename"]);
                        rsp.data.shoparea     = Helper.DbNull2Str(dt.Rows[0]["shoparea"]);
                        rsp.data.shopname     = Helper.DbNull2Str(dt.Rows[0]["shopname"]);

                        rsp.data.totalamount = Helper.DbNull2Dec(dt.Compute("sum(outstanding)", ""));
                        rsp.data.payinfo     = Aid.DT2List <Model.Rsp34dataDtl>(dt) as List <Model.Rsp34dataDtl>;
                    }
                    else
                    {
                        rsp.data.result  = "200";
                        rsp.data.message = "没有找到数据";
                    }
                }
                else
                {
                    rsp.code   = "100";
                    rsp.status = "true";
                    rsp.msg    = "请求成功!";
                    rsp.time   = Helper.Today;

                    rsp.data.result  = "200";
                    rsp.data.message = "租约号为空,无法查询";
                }
            }
            catch (Exception err)
            {
                rsp.code   = "200";
                rsp.status = "false";
                rsp.msg    = "系统错误:" + err.Message;
                rsp.time   = Helper.Today;
            }
            rsp.raw = Common.Helper.JsonSerialize(rsp);
            return(Common.Helper.JsonSerialize(rsp));
        }