/// <summary> /// 购买保险 /// </summary> /// <param name="buyCount"></param> /// <param name="singlePrice"></param> /// <param name="totalPrice"></param> /// <param name="leaveCount"></param> /// <param name="pwd"></param> /// <returns></returns> public JsonResult BuyInsurance(int buyCount, decimal singlePrice, decimal totalPrice, int leaveCount, string pwd) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IInsuranceService>(service => { var m = service.GetCtrlInsurance(); if (m.IsEnabled) { service.BuyInsuranceByCashByCarrier(buyCount, pwd); msg.Success = 1; msg.Message = "支付成功"; } else { msg.Success = 0; msg.Message = "保险功能未开启"; } }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
public ActionResult BlackSendData() { List <CarrierDataObject> CarrierList = null; var msg = new RspMessageModel(); CommunicateManager.Invoke <IConsoBusinessmanService>(service => { CarrierList = service.GetAllCarrier(); msg.Success = 1; msg.Message = "成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); Dictionary <string, string> dicList = new Dictionary <string, string>(); foreach (CarrierDataObject item in CarrierList) { List <string> pids = new List <string>(); List <string> Office = new List <string>(); item.Pids.ForEach(p => { pids.Add(p.IP + ":" + p.Port); Office.Add(p.Office); }); dicList.Add(item.Code + "-" + item.Name, string.Join("^", pids.ToArray()) + "#" + string.Join("|", Office.ToArray())); } return(View(dicList)); }
public JsonResult Edit(BankCardModel backCardModel) { var dto = new BankCardDto(); dto.Name = backCardModel.Name; dto.BankBranch = backCardModel.BankBranch.Trim(); dto.Owner = backCardModel.Owner; dto.CardNo = backCardModel.CardNo.Trim(); dto.Province = backCardModel.Province; dto.City = backCardModel.City; dto.BankId = backCardModel.BankId; dto.IsDefault = backCardModel.IsDefault; var msg = new RspMessageModel(); CommunicateManager.Invoke <IAccountService>(service => { service.ModifyBank(dto); msg.Success = 1; msg.Message = "修改银行卡成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 设置保险配置 /// </summary> /// <param name="isOpen"></param> /// <param name="leaveCount"></param> /// <param name="singlePrice"></param> /// <returns></returns> public JsonResult SetInsuranceConfig(bool isOpen, int leaveCount, string singlePrice) { var msg = new RspMessageModel(); try { CommunicateManager.Invoke <IInsuranceService>(service => { var req = new InsuranceConfigData(); decimal price; if (!decimal.TryParse(singlePrice, out price)) { throw new Exception("单价过大或者过小,或者不是有效的数值。"); } req.IsOpen = isOpen; req.SinglePrice = price; req.LeaveCount = leaveCount; service.SaveInsuranceConfig(req); msg.Success = 1; msg.Message = "保险设置成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); }catch {} return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 积分兑换 /// </summary> /// <param name="score"></param> /// <returns></returns> public JsonResult ExchangeScore(int score) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IAccountService>(service => { service.ExchangeSource(score); msg.Success = 1; msg.Message = "兑换积分操作成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 结算操作 /// </summary> /// <param name="money"></param> /// <param name="bankId"></param> /// <param name="password"></param> /// <param name="isNextDayToAccount"></param> /// <returns></returns> public JsonResult CashOut(decimal money, string bankId, string password, string isNextDayToAccount) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IFundService>(service => { service.CashOut(money, bankId, password, isNextDayToAccount); msg.Success = 1; msg.Message = "申请结算成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 转账操作 /// </summary> /// <param name="code"></param> /// <param name="money"></param> /// <param name="password"></param> /// <param name="notes"></param> /// <returns></returns> public JsonResult TransferMoney(string code, string money, string password, string notes) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IFundService>(service => { service.InnerTransfer(code, money, password, notes); msg.Success = 1; msg.Message = "转账成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 中止理财产品 /// </summary> /// <param name="tradeID"></param> /// <param name="pwd"></param> /// <returns></returns> public JsonResult AbortFinancial(string tradeID, string pwd) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IFinancialService>(p => { p.AbortFinancial(tradeID, pwd); msg.Success = 1; msg.Message = "中止理财产品"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 购买理财产品 /// </summary> /// <param name="model"></param> /// <returns></returns> public JsonResult BuyProduct(FinancialProductModel model) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IFinancialService>(p => { p.BuyFinancialProductByCashAccount(model.ProductId, model.Money, model.Password); msg.Success = 1; msg.Message = "购买理财产品成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取短信 /// </summary> /// <returns></returns> public JsonResult GetSMSValidate() { var msg = new RspMessageModel(); CommunicateManager.Invoke <IAccountService>(p => { p.GetValidateCode(); msg.Success = 1; msg.Message = "获取短信成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult SetDefaultBankCard(string id) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IAccountService>(service => { service.SetDefaultBank(id); msg.Success = 1; msg.Message = "设为默认银行卡成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取行程单详情 /// </summary> /// <param name="TripNumber"></param> /// <returns></returns> public JsonResult GetTripNumberDetail(string TripNumber) { TravelPaperDto travelPaperDto = null; var msg = new RspMessageModel(); CommunicateManager.Invoke <ITravelPaperService>(service => { travelPaperDto = service.QueryTripNumberDetail(TripNumber); msg.Success = 1; msg.Message = "成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(new { model = travelPaperDto, msg = msg }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetInsuranceManual(string insuranceOrderId, string recordId) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IInsuranceService>(service => { //todo 调用赠送保险服务接口 service.GetInsuranceNoManual(insuranceOrderId, recordId); msg.Success = 1; msg.Message = "手动出单成功。"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg)); //return Json(true); }
/// <summary> /// 赠送保险 /// </summary> /// <param name="businessCode"></param> /// <param name="giveCount"></param> /// <param name="remark"></param> /// <returns></returns> public JsonResult GiveInsurance(string businessCode, int giveCount, string remark) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IInsuranceService>(service => { //todo 调用赠送保险服务接口 service.OfferInsuranceToBuyer(new RequestOfferInsuranceToBuyer { BuyerCode = businessCode, OfferCount = giveCount, Remark = remark }); msg.Success = 1; msg.Message = "赠送保险成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }
// // GET: /BlackQuery/ /// <summary> /// 发送指令数据 暂时 比较简单 用着 /// </summary> /// <param name="TripNumber"></param> /// <returns></returns> public JsonResult GetBlackData(string Cmd, string IP, string Port, string Office) { var msg = new RspMessageModel(); PidParam pidParam = new PidParam(); pidParam.ServerIP = IP; pidParam.ServerPort = Port; pidParam.Office = Office; pidParam.Cmd = Cmd; CommunicateManager.Invoke <IPidService>(service => { msg.Message = service.SendPid(pidParam); msg.Success = 1; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(new { msg }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 检测商户号是否合法 /// </summary> /// <param name="businessCode"></param> /// <returns></returns> public JsonResult CheckBusinessCode(string businessCode) { var msg = new RspMessageModel(); CommunicateManager.Invoke <IConsoBusinessmanService>(service => { string name = string.Empty; name = service.GetBusinessmanName(businessCode); //var buyer = service.GetBusinessmanBuyerByCode(businessCode, null, null, null, 1).Rows.FirstOrDefault(); if (!string.IsNullOrEmpty(name)) { msg.Success = 1; msg.Message = name; } else { msg.Success = 0; msg.Message = "分销商不存在。"; } }); return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdatePayPwd(string newPwd, string onceNewPwd, string smsCode) { var msg = new RspMessageModel(); if (!newPwd.Equals(onceNewPwd)) { msg.Success = 0; msg.Message = "两次输入密码不一致"; return(Json(msg, JsonRequestBehavior.AllowGet)); } CommunicateManager.Invoke <IAccountService>(p => { p.SetPayPassword(newPwd, smsCode); msg.Success = 1; msg.Message = "设置支付密码成功"; }, (p => { msg.Success = 0; msg.Message = p.Message; })); return(Json(msg, JsonRequestBehavior.AllowGet)); }