public SIM createSIM(String telNum, double avaibleCredit, List <call> calls, date date, String ownerNickname, promotions promotions, String Operator) { SIM s = null; //nuova sim non in portabilità if (Operator.Equals("operatore1")) { s = new SIM(telNum, avaibleCredit, date, ownerNickname, promotions); }//sim in portabilità else { s = new SIM(telNum, avaibleCredit, calls, date, ownerNickname, promotions, Operator); } sims.Add(s); return(s); }
static void Main(string[] args) { SIMHandler sH = new SIMHandler(); String OPERATOR = "operator1"; SIM s1 = sH.createSIM("3276319633", 10000, null, new date(10, 10, 2019), "tizio", promotions.NOPROMOTION, OPERATOR); SIM s2 = sH.createSIM("380438648", 10000, null, new date(8, 3, 2017), "caio", promotions.CHIAMAERICHIAMA, OPERATOR); SIM s3 = sH.createSIM("0438738374", 10000, null, new date(6, 4, 2018), "semprogno", promotions.MINUTIILLIMITATI, "operator2"); sH.phone(s1, "380438648"); sH.phone(s1, "0438738374"); sH.phone(s2, "380438648"); sH.phone(s3, "380438648"); sH.phone(s3, "3276319633"); sH.phone(s2, "3276319633"); sH.registerInFile(s1); sH.registerInFile(s2); sH.registerInFile(s3); }
public void phone(SIM sim, String telNumber) { sim.phone(telNumber); }
public void removeSIM(SIM sim) { sims.Remove(sim); }
public bool isStillActive(SIM sim, date today) { return(today.hasOneYearPassed(sim.getDate(), today)); }
public bool isPortable(SIM sim) { return(sim.getOperator().Equals("operator1") ? false : true); }
public void changePromotionsStatus(SIM sim, promotions promotionCode) { sim.setPromotion(promotionCode); }
public List <call> allCalls(SIM sim) { return(sim.getCalls()); }