public JsonResult SaveOrders(string entity) { JavaScriptSerializer serializer = new JavaScriptSerializer(); UserOrders model = serializer.Deserialize <UserOrders>(entity); model.SPName = ""; string error = ""; var result = false; if (model.AutoID == -1) { var tempu = M_UsersBusiness.GetUserDetailByLoginName(model.UserName); if (tempu != null && !string.IsNullOrEmpty(tempu.UserID)) { result = UserOrdersBusiness.CreateUserOrder( DateTime.Now.ToString("yyyyMMddhhmmss") + CurrentUser.AutoID, model.PayType, model.SPName, model.BankName, model.Sku, model.Content, model.TotalFee, model.OtherCode, Convert.ToInt32(model.TotalFee), model.Type, model.PayFee, tempu.UserID, CurrentUser.UserID, OperateIP); } else { error = "登陆账号不存在,订单登记失败"; } } JsonDictionary.Add("result", result); JsonDictionary.Add("ErrMsg", error); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult PayMoney(int type, string levelid, string payway) { var model = WebSetBusiness.GetMemberLevelByID(levelid); string msg = ""; string ordercode = CurrentUser.AutoID + DateTime.Now.ToString("yyyMMddHHmmssfff"); JsonDictionary.Add("result", UserOrdersBusiness.CreateUserOrder(levelid, payway == "zfbpay" ? 0 : 1, ordercode, CurrentUser.UserID, ref msg)); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult PayOtherMoney(decimal gold, string payway) { var grule = Convert.ToDecimal(CommonBusiness.getSysSetting(EnumSettingKey.GoldScale, "DValue")); var totalFee = grule * gold; string ordercode = CurrentUser.AutoID + DateTime.Now.ToString("yyyMMddHHmmssfff"); var model = WebSetBusiness.GetMemberLevel(1).Where(x => x.IntegFeeMore <= totalFee).OrderByDescending(x => x.Origin).FirstOrDefault(); string content = "购买金币"; if (model != null) { content = model.Golds > 0 ? ("满足优惠活动,赠送金币:" + model.Golds) : ""; gold += model.Golds; } JsonDictionary.Add("result", UserOrdersBusiness.CreateUserOrder(ordercode, payway == "zfbpay" ? 0 : 1, "金币", "", content, totalFee, "", 1, gold, CurrentUser.UserID)); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }