public ActionResult SubmitSupplierAckDate(MPurchase mPurchase) { bool flag = mPurchase.Save(); X.Msg.Alert("页面信息", flag ? "保存成功" : "保存失败!", flag?"parent.App.win.close()":"").Show(); return(this.Direct()); }
public void MyDefault() { if (!base.IsLogin) { Redirect("/index.html"); } SystemService sysService = Context.GetService <SystemService>(); DocService ds = Context.GetService <DocService>(); OrderService os = Context.GetService <OrderService>(); PropertyBag["firstCatalog"] = sysService.SCatalogBll.GetTopNode(); //大家在阅读什么 IList <DDocInfo> hotList = ds.DDocInfoBll.GetHotList(0, 12); PropertyBag["hotList"] = hotList; //最新文档 PropertyBag["newList"] = ds.DDocInfoBll.GetNewList(0, 10); //阅读top 10 //同hotList //新闻公告(3条系统公告) Service.Bll.User.M_MessageBLL msgBll = new TMM.Service.Bll.User.M_MessageBLL(); IList <M_Message> mlist = msgBll.GetSysMessageList(0, 3); mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr()); PropertyBag["messages"] = mlist; UserService us = Context.GetService <UserService>(); U_UserInfo u = base.GetUser(); //账户余额 PropertyBag["accountBalance"] = us.MAccountBll.GetByUserId(u.UserId).Amount; //最近账单 PropertyBag["billList"] = os.MAccountLogBll.GetList(u.UserId, 0, 3); //可能喜欢的文档 //获取最近一条购买记录 IList <MPurchase> purchaseList = us.MPurchaseBll.GetList(u.UserId, 0, 1); if (purchaseList == null || purchaseList.Count == 0) { PropertyBag["maybeLikeList"] = ds.DDocInfoBll.GetRecommendList(0, 12); } else { MPurchase mp = purchaseList[0]; Core.Search.Index si = new TMM.Core.Search.Index(); si.TableName = "vwDocInfo"; ArrayList maybeLike = si.SearchMaybeLike(mp.Title, 0, 12, mp.DocId); if (maybeLike.Count < 12) { maybeLike.AddRange(ds.DDocInfoBll.GetRecommendList(0, 12 - maybeLike.Count).ToArray()); } PropertyBag["maybeLikeList"] = maybeLike; } RenderView("LogonDefault"); }
/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(MPurchase obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "MPurchase.Insert"; return(SqlMapper.Instance().QueryForObject <int>(stmtId, obj)); }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(MPurchase obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "MPurchase.Update"; int result = SqlMapper.Instance().QueryForObject <int>(stmtId, obj); return(result > 0 ? true : false); }
public ActionResult MPurchaseAckDate(string mpNo) { var mPurchase = new MPurchase(); if (!mPurchase.Refresh(mpNo)) { return(this.Direct()); } this.GetCmp <TextField>("SupplierName").SetValue(mPurchase.SupplierName); this.GetCmp <DateField>("SupplierAckDate").SetValue(mPurchase.SupplierAckDate); return(this.Direct()); }
/// <summary> /// 支付成功的后续事件 /// </summary> public void ExecAfterPaid() { OrderService os = new OrderService(); os.Initialize(); U_UserInfo u = os.UserInfoBll.Get(this.UserId); TOrder o = os.TOrderBll.GetOrderAndDetail(this.OrderId); //检测订单状态 CheckOrder(o, new OrderStatus[] { OrderStatus.NewOrder }, u); //更新订单状态 os.TOrderBll.UpdateState2Paid(o.OrderId, this.Status, this.PayWay, this.PayDetail); //加入到我的购买 DDocInfo buyDoc = os.DDocInfoBll.Get(o.OrderDetails[0].DocId); if (buyDoc != null) { MPurchase mp = new MPurchase() { DocId = buyDoc.DocId, Price = buyDoc.Price, PurchaseTime = DateTime.Now, UserId = this.UserId, Title = buyDoc.Title, Saler = buyDoc.UserId, DocType = buyDoc.DocType }; os.MPurchaseBll.Insert(mp); //给上传人返利 AddAmountForUploader(o.OrderId, buyDoc.UserId, o.Total, os, buyDoc.DocId, buyDoc.Title, this.UserId, this.PayWay); } if (!string.IsNullOrEmpty(this.GotoUrl)) { HttpContext.Current.Response.Redirect(GotoUrl); } }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(MPurchase obj) { return(dal.Update(obj)); }
/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(MPurchase obj) { return(dal.Insert(obj)); }