public AlipayResponse Alipay([FromBody] AlipayRequest req) { var rep = new AlipayResponse(); if (string.IsNullOrEmpty(req.PayId)) { rep.Error("PayId不可为空"); return(rep); } var p = DefaultStorage.PaymentGet(req.PayId); if (p == null) { rep.Error("PayId值无效"); return(rep); } if (p.Status) { rep.Error("已支付过"); return(rep); } var op = GetOnlinePay(4); if (op == null) { rep.Error("无效"); return(rep); } rep.Code = 0; rep.Data = op.Pay(p); return(rep); }
public UserAddressDeleteResponse UserAddressDelete([FromBody] UserAddressDeleteRequest req) { var now = DateTime.Now; var rep = new UserAddressDeleteResponse(); if (req.Id < 0) { rep.Error("参数(Id)有误"); return(rep); } if (req.UserId < 0) { rep.Error("参数(UserId)有误"); return(rep); } var statue = DefaultStorage.UserAddressDelete(req.Id, req.UserId); if (!statue) { rep.Error("删除收货地址失败"); return(rep); } return(rep); }
public ActionResult OrderMemo(string id) { var identity = User; var model = DefaultStorage.OrderMemoGet(id, identity.Id, true); return(PartialView(model)); }
public ActionResult Delete(int id) { var result = new Result(); if (id < 0) { result.Message = "参数有误!"; return(Json(result)); } var identity = User; if (!identity) { result.Message = "未登录或登录超时!"; return(Json(result)); } var status = DefaultStorage.UserAddressDelete(id, identity.Id); if (status) { result.Status = true; } else { result.Message = "删除失败,请稍后重试!"; } return(Json(result)); }
private void OnUpload(UploadResult r) { if (r) { var identity = User; var now = DateTime.Now; var ext = Path.GetExtension(r.FileName); var file = new WeedFile(); file.Id = r.Fid; file.Uid = r.Uid; file.Did = r.Did; file.Ext = ext; file.Url = r.FileUrl; file.Size = r.Size; file.Name = r.FileName; file.Badge = string.Empty; file.Extra = string.Empty; file.Status = true; file.CreatedBy = identity.Name; file.CreatedOn = now; file.ModifiedBy = identity.Name; file.ModifiedOn = now; var id = DefaultStorage.WeedFileCreate(file); if (id < 1) { Logger.LogError("保存到数据库失败:" + r.Error); } return; } Logger.LogError("上传失败:" + r.Error); }
public IActionResult FileList(int did) { var identity = User; var model = DefaultStorage.WeedFilePagedList(identity.Id, did); return(PartialView(model)); }
public IActionResult Confirm(string uid, string captcha) { var result = new Status <string>(); var valid = true;// ValidateCaptcha("account-confirm", captcha);//验证验证码是否正确 if (!valid) { result.Code = 1; result.Message = "验证码不正确,请核对后重新输入。"; return(Json(result)); } var id = DefaultStorage.UserIdGet(uid);//验证输入帐号是否存在 if (id < 1) { result.Code = 2; result.Message = "您输入的账号不存在,请核对后重新输入。"; return(Json(result)); } var user = DefaultStorage.UserGet(id); if (user != null && user.Email.IsNullOrEmpty() && user.Mobile.IsNullOrEmpty()) { result.Code = 3; result.Message = "您输入的账号未绑定任何邮箱或手机号,无法重置密码。"; return(Json(result)); } result.Code = 0; SetSession("account-current", id);//设置session return(Json(result)); }
public IActionResult Confirm(int userAddressId = 0) { if (userAddressId < 1) { return(Content("100")); } if (!User) { return(Content("200")); } var userId = User.Id; var userAddress = DefaultStorage.UserAddressGet(userAddressId, User.Id); var model = new CartModel.Confirm(); var cart = GetCart(); var temp = cart.SetAddress(userAddress); if (!temp) { return(Content("500")); } model.CartData = temp.Data; model.Addresses = DefaultStorage.UserAddressList(userId); return(PartialView(model)); }
public IActionResult PlanList(int page = 1, int size = 20, string keyword = null, bool?status = null) { var model = new ActPlanListModel(); model.Plans = DefaultStorage.ActPlanPagedList(page, size, keyword, status); return(View(model)); }
public void UploadObjectAsync_NullBytes_Exception() { var fakeFileName = "textfile.txt"; var storage = new DefaultStorage(_options); Assert.ThrowsAsync <ArgumentNullException>(() => storage.UploadObjectAsync(fakeFileName, null)); }
public void UploadObjectAsync_EmptyFileName_Exception() { var fakeFile = TestHelper.GetFakeFileBytes(); var storage = new DefaultStorage(_options); Assert.ThrowsAsync <ArgumentNullException>(() => storage.UploadObjectAsync("", fakeFile)); }
public ActionResult OrderCancel(string id, string reason) { var result = new Result(); if (!User) { result.Error("未登录或登录超时,请重新登录!"); return(Json(result)); } var status = DefaultStorage.OrderStatusGet(id, User.Id, true); if (status == OrderStatus.Pending || status == OrderStatus.WaitBuyerPay) { result.Status = DefaultStorage.OrderCancel(id, User.Id, true, 3, reason); if (result.Status) { result.Status = true; } else { result.Message = "取消订单失败!"; } } else { result.Message = "该订单当前状态不可取消!"; } return(Json(result)); }
public IntAction(DefaultStorage <int> storage, string bKey, int v, Transcript script) { bins = storage; key = bKey; value = v; this.script = script; }
bool IConnectionStorageService.Contains(string connectionName) { return(IncludeApplicationConnections ? DefaultStorage.Contains(connectionName) || GetConnectionsFromXml().Any(c => string.Equals(c.Name, connectionName)) : GetConnectionsFromXml().Any(c => string.Equals(c.Name, connectionName))); }
public IActionResult SlideDel(string id) { var result = new Result(); result.Status = DefaultStorage.SlideDelete(id); return(Json(result)); }
public IActionResult PaymentPlatformDel(int id) { var result = new Result(); result.Status = DefaultStorage.PaymentPlatformDelete(id); return(Json(result)); }
public IActionResult Order(string id, int platformId, int bankId = 0) { //可处理多次提交支付情况 var identity = User; if (!identity) { //未登录 } //再次检查订单状态 var status = DefaultStorage.OrderStatusGet(id, identity.Id, false); if (status != OrderStatus.WaitBuyerPay) { return(Redirect("http://localhost:39272/order/detail/" + id)); } var order = DefaultStorage.OrderMiniGet(id, identity.Id); if (order.PaymentType.IsOnlinePay() && order.Status == OrderStatus.WaitBuyerPay && order.Paid < order.Total) { var onlinePay = GetOnlinePay(platformId); if (onlinePay != null) { var ipAddress = Request.HttpContext.Connection.RemoteIpAddress.ToString(); var payment = order.ToPayment(platformId, ipAddress);//支付宝 微信需ip if (bankId > 0) { var paymentBanks = DefaultStorage.PaymentBankList(platformId); var paymentBank = paymentBanks.FirstOrDefault(o => o.Id == bankId); if (paymentBank != null) { //如果用户选择了具体的银行则填充Payment相关银行信息 payment.BankId = paymentBank.Id; payment.BankCode = paymentBank.Code; payment.BankName = paymentBank.Bank.Name; } } var created = DefaultStorage.PaymentCreate(payment); if (created) { var url = onlinePay.Pay(payment); if (string.IsNullOrEmpty(url)) { return(Content("创建支付平台信息失败")); } if (platformId == 3) { //RenderQRCode(url); } return(Redirect(url));//跳转到第三方支付平台进行支付 } return(Content("创建支付信息失败")); } return(Content("参数错误(OnlinePay)")); } return(Redirect("http://i.ayatta.com/order/detail/" + order.Id)); }
IEnumerable <DevExpress.DataAccess.Sql.SqlDataConnection> IConnectionStorageService.GetConnections() { if (!File.Exists(FileName)) { try { //Create empty XML file XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement(xmlRootName); doc.AppendChild(root); doc.Save(FileName); //Add a connection to the XML file: SqlDataConnection defaultConnection = GetConnection(); //GetConnectionsFromXml(); // new CustomSqlDataConnection("Default Connection", new MsSqlConnectionParameters("localhost", "NORTHWIND", "sa", "dx", MsSqlAuthorizationType.SqlServer)); SaveConnection(defaultConnection.Name, defaultConnection, true); } catch (Exception ex) { MessageBox.Show(string.Format("Cannot create '{0}' file because of exception:{1}{1}{2}", FileName, Environment.NewLine, ex.Message)); return(null); } } return(IncludeApplicationConnections ? DefaultStorage.GetConnections().Union(GetConnectionsFromXml()) : GetConnectionsFromXml()); }
public void Initialize() { ConfigureFromCanConfigurables(); InitializeCulture(); var initializers = new Action[] { () => Serialization.Initialize(Container), () => Commands.Initialize(Container), () => Events.Initialize(Container), () => Tasks.Initialize(Container), () => Views.Initialize(Container), () => Sagas.Initialize(Container), () => Frontend.Initialize(Container), () => CallContext.Initialize(Container), () => ExecutionContext.Initialize(Container), () => Security.Initialize(Container), () => DefaultStorage.Initialize(Container) }; #if (SILVERLIGHT) initializers.ForEach(initializer => initializer()); #else Parallel.ForEach(initializers, initializator => initializator()); #endif ConfigurationDone(); }
public CartManager(DefaultStorage defaultStorage, IDistributedCache defaultCache, IDistributedCache cartCache, ILogger <CartManager> logger) { this.defaultStorage = defaultStorage; this.defaultCache = defaultCache; this.cartCache = cartCache; this.logger = logger; }
public IActionResult HelpDel(int id) { var result = new Result(); result.Status = DefaultStorage.HelpDelete(id); return(Json(result)); }
IEnumerable <SqlDataConnection> IConnectionStorageService.GetConnections() { if (!File.Exists(FileName)) { try { XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement(xmlRootName); doc.AppendChild(root); doc.Save(FileName); SqlDataConnection defaultConnection = new CustomSqlDataConnection("Default Connection", new MsSqlConnectionParameters("localhost", "Northwind", null, null, MsSqlAuthorizationType.Windows)); SaveConnection(defaultConnection.Name, defaultConnection, true); } catch (Exception ex) { MessageBox.Show(string.Format("Cannot create '{0}' file because of exception:{1}{1}{2}", FileName, Environment.NewLine, ex.Message)); return(null); } } return(IncludeApplicationConnections ? DefaultStorage.GetConnections().Union(GetConnectionsFromXml()) : GetConnectionsFromXml()); }
public IActionResult OAuthProviderList() { var model = new OAuthProviderListModel(); model.OAuthProviders = DefaultStorage.OAuthProviderList(); return(View(model)); }
public IActionResult Index(int id = 0) { var model = new HomeModel.Index(); model.Item = DefaultStorage.ProdItemGet(id, true); return(View(model)); }
public IActionResult PaymentPlatformList(string keyword = null, bool?status = null) { var model = new PaymentPlatformListModel(); model.Keyword = keyword; model.PaymentPlatforms = DefaultStorage.PaymentPlatformList(keyword, status); return(View(model)); }
public IActionResult OrderDetail(string id) { var model = new OrderDetailModel(); model.Order = DefaultStorage.OrderGet(id, User.Id, true, true); return(View(model)); }
public IActionResult Index() { var identity = User; var model = new SecurityIndexModel(); model.User = DefaultStorage.UserGet(identity.Id); return(View(model)); }
public IActionResult OrderList() { var model = new OrderListModel(); model.Orders = DefaultStorage.OrderPagedList(); return(View(model)); }
public IActionResult FuncList(int moduleId) { var data = DefaultStorage.FuncList(moduleId); var model = new Model <IList <RBAC.Func>, int>(data, moduleId); return(PartialView(model)); }
public IActionResult HelpList(int page = 1, int size = 20, string keyword = null, bool?status = null) { var model = new HelpListModel(); model.Keyword = keyword; model.Helps = DefaultStorage.HelpPagedList(page, size, keyword, status); return(View(model)); }
public ItemController(DefaultStorage defaultStorage) : base(defaultStorage) { }
public HomeController(DefaultStorage defaultStorage) : base(defaultStorage) { }
public BaseController(DefaultStorage defaultStorage) { DefaultStorage = defaultStorage; }