Exemplo n.º 1
0
        public ActionResult SirketSayfasi(string aracId, string sirketId)
        {
            try
            {
                bool success;
                Arac arac = null;
                using (var aracBusiness = new AracBusiness())
                {
                    success = aracBusiness.UpdateAracMusaitlikDurumu(int.Parse(aracId));
                    arac    = aracBusiness.SelectAracById(int.Parse(aracId));
                }
                var message = success ? "done" : "failed";


                List <Arac> rezervasyon = null;
                using (var aracBusiness = new AracBusiness())
                {
                    rezervasyon = aracBusiness.SelectAllRezervasyonArac(arac.SirketId);
                    Session.Add("Razervasyon", rezervasyon);
                }
                Console.WriteLine("Operation " + message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error happened: " + ex.Message);
            }


            return(RedirectToAction("SirketSayfasi", "Sirket"));
        }