public IActionResult ShowProfile(PaymentTransferModel input) { try { string errorMessage = string.Empty; var listParam = new List <KeyValuePair <string, string> >(); listParam.Add(new KeyValuePair <string, string>("mobileNumber", input.MobileNumber)); var response = new CallService().GetResponse <ShowProfile>("getCustomerDetailsByMobileNo", listParam, ref errorMessage); if (string.IsNullOrEmpty(errorMessage)) { response.amount = input.Amount; var sessionUtility = new SessionUtility(); sessionUtility.SetSession("PayeeMobileNo", Convert.ToString(response.mobileNumber)); sessionUtility.SetSession("PayeeAmount", Convert.ToString(input.Amount)); sessionUtility.SetSession("PayeeCustomerID", Convert.ToString(response.customerId)); sessionUtility.SetSession("PayeeName", response.firstName + " " + response.lastName); return(PartialView("ShowProfile", response)); } else { return(Json(new { success = false, errorMessage })); } } catch (Exception ex) { return(Json(new { success = false, errorMessage = ex.Message })); } }
public PaymentTransferModel GetTransfers() { var result = new PaymentTransferModel(); try { using (var ctx = DatabaseContext.Instance.Make()) { var ps = (from x in ctx.PAYMENT_SYSTEM_TRANSFER where x.Transfer == null select new { transfer = x, paySys = x.USER_PAYMENT_SYSTEM != null ? (PaymentSystem)x.USER_PAYMENT_SYSTEM.SystemPayment : PaymentSystem.Unknown, wallet = x.USER_PAYMENT_SYSTEM != null ? ctx.WALLET.FirstOrDefault(w => w.User == x.USER_PAYMENT_SYSTEM.UserId) : null }).ToList(); foreach (var p in ps) { var decorP = LinqToEntity.DecoratePaymentSystemTransfer(p.transfer); decorP.PaymentSys = p.paySys; if (p.wallet != null) { decorP.Wallet = LinqToEntity.DecorateWallet(p.wallet); } result.UndefinedPaymentTransfer.Add(decorP); } } } catch (Exception ex) { Logger.Error("GetUnknownTransfers()", ex); return(null); } return(result); }