Esempio n. 1
0
 public EntityService()
 {
     _biletService   = new BiletRepository();
     _calisanService = new CalisanRepository();
     _filmService    = new FilmRepository();
     _filmturService = new FilmTurRepository();
     _musteriService = new MusteriRepository();
     _salonService   = new SalonRepository();
     _seansService   = new SeansRepository();
 }
Esempio n. 2
0
        public ActionResult Edit()
        {
            int ID = Convert.ToInt32(RouteData.Values["id"]);


            Calisan c = CalisanRepository.FirstOrDefault(x => x.Id == ID);


            List <Calisan> liste = CalisanRepository.GetList().ToList();

            DepartmanYukle(c.DepartmanId);

            YoneticiYukle((Int32)c.YoneticiBilgisiId);

            return(View(c));
        }
 public bool DeleteCalisanById(int ID)
 {
     try
     {
         bool isSuccess;
         using (var repo = new CalisanRepository())
         {
             isSuccess = repo.DeletedById(ID);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:CalisanBusiness::DeleteCalisan::Error occured.", ex);
     }
 }
 public bool UpdateCalisan(Calisan entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new CalisanRepository())
         {
             isSuccess = repo.Update(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:CalisanBusiness::UpdateCalisan::Error occured.", ex);
     }
 }
Esempio n. 5
0
        void YoneticiYukle(int CalisanId)
        {
            List <SelectListItem> SelectList  = new List <SelectListItem>();
            List <Calisan>        CalisanList = CalisanRepository.GetList().ToList();

            foreach (var item in CalisanList)
            {
                bool state = false;
                if (CalisanId == item.Id)
                {
                    state = true;
                }

                SelectList.Add(new SelectListItem {
                    Text = item.Ad + " " + item.Soyad, Value = item.Id.ToString(), Selected = state
                });
            }
            ViewBag.Yoneticiler = SelectList;
        }
 public Calisan SelectCalisanById(int CalisanId)
 {
     try
     {
         Calisan responseEntitiy;
         using (var repo = new CalisanRepository())
         {
             responseEntitiy = repo.SelectedById(CalisanId);
             if (responseEntitiy == null)
             {
                 throw new NullReferenceException("Calisan doesnt exists!");
             }
         }
         return(responseEntitiy);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:CalisanBusiness::SelectCalisanById::Error occured.", ex);
     }
 }
        public List <Calisan> SelectAllCalisan()
        {
            var responseEntities = new List <Calisan>();

            try
            {
                using (var repo = new CalisanRepository())
                {
                    foreach (var entity in repo.SelectAll())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
                throw new Exception("BusinessLogic:CalisanBusiness::SelectAllCalisan::Error occured.", ex);
            }
        }
Esempio n. 8
0
        public ActionResult Edit(Calisan model)
        {
            int     ID          = Convert.ToInt32(RouteData.Values["id"]);
            int     DepartmanId = Convert.ToInt32(Request["DepartmanID"]);
            Calisan calisan     = CalisanRepository.FirstOrDefault(x => x.Id == ID);

            calisan.Ad                = Request["Ad"].ToString();
            calisan.Soyad             = Request["Soyad"].ToString();
            calisan.Telefon           = model.Telefon;
            calisan.DepartmanId       = DepartmanId;
            calisan.YoneticiBilgisiId = model.YoneticiBilgisiId;

            try
            {
                CalisanRepository.Update(calisan);
                CalisanRepository.Save();
                return(RedirectToAction("Listele"));
            }
            catch (Exception)
            {
                return(View(model));
            }
        }
Esempio n. 9
0
        public ActionResult Ekle(Calisan model)
        {
            Calisan calisan = new Calisan();

            calisan.Ad          = Request["Ad"].ToString();
            calisan.Soyad       = Request["Soyad"].ToString();
            calisan.Telefon     = Request["Telefon"].ToString();
            calisan.DepartmanId = Convert.ToInt32(Request["DepartmanID"]);
            //calisan.YoneticiBilgisiId= CalisanRepository().Find;
            if (Request["Yoneticiler"] != null)
            {
                calisan.YoneticiBilgisiId = Convert.ToInt32(Request["Yoneticiler"]);
            }
            try
            {
                CalisanRepository.Add(calisan);
                CalisanRepository.Save();
                return(RedirectToAction("Listele"));
            }
            catch (Exception)
            {
                return(View(model));
            }
        }
Esempio n. 10
0
 public CalisanService()
 {
     _calisanRepository = new CalisanRepository();
 }
Esempio n. 11
0
 // GET: Admin/Calisan
 public ActionResult Listele()
 {
     return(View(CalisanRepository.GetList()));
 }
Esempio n. 12
0
 public BaseController()
 {
     context             = new RehberContext();
     CalisanRepository   = new CalisanRepository(context);
     DepartmanRepository = new DepartmanRepository(context);
 }