Beispiel #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 };


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