示例#1
0
        private string cancelrefundaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.OffLeaseStatus != "2" || bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    bc.Entity.OffLeaseStatus       = "1";
                    bc.Entity.OffLeaseApplyDate    = DateTime.MinValue.AddYears(1900);
                    bc.Entity.OffLeaseScheduleDate = DateTime.MinValue.AddYears(1900);
                    bc.Entity.OffLeaseReason       = "";
                    bc.refund();
                }
            }
            catch { }

            collection.Add(new JsonStringValue("type", "cancelrefund"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                     jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                     jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                     jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));
            return(collection.ToString());
        }
示例#2
0
        private string refundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.ContractStartDate >= Convert.ToDateTime(jp.getValue("RefundDate")))
                {
                    flag = "2";
                }
                else if (bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    string InfoBar = refund(jp.getValue("id"), jp.getValue("RefundDate"), user.Entity.UserName);
                    if (InfoBar != "")
                    {
                        flag = "4";
                        collection.Add(new JsonStringValue("InfoBar", InfoBar));
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));

                        #region  步到管家
                        try
                        {
                            string status = string.Empty;
                            string date   = string.Empty;
                            bc.CheckCustStatus(out status, out date);
                            ButlerSrv.AppService appService = new ButlerSrv.AppService {
                                Timeout = 5000
                            };
                            appService.UpdateCustomer(bc.Entity.ContractCustNo, status, date);
                        }
                        catch (Exception ex)
                        {
                            collection.Add(new JsonStringValue("syncButlerException", ex.ToString()));
                        }
                        #endregion
                    }
                }
            }
            catch { flag = "99"; }

            collection.Add(new JsonStringValue("type", "refundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
示例#3
0
        private string refundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                DateTime leaveDate = Convert.ToDateTime(jp.getValue("RefundDate"));
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.ContractStartDate >= leaveDate)
                {
                    flag = "2";
                }
                else if (bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    string msg = bc.ContractExit(bc.Entity.RowPointer, user.Entity.UserName, jp.getValue("RefundDate"));
                    if (string.IsNullOrEmpty(msg))
                    {
                        //成功
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEn dDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));

                        collection.Add(new JsonStringValue("GJSync", bc.SyncButlerForCustStatus()));                                     //同步到管家
                        collection.Add(new JsonStringValue("ZYSync", bc.SyncResource("rm", 1, "out", user.Entity.UserName, leaveDate))); //同步到资源
                    }
                    else
                    {
                        //失败
                        flag = "4";
                        collection.Add(new JsonStringValue("InfoBar", msg));
                    }
                }
            }
            catch { flag = "99"; }

            collection.Add(new JsonStringValue("type", "refundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
示例#4
0
        private string applyrefundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.OffLeaseStatus != "1")
                {
                    flag = "3";
                }
                else
                {
                    bc.Entity.OffLeaseStatus       = "2";
                    bc.Entity.OffLeaseApplyDate    = GetDate();
                    bc.Entity.OffLeaseScheduleDate = ParseDateForString(jp.getValue("OffLeaseScheduleDate"));
                    bc.Entity.OffLeaseReason       = jp.getValue("OffLeaseReason");
                    int r = bc.refund();
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));
                    }
                }
            }
            catch { }

            collection.Add(new JsonStringValue("type", "applyrefundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
示例#5
0
        private string refundaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));

                if (bc.Entity.OffLeaseStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    collection.Add(new JsonStringValue("ContractNo", bc.Entity.ContractNo));
                    collection.Add(new JsonStringValue("ContractCustNo", bc.Entity.ContractCustNo));
                    collection.Add(new JsonStringValue("ContractCustName", bc.Entity.ContractCustName));
                    collection.Add(new JsonStringValue("ContractNoManual", bc.Entity.ContractNoManual));
                    collection.Add(new JsonStringValue("ContractSignedDate", ParseStringForDate(bc.Entity.ContractSignedDate)));
                    collection.Add(new JsonStringValue("ContractStartDate", ParseStringForDate(bc.Entity.ContractStartDate)));
                    collection.Add(new JsonStringValue("ContractEndDate", ParseStringForDate(bc.Entity.ContractEndDate)));
                    collection.Add(new JsonStringValue("EntryDate", ParseStringForDate(bc.Entity.EntryDate)));
                    collection.Add(new JsonStringValue("FeeStartDate", ParseStringForDate(bc.Entity.FeeStartDate)));
                    collection.Add(new JsonStringValue("RefundDate", jp.getValue("RefundDate")));


                    System.Text.StringBuilder sb = new System.Text.StringBuilder("");
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort mt-5\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th style=\"width:5%\">序号</th>");
                    sb.Append("<th style=\"width:18%\">房间编号</th>");
                    sb.Append("<th style=\"width:17%\">费用项目</th>");
                    sb.Append("<th style=\"width:12%\">开始日期</th>");
                    sb.Append("<th style=\"width:12%\">截止日期</th>");
                    sb.Append("<th style=\"width:12%\">数量</th>");
                    sb.Append("<th style=\"width:12%\">单价</th>");
                    sb.Append("<th style=\"width:12%\">金额</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");
                    int r = 1;
                    sb.Append("<tbody>");
                    foreach (DataRow dr in GetRefundFeeList(jp.getValue("id"), jp.getValue("RefundDate")).Rows)
                    {
                        sb.Append("<tr class=\"text-c\" id=\"" + dr["RowPointer"].ToString() + "\">");
                        sb.Append("<td align='center'>" + r.ToString() + "</td>");
                        sb.Append("<td>" + dr["RMID"].ToString() + "</td>");
                        sb.Append("<td>" + dr["SRVName"].ToString() + "</td>");
                        sb.Append("<td>" + ParseStringForDate(ParseDateForString(dr["FeeStartDate"].ToString())) + "</td>");
                        sb.Append("<td>" + ParseStringForDate(ParseDateForString(dr["FeeEndDate"].ToString())) + "</td>");
                        sb.Append("<td>" + ParseDecimalForString(dr["FeeQty"].ToString()).ToString("0.####") + "</td>");
                        sb.Append("<td>" + ParseDecimalForString(dr["FeeUnitPrice"].ToString()).ToString("0.####") + "</td>");
                        sb.Append("<td>" + ParseDecimalForString(dr["FeeAmount"].ToString()).ToString("0.####") + "</td>");
                        sb.Append("</tr>");
                        r++;
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");

                    collection.Add(new JsonStringValue("liststr", sb.ToString()));
                }
            }
            catch { }

            collection.Add(new JsonStringValue("type", "refund"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
        private string refundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                DateTime leaveDate = Convert.ToDateTime(jp.getValue("RefundDate"));
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.ContractStartDate >= leaveDate)
                {
                    flag = "2";
                }
                else if (bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    string infoMsg = bc.ConfirmLeaveWithNoFee(leaveDate);
                    if (infoMsg != "")
                    {
                        collection.Add(new JsonStringValue("InfoBar", infoMsg));
                        flag = "4";
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));


                        #region  步到管家
                        try
                        {
                            string status = string.Empty;
                            string date   = string.Empty;
                            bc.CheckCustStatus(out status, out date);
                            ButlerSrv.AppService appService = new ButlerSrv.AppService {
                                Timeout = 5000
                            };
                            appService.UpdateCustomer(bc.Entity.ContractCustNo, status, date);
                        }
                        catch (Exception ex)
                        {
                            collection.Add(new JsonStringValue("syncButlerException", ex.ToString()));
                        }
                        #endregion

                        #region  步到资源系统
                        string syncResult = string.Empty;
                        try
                        {
                            ResourceService.ResourceService srv = new ResourceService.ResourceService
                            {
                                Timeout = 5000,
                                Url     = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString()
                            };
                            string Items = "";
                            Business.Base.BusinessCustomer cust = new Business.Base.BusinessCustomer();
                            cust.load(bc.Entity.ContractCustNo);
                            var dt = obj.PopulateDataSet("SELECT WPNo FROM Op_ContractWPRentalDetail WHERE RefRP='" + bc.Entity.RowPointer + "' GROUP BY WPNo").Tables[0];
                            foreach (DataRow dr in dt.Rows)
                            {
                                SycnResourceStatus rs = new SycnResourceStatus();
                                rs.SysID         = 1; //1.订单
                                rs.ResourceID    = dr["WPNo"].ToString();
                                rs.BusinessID    = bc.Entity.RowPointer;
                                rs.BusinessNo    = bc.Entity.ContractNo;
                                rs.BusinessType  = 1;//1租赁,2物业
                                rs.RentBeginTime = bc.Entity.FeeStartDate;
                                rs.RentEndTime   = leaveDate;
                                rs.Status        = 2;
                                rs.RentType      = 1;
                                rs.UpdateTime    = GetDate();
                                rs.UpdateUser    = user.Entity.UserName;
                                Items           += (Items == "" ? "" : ",") + JsonConvert.SerializeObject(rs);
                            }
                            syncResult = srv.LeaseOut("[" + Items + "]");
                        }
                        catch (Exception ex)
                        {
                            syncResult = ex.ToString();
                        }
                        collection.Add(new JsonStringValue("sync", syncResult));
                        #endregion
                    }
                }
            }
            catch { }

            collection.Add(new JsonStringValue("type", "refundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }