public void ArmyUpdate(ArmyBLL ArmyToEdit) { ArmyDAL Army = new ArmyDAL(); Army = ArmyToEdit.ToDAL(); _context.ArmyUpdate(Army); }
public int ArmyCreate(ArmyBLL InputArmy) { ArmyDAL Army = new ArmyDAL(); Army = InputArmy.ToDAL(); return(_context.ArmyCreate(Army)); }
public ArmyBLL ArmyFindByID(int ArmyID) { //retrieve army by armyID ArmyBLL ReturnValue = null; ArmyDAL item = _context.ArmyFindByID(ArmyID); if (item != null) { ReturnValue = new ArmyBLL(item); } return(ReturnValue); }
public List <ArmyBLL> ArmiesFindByUserID(int UserID, int Skip, int Take) { // retrieves all armies by userID, skip/take are for future functionality List <ArmyBLL> ReturnValue = new List <ArmyBLL>(); List <ArmyDAL> items = _context.ArmiesFindByUserID(UserID, Skip, Take); foreach (ArmyDAL item in items) { ArmyBLL NewItem = new ArmyBLL(item); ReturnValue.Add(NewItem); } return(ReturnValue); }
public List <ArmyBLL> ArmiesGetAll(int skip, int take) { // skip take are for future paging functionality List <ArmyBLL> ReturnValue = new List <ArmyBLL>(); List <ArmyDAL> items = _context.ArmiesGetAll(skip, take); foreach (ArmyDAL item in items) { // using a loop and the constructor to transfer info up. ArmyBLL NewItem = new ArmyBLL(item); ReturnValue.Add(NewItem); } return(ReturnValue); }
} // future idea calculate the "name" of the encounter //level by army pointcost public FullArmyData(ArmyBLL army, List <ArmyModelBLL> RetrievedModels) { // we can populate the class with values from the Data access layer models = RetrievedModels; ArmyID = army.ArmyID; ArmyName = army.ArmyName; UserID = army.UserID; UserName = army.UserName; Comments = army.Comments; FactionID = army.FactionID; FactionName = army.FactionName; JackPoints = AvailablePoints(models); // calculates the available points for warjacks ArmyCost = CalculateArmyCost(models); // calculates the army cost }