public bool AddAccessUser(accessUser au) { try { db.accessUsers.InsertOnSubmit(au); db.SubmitChanges(); return true; } catch (Exception error) { return false; } }
//EDIT accessUser Table public int EditAccessUser(accessUser au) { try { var v = from i in db.accessUsers where i.accessCode == au.accessCode select i; accessUser newaccess = v.FirstOrDefault(); if(newaccess != null) { newaccess = au; db.SubmitChanges(); return 1; } return 0;//not found } catch (Exception error) { return -1; } }
partial void DeleteaccessUser(accessUser instance);
private void detach_accessUsers(accessUser entity) { this.SendPropertyChanging(); entity.vahedInfo = null; }
partial void UpdateaccessUser(accessUser instance);
partial void InsertaccessUser(accessUser instance);
private void attach_accessUsers(accessUser entity) { this.SendPropertyChanging(); entity.userinfo = this; }