public JsonResult AddAccount(string ordernum, string orderprice) { IStatisticsMoneyService imcs = ServiceHelper.Create <IStatisticsMoneyService>(); decimal moneynow = imcs.GetMoneyByUidType(base.CurrentSellerManager.Id, 2); IManagersAccountService IMAS = ServiceHelper.Create <IManagersAccountService>(); decimal price; if (decimal.TryParse(orderprice, out price)) { price = decimal.Parse(orderprice); } ManagersAccount MA = new ManagersAccount() { Zhuanzhang = 0, ZhuanzhangName = "", Tiqu = price, Tiqufeiyong = 0, Tiquhuobi = "1", Huilv = "", Tuikuan = 0, OrderNum = ordernum, Balance = moneynow, BalanceAvailable = moneynow, Datatime = DateTime.Now, ManagerId = base.CurrentSellerManager.Id, Daikuan = 0 }; IMAS.AddManagersAccountInfo(MA); return(Json(new { Successful = true })); }
/// <summary> /// 根据用户编号查询详情 /// </summary> /// <param name="managerId"></param> /// <returns></returns> public ManagersAccount GetManagersAccountByManagerId(long managerId) { ManagersAccount maccount = ( from p in context.ManagersAccount where p.ManagerId.Equals(managerId) select p).FirstOrDefault(); return(maccount); }
/// <summary> /// 添加一条记录 /// </summary> /// <param name="maccount"></param> public void AddManagersAccountInfo(ManagersAccount maccount) { if (maccount == null) { return; } context.ManagersAccount.Add(maccount); context.SaveChanges(); }