public void Add(UserFull p_userFull) { var Temp = MapperUserFull.MapUserFullToUSREntity(p_userFull); using (var db = new MES_DATABASE()) { db.USR_UserList.Add(Temp); db.SaveChanges(); } }
public void Edit(UserFull p_userFull) { var Temp = MapperUserFull.MapUserFullToUSREntity(p_userFull); using (var db = new MES_DATABASE()) { db.USR_UserList.Attach(Temp); db.Entry(Temp).State = EntityState.Modified; db.SaveChanges(); } }
public bool GetInformation(int p_Id) { ProfileFull = new UserFull(); bool isFound = false; using (var db = new MES_DATABASE()) { var result = db.USR_UserList.FirstOrDefault(x => x.ID_USR == p_Id); ProfileFull = MapperUserFull.MapUSREntityToUserFull(result); isFound = true; } return(isFound); }