Пример #1
0
 public UserInfo Update(UserInfo ent)
 {
     var oe = db.UserInfos.Find(ent.PkId);
     if (oe == null) return null;
     ModelHelper.SetModal(ent, oe);
     db.SaveChanges();
     return oe;
 }
        public PageDataResult<UserInfo> AddUserInfo()

        {
            var ent = new UserInfo() { UserName = "******", Password = "******", PkId = Guid.NewGuid() };
            var result = _bll.Insert(ent);
            return new PageDataResult<UserInfo> { flag = EnumActionFlag.success, Data = result };


        }
Пример #3
0
 public UserInfo Insert(UserInfo ent)
 {
    return _dal.Create(ent);
 }
Пример #4
0
 public void Delete(UserInfo ent)
 {
     var info = db.UserInfos.Find(ent.PkId);
     db.UserInfos.Remove(info);
     db.SaveChanges();
 }
Пример #5
0
 public UserInfo Create(UserInfo ent)
 {
     db.UserInfos.Add(ent);
     db.SaveChanges();
     return ent;
 }