public void Add(DateTime baslangic, DateTime bitis, int aracid, MusteriBilgileri model)
        {
            // bu ekleme metodu istek olmadan yapılmış eklemeler için kullanılmaktadır.

            MusteriWebService musteriWebService = new MusteriWebService();

            musteriWebService.Add(model); // musteri web servisini kullanarak müşteriyi ekledik

            AracWebService aracWebService = new AracWebService();
            var            arac           = aracWebService.GetCarById(aracid); // arac web servisini kullanarak aracı aldık

            TimeSpan fark = (bitis - baslangic);                               // farkı bulduk

            KiralamaBLL    kiralamaBusiness = new KiralamaBLL();               // kiralama business layerinı instance ederek işlemi yaptık
            KiralikAraclar kiralamaEntity   = new KiralikAraclar();            // ilgili entity'i oluşturduk

            kiralamaEntity.aracID          = aracid;
            kiralamaEntity.baslangicTarihi = baslangic;
            kiralamaEntity.bitisTarihi     = bitis;
            kiralamaEntity.durum           = true;
            kiralamaEntity.musteriID       = model.musteriID;
            kiralamaEntity.kiralamaUcreti  = arac.gunlukFiyat * ((decimal)fark.TotalDays);

            kiralamaBusiness.Add(kiralamaEntity); // ilgili entity'i ekledik

            IstekWebService istekWebService = new IstekWebService();

            istekWebService.Update(aracid, baslangic, bitis);
        }
Ejemplo n.º 2
0
      // GET: AllCars
      public ActionResult Index()
      {
          AracKiralamaWebService.AracWebService aracWebService = new AracKiralamaWebService.AracWebService();
          var model = aracWebService.GetAllCars(Convert.ToInt16(Session["sirketId"]));

          return(View(model));
      }
Ejemplo n.º 3
0
 public ActionResult Kirala(int id)
 {
     using (AracKiralamaWebService.AracWebService aracWebService = new AracKiralamaWebService.AracWebService())
     {
         var model = aracWebService.GetCarById(id);
         return(View(model));
     }
 }
        public ActionResult Istek(int id)
        {
            AracKiralamaWebService.AracWebService aracWebService = new AracKiralamaWebService.AracWebService();

            var model = aracWebService.GetCarById(id);

            return(View(model));
        }
        public ActionResult GetCar(DateTime baslangic, DateTime bitis)
        {
            Session["baslangic"] = baslangic;
            Session["bitis"]     = bitis;
            AracKiralamaWebService.AracWebService aracWebService = new AracKiralamaWebService.AracWebService();
            var model = aracWebService.GetForCustomers(baslangic, bitis);

            return(View(model));
        }
Ejemplo n.º 6
0
 public ActionResult GetCar(DateTime baslangic, DateTime bitis)
 {
     using (AracKiralamaWebService.AracWebService aracWebService = new AracKiralamaWebService.AracWebService())
     {
         Session["baslangic"] = baslangic;
         Session["bitis"]     = bitis;
         var model = aracWebService.GetForUsers(baslangic, bitis, Convert.ToInt16(Session["sirketId"]));
         return(View(model));
     }
 }
        public void Add(int musteriId, int aracid, DateTime baslangic, DateTime bitis)
        {
            KiralamaBLL kiralamaBusiness = new KiralamaBLL();

            AracWebService aracWebService = new AracWebService();
            var            arac           = aracWebService.GetCarById(aracid);

            KiralikAraclar kiralikentity = new KiralikAraclar();

            kiralikentity.aracID          = aracid;
            kiralikentity.musteriID       = musteriId;
            kiralikentity.durum           = true;
            kiralikentity.baslangicTarihi = baslangic;
            kiralikentity.bitisTarihi     = bitis;

            TimeSpan fark = (bitis - baslangic);

            kiralikentity.kiralamaUcreti = arac.gunlukFiyat * ((decimal)fark.TotalDays);

            kiralamaBusiness.Add(kiralikentity);
            IstekWebService istekWebService = new IstekWebService();

            istekWebService.Update(aracid, baslangic, bitis);
        }