/// <summary> /// 保存融资信息 /// </summary> /// yaoy 16.08.29 /// <param name="data"></param> /// <returns></returns> public bool SaveFinanceData(string data) { var result = true; var _instance = new Instance(); var _finance = new Finance.Finance(); JObject jo = (JObject)JsonConvert.DeserializeObject(data); StringReader sr = new StringReader(jo["D1"].ToString()); FinanceNodeGroupInfo financeNodeGroup = (FinanceNodeGroupInfo)_serializer.Deserialize(new JsonTextReader(sr), typeof(FinanceNodeGroupInfo)); using (TransactionScope scope = new TransactionScope()) { if (financeNodeGroup.FinanceInfo.FinanceId == null) { result &= _finance.Add(financeNodeGroup); _instance.SetData(financeNodeGroup.FinanceInfo.InstanceId, new { FinanceId = financeNodeGroup.FinanceInfo.FinanceId }); } else { result &= _finance.Modify(financeNodeGroup); } if (result) { scope.Complete(); } } return(result); }
/// <summary> /// 保存初审信息 /// </summary> /// yaoy 16.08.29 /// <param name="data"></param> /// <returns></returns> public bool SaveCreditExamineReportData(string data) { var result = true; var _review = new Finance.Review(); var _finance = new Finance.Finance(); var _creditExamine = new Finance.CreditExamineReport(); JObject jo = (JObject)JsonConvert.DeserializeObject(data); StringReader sr1 = new StringReader(jo["D3"]["CreditExamineReportInfo"].ToString()); CreditExamineReportInfo creditExamine = (CreditExamineReportInfo)_serializer.Deserialize(new JsonTextReader(sr1), typeof(CreditExamineReportInfo)); StringReader sr2 = new StringReader(jo["D4"]["ReviewInfo"].ToString()); ReviewInfo reviewInfo = (ReviewInfo)_serializer.Deserialize(new JsonTextReader(sr2), typeof(ReviewInfo)); using (TransactionScope scope = new TransactionScope()) { if (_creditExamine.Get(creditExamine.FinanceId) == null) { result &= _creditExamine.Add(creditExamine); } else { result &= _creditExamine.Modify(creditExamine); } reviewInfo.ReviewType = (byte)ReviewType.初审; if (_review.Get(reviewInfo.FinanceId) == null) { // 初审添加 result &= _review.Add(reviewInfo); } else { // 初审修改 result &= _review.Modify(reviewInfo); } if (result) { scope.Complete(); } } return(result); }
public int?FindUser(object value) { var data = (FlowData)value; var transfer = new Action().Get(data.ActionId).Transfer; var roldId = new Node().Get(transfer.Value).RoleId; var financeId = new Instance().GetData(data.InstanceId.Value, new { FinanceId = 0 }).FinanceId; var creditId = new Finance.Finance().Get(financeId).CreateOf; var processUser = new Credit.Credit().Get(creditId).ProcessUser; int?userId; switch (roldId) { case 3: userId = processUser.User1; break; case 4: userId = processUser.User2; break; case 5: userId = processUser.User3; break; case 10: userId = processUser.User4; break; case 6: userId = processUser.User5; break; default: userId = null; break; } return(userId); }
/// <summary> /// 保存运营节点录入信息 /// </summary> /// yaoy 16.08.29 /// <param name="data"></param> /// <returns></returns> public bool SaveOperationData(string data) { bool result = true; var _operate = new Finance.Operating(); var _finance = new Finance.Finance(); JObject jo = (JObject)JsonConvert.DeserializeObject(data); StringReader sr = new StringReader(jo["D8"].ToString()); OperatingInfo operatingInfo = (OperatingInfo)_serializer.Deserialize(new JsonTextReader(sr), typeof(OperatingInfo)); using (TransactionScope scope = new TransactionScope()) { result &= _finance.ModifyOptionInfo(operatingInfo); if (result) { scope.Complete(); } } return(result); }