public bool EditAccountRegInfoSet(AccountRegInfoSet info) { using (e = new LotteryAPPEntities()) { var s = e.AccountRegInfoSet.FirstOrDefault(n => n.Id == info.Id); if (s == null) { return(false); } var acc = e.Accounts.FirstOrDefault(n => n.Id == s.AccountId); if (acc == null) { return(false); } if (info.AgentPercent11X5 > acc.AgentPercent11X5) { return(false); } if (info.AgentPercentDPC > acc.AgentPercentDPC) { return(false); } if (info.AgentPercentSSC > acc.AgentPercentSSC) { return(false); } s.AgentPercent11X5 = info.AgentPercent11X5; s.AgentPercentDPC = info.AgentPercentDPC; s.AgentPercentSSC = info.AgentPercentSSC; return(e.SaveChanges() == 1); } }
/// <summary> /// 新增注册链接Id /// </summary> /// <param name="info"></param> /// <returns></returns> public bool AddAccountRegInfoSet(AccountRegInfoSet info) { using (e = new LotteryAPPEntities()) { info.No = e.AccountRegInfoSet.Count(n => n.AccountId == info.AccountId) + 1; if (info.No > 3) { return(false); } e.AccountRegInfoSet.Add(info); return(e.SaveChanges() == 1); } }