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()); }
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()); }