Exemple #1
0
        private string refundaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
                setting.load("CurrParkNo");

                ButlerSrv.AppService service = new ButlerSrv.AppService();
                string str1 = service.CRDispositLoad(jp.getValue("id"), "5218E3ED752A49D4");

                Entity.Op.EntityPayment ot = new project.Entity.Op.EntityPayment();
                object oj = JsonToObject(str1, ot);
                Entity.Op.EntityPayment bc = (Entity.Op.EntityPayment)oj;

                if (bc.ARState != "0")
                {
                    flag = "3";
                    collection.Add(new JsonStringValue("info", "客服尚未申请退押金,当前状态不允许退押金!"));
                }
                else
                {
                    RefundReturn rt = Refund(bc.TransactionId, bc.PayNo,
                                             (ParseDecimalForString(bc.Amount) * 100).ToString("0"),
                                             (ParseDecimalForString(bc.RefundAmount) * 100).ToString("0"));
                    if (rt.ResultCode == "SUCCESS")
                    {
                        string InfoMsg = service.Refund_Disposrit(jp.getValue("id"), "5218E3ED752A49D4");
                        if (InfoMsg != "")
                        {
                            flag = "3";
                            collection.Add(new JsonStringValue("info", "退押金成功,服务申请状态修改异常!"));
                        }
                        else
                        {
                            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("MinDate"), jp.getValue("MaxDate"),
                                                                                     jp.getValue("PayState"), ParseIntForString(jp.getValue("page")))));
                        }
                    }
                    else
                    {
                        flag = "3";
                        collection.Add(new JsonStringValue("info", rt.ErrCodeDes));
                    }
                }
            }
            catch (Exception ex)
            {
                flag = "3";
                collection.Add(new JsonStringValue("info", ex.ToString()));
            }

            collection.Add(new JsonStringValue("type", "refund"));
            collection.Add(new JsonStringValue("flag", flag));

            return(collection.ToString());
        }
Exemple #2
0
        private string createList(string MinDate, string MaxDate, string PayState, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='10%'>支付单号</th>");
            sb.Append("<th width='12%'>会议室名称</th>");
            sb.Append("<th width='13%'>申请客户</th>");
            sb.Append("<th width='10%'>申请人</th>");
            sb.Append("<th width='10%'>租赁时间</th>");
            sb.Append("<th width='10%'>支付金额</th>");
            sb.Append("<th width='10%'>租金</th>");
            sb.Append("<th width='10%'>押金</th>");
            sb.Append("<th width='10%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
            setting.load("CurrParkNo");

            ButlerSrv.AppService service = new ButlerSrv.AppService();
            string str1 = service.GetCRDispositList(setting.Entity.StringValue, MinDate, MaxDate, PayState, page, 15, "5218E3ED752A49D4");

            PaymentInfo ot = new PaymentInfo();
            object      oj = JsonToObject(str1, ot);

            foreach (Entity.Op.EntityPayment it in ((PaymentInfo)oj).list)
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.PayNo + "</td>");
                sb.Append("<td>" + it.CRName + "</td>");
                sb.Append("<td>" + it.ApplyCustName + "</td>");
                sb.Append("<td>" + it.ApplyUserName + "</td>");
                sb.Append("<td>" + it.ReservedTime + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.Amount).ToString("0.##") + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.RentAmount).ToString("0.##") + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.Disposit).ToString("0.##") + "</td>");
                sb.Append("<td><span class=\"label " + (it.ARState == "1" ? "label-success" : "") + " radius\">" + it.ARStateName + "</span></td>");

                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(service.GetCRDispositCount(setting.Entity.StringValue, MinDate, MaxDate, PayState, "5218E3ED752A49D4"), pageSize, page, 7));
            return(sb.ToString());
        }
Exemple #3
0
        private string createList(string MinApplyDate, string MaxApplyDate, string State, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='13%'>申请单号</th>");
            sb.Append("<th width='13%'>申请日期</th>");
            sb.Append("<th width='13%'>申请客户</th>");
            sb.Append("<th width='13%'>申请人</th>");
            sb.Append("<th width='18%'>租赁时间</th>");
            sb.Append("<th width='13%'>金额</th>");
            sb.Append("<th width='12%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
            setting.load("CurrParkNo");

            ButlerSrv.AppService service = new ButlerSrv.AppService();
            string str1 = service.GetRefundList(setting.Entity.StringValue, MinApplyDate, MaxApplyDate, State, page, 15, "5218E3ED752A49D4");

            ApplyRefundInfo ot = new ApplyRefundInfo();
            object          oj = JsonToObject(str1, ot);

            foreach (Entity.Op.EntityApplyRefund it in ((ApplyRefundInfo)oj).list)
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.ARNo + "</td>");
                sb.Append("<td>" + ParseDateForString(it.ApplyDate).ToString("yyyy-MM-dd HH:mm") + "</td>");
                sb.Append("<td>" + it.ApplyCustName + "</td>");
                sb.Append("<td>" + it.ApplyUserName + "</td>");
                sb.Append("<td>" + it.LeaseTime + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.RefundAmount).ToString("0.##") + "</td>");
                sb.Append("<td><span class=\"label " + (it.ARState == "0" ? "" : "label-success") + " radius\">" + (it.ARState == "0" ? "未退款" : "已退款") + "</span></td>");

                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(service.GetRefundCount(setting.Entity.StringValue, MinApplyDate, MaxApplyDate, "5218E3ED752A49D4"), pageSize, page, 7));
            return(sb.ToString());
        }
Exemple #4
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);
                    userName = user.Entity.UserName;
                    CheckRight(user.Entity, "pm/Op/ContractRefund_PT.aspx");

                    if (!Page.IsCallback)
                    {
                        if (user.Entity.UserType.ToUpper() != "ADMIN")
                        {
                            string sqlstr = "select a.RightCode from Sys_UserRight a left join sys_menu b on a.MenuId=b.MenuID " +
                                            "where a.UserType='" + user.Entity.UserType + "' and menupath='pm/Op/ContractRefund_PT.aspx'";
                            DataTable dt = obj.PopulateDataSet(sqlstr).Tables[0];
                            if (dt.Rows.Count > 0)
                            {
                                string rightCode = dt.Rows[0]["RightCode"].ToString();
                                if (rightCode.IndexOf("view") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"view()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe627;</i> 查看</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("view") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"viewfee()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe627;</i> 查看费用明细</a>&nbsp;&nbsp;&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("applyrefund") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"applyrefund()\" class=\"btn btn-warning radius\"><i class=\"Hui-iconfont\">&#xe6e0;</i> 预约退租</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("cancelrefund") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"cancelrefund()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe66b;</i> 取消预约退租</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("refund") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"refund()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe631;</i> 确认退租</a>&nbsp;&nbsp;";
                                }
                            }
                        }
                        else
                        {
                            Buttons += "<a href=\"javascript:;\" onclick=\"view()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe627;</i> 查看</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"viewfee()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe627;</i> 查看费用明细</a>&nbsp;&nbsp;&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"applyrefund()\" class=\"btn btn-warning radius\"><i class=\"Hui-iconfont\">&#xe6e0;</i> 预约退租</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"cancelrefund()\" class=\"btn btn-secondary radius\"><i class=\"Hui-iconfont\">&#xe66b;</i> 取消预约退租</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"refund()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe631;</i> 确认退租</a>&nbsp;&nbsp;";
                        }

                        list = createList(string.Empty, string.Empty, "04", string.Empty, string.Empty, string.Empty,
                                          string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 1);

                        date = GetDate().ToString("yyyy-MM-dd");

                        ContractTypeStr   = "<select class=\"input-text required\" id=\"ContractType\">";
                        ContractTypeStr  += "<option value=\"\"></option>";
                        ContractTypeStrS  = "<select class=\"input-text size-MINI\" id=\"ContractTypeS\" style=\"width:120px;\" >";
                        ContractTypeStrS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessContractType bc = new project.Business.Base.BusinessContractType();
                        foreach (Entity.Base.EntityContractType it in bc.GetListQuery(string.Empty, string.Empty))
                        {
                            ContractTypeStr  += "<option value='" + it.ContractTypeNo + "'>" + it.ContractTypeName + "</option>";
                            ContractTypeStrS += "<option value='" + it.ContractTypeNo + "'>" + it.ContractTypeName + "</option>";
                        }
                        ContractTypeStr  += "</select>";
                        ContractTypeStrS += "</select>";

                        ContractSPNoStr   = "<select class=\"input-text required\" id=\"ContractSPNo\">";
                        ContractSPNoStr  += "<option value=\"\"></option>";
                        ContractSPNoStrS  = "<select class=\"input-text size-MINI\" id=\"ContractSPNoS\" style=\"width:120px;\" >";
                        ContractSPNoStrS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessServiceProvider bc1 = new project.Business.Base.BusinessServiceProvider();
                        foreach (Entity.Base.EntityServiceProvider it in bc1.GetListQuery(string.Empty, string.Empty, true))
                        {
                            ContractSPNoStr  += "<option value='" + it.SPNo + "'>" + it.SPShortName + "</option>";
                            ContractSPNoStrS += "<option value='" + it.SPNo + "'>" + it.SPShortName + "</option>";
                        }
                        ContractSPNoStr  += "</select>";
                        ContractSPNoStrS += "</select>";


                        //管理费 空调费 水费 电费 超额电费
                        Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
                        setting.load("PropertyFee");
                        Business.Base.BusinessSetting setting1 = new Business.Base.BusinessSetting();
                        setting1.load("AirConditionFee");
                        Business.Base.BusinessSetting setting2 = new Business.Base.BusinessSetting();
                        setting2.load("WaterFee");
                        Business.Base.BusinessSetting setting3 = new Business.Base.BusinessSetting();
                        setting3.load("ElectricFee");

                        SRVNo4Str  = "<select class=\"input-text size-MINI\" id=\"SRVNo4\">";
                        SRVNo4Str += "<option value='" + setting.Entity.SRVNo + "'>" + setting.Entity.SRVName + "</option>";
                        SRVNo4Str += "<option value='" + setting1.Entity.SRVNo + "'>" + setting1.Entity.SRVName + "</option>";
                        SRVNo4Str += "<option value='" + setting2.Entity.SRVNo + "'>" + setting2.Entity.SRVName + "</option>";
                        SRVNo4Str += "<option value='" + setting3.Entity.SRVNo + "'>" + setting3.Entity.SRVName + "</option>";
                        SRVNo4Str += "</select>";
                    }
                }
                else
                {
                    Response.Write(errorpage);
                    return;
                }
            }
            catch
            {
                Response.Write(errorpage);
                return;
            }
        }