public string ConfirmOfflineOrder(decimal confirmMoney, string confirmRemark, int oid) { ManageUserModel uM = (ManageUserModel)System.Web.HttpContext.Current.Session["logUser"]; if (T_OrderInfoBLL.SetConfirmInfo(oid, confirmMoney, confirmRemark, Convert.ToInt32(uM.UserID), HttpContext.Request.UserHostAddress, DateTime.Now)) { //远程调用处理 var orderInfo = T_OrderInfoBLL.GetModel(oid); int iResult = T_OrderInfoBLL.RemoteConfirm(orderInfo.accId, orderInfo.orderNo, orderInfo.RealPayMoney.ToString()); if (iResult == 1) { return("1"); } else { return("2"); } } else { return("2"); } }
/// <summary> /// 补充话费并记录日志 /// </summary> /// <param name="accid"></param> /// <param name="oid"></param> /// <param name="uid"></param> /// <returns></returns> public static string RechargeProc(int accid, int oid, int uid) { //获取订单相关信息 T_OrderInfo mobileModel = T_OrderInfoBLL.GetModel(oid); string newOrdNum = mobileModel.orderNo.Substring(0, mobileModel.orderNo.Length - 2); Random rd = new Random(); var randNum = newOrdNum + rd.Next(1, 100); while (randNum == mobileModel.orderNo) { randNum = newOrdNum + rd.Next(1, 100); } string cardNum = ""; if (mobileModel.busPrice / 10 >= 9) { cardNum = "100"; } else if (mobileModel.busPrice / 10 >= 4) { cardNum = "50"; } else if (mobileModel.busPrice / 10 >= 2) { cardNum = "30"; } //去掉手机号中的空格 string phoneNum = mobileModel.remark.Replace(" ", ""); //调用话费补充接口 var result = MobileRecharge.MobileCharge(phoneNum, cardNum, randNum); //var result = MobileRecharge.CheckPhoneNum(mobileModel.remark, cardNum); //string errInfo = ""; if (result.error_code == 0) { //记录话费补充日志 if (T_OrderInfoBLL.RechargeLog(accid, uid, oid, (int)mobileModel.busPrice, 0, result.reason, randNum)) { return("1"); } else { Logger.Info("补充提交成功,记录日志出错!"); return("补充提交成功,记录日志出错!"); } } else { if (T_OrderInfoBLL.RechargeLog(accid, uid, oid, (int)mobileModel.busPrice, 1, result.reason, randNum)) { return("补充提交失败【" + result.reason + "】!"); } else { Logger.Info("补充提交失败,记录日志出错!"); return("补充提交失败【" + result.reason + "】,记录日志出错!"); } //return "补充接口返回错误码!" + result.error_code; } }