Exemplo n.º 1
0
 public void BoardPreferential(Preferential passenger)
 {
     if (Car.Passengers.Count != Car.Capacity)
     {
         Car.Passengers.Add(passenger);
     }
 }
Exemplo n.º 2
0
 public void Update(Preferential instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     else
     {
         Db.Entry(instance).State = EntityState.Modified;
         this.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void Create(Preferential instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     else
     {
         Db.Preferential.Add(instance);
         this.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public ActionResult Edit(Preferential pft)
 {
     try
     {
         //var preferential = new PreferentialRepository().Get((int)id);
         pft.inpdate = DateTime.Now;
         new PreferentialRepository().Update(pft);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 5
0
        public ActionResult Create(Preferential pf)
        {
            try
            {
                pf.offerModel = 3;
                pf.inpdate    = DateTime.Now;
                pf.vaild      = 1;
                new PreferentialRepository().Create(pf);
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// nothing work
 /// </summary>
 /// <param name="passenger">nothing</param>
 public void AddPreferential(Preferential passenger)
 {
     throw new NotImplementedException("Can\'t add preferential for taxi");
 }
Exemplo n.º 7
0
 public static Child ToChild(Preferential preferential)
 {
     return(new Child(preferential.Name));
 }
Exemplo n.º 8
0
 public static Adult ToAdult(Preferential preferential)
 {
     return(new Adult(preferential.Name));
 }
Exemplo n.º 9
0
 public void BoardPreferential(Preferential passenger)
 {
     throw new NotImplementedException("Taxi cant ride preferential - cast to other type");
 }
 /// <summary>
 /// add preferential passenger
 /// </summary>
 /// <param name="passenger">preferential passenger</param>
 public void AddPreferential(Preferential passenger)
 {
     Passengers.Add(passenger);
 }
Exemplo n.º 11
0
        public ActionResult Create()
        {
            Preferential pf = new Preferential();

            return(View(pf));
        }