public List <Entity.UserType> GetAll() { string query = "SELECT UserTypeId, UserTypeName FROM UserType"; SqlDataReader reader = DataAccess.GetData(query); Entity.UserType userType = null; List <Entity.UserType> userTypeList = new List <Entity.UserType>(); while (reader.Read()) { userType = new Entity.UserType(reader["UserTypeId"].ToString()); userType.UserTypeName = reader["UserTypeName"].ToString(); userTypeList.Add(userType); } return(userTypeList); }
public int Edit(Entity.UserType userType) { string query = "UPDATE Account SET UserTypeName='" + userType.UserTypeName + "' WHERE UserTypeId=" + userType.UserTypeId; return(DataAccess.ExecuteQuery(query)); }
public int Add(Entity.UserType userType) { string query = string.Format("INSERT INTO UserType(UserTypeId, UserTypeName) VALUES('{0}', '{1}')", userType.UserTypeId, userType.UserTypeName); return(DataAccess.ExecuteQuery(query)); }
public int Edit(Entity.UserType userType) { return(UserTypeService.userTypeDataAccess.Edit(userType)); }
public int Add(Entity.UserType userType) { return(UserTypeService.userTypeDataAccess.Add(userType)); }
public void Update(Entity.UserType UserType) { _context.Entry(UserType).State = EntityState.Modified; }
public void Insert(Entity.UserType UserType) { _context.Entry(UserType).State = EntityState.Added; }