Beispiel #1
0
        // GET: Uye
        public ActionResult Index()
        {
            ViewVeriModel   model    = new ViewVeriModel();
            TatilcimContext _context = new TatilcimContext();

            model.User = _context.Users.Where(x => x.AuthorityId != 1).ToList();
            return(View(model));
        }
Beispiel #2
0
 public JsonResult GetDetail(int Id)
 {
     using (TatilcimContext _con = new TatilcimContext())
     {
         var otel = _con.Otels.Find(Id);
         return(Json(otel, JsonRequestBehavior.AllowGet));
     }
 }
        // GET: Otel
        public ActionResult Index()
        {
            ViewVeriModel model = new ViewVeriModel();

            using (TatilcimContext _context = new TatilcimContext())
            {
                model.Otel = _context.Otels.ToList();
            }
            return(View(model));
        }
Beispiel #4
0
        // GET: Basvuru
        public ActionResult Index()
        {
            ViewVeriModel model = new ViewVeriModel();

            using (TatilcimContext _context = new TatilcimContext())
            {
                model.Otel = _context.Otels.Where(x => x.Status == false && x.DeletedAt == null).OrderByDescending(x => x.CreatedAt).ToList();
            }
            return(View(model));
        }
Beispiel #5
0
        public ActionResult Add()
        {
            ViewVeriModel model = new ViewVeriModel();

            using (TatilcimContext _context = new TatilcimContext())
            {
                model.Authorities = _context.Authorities.ToList();
                model.Otel        = _context.Otels.Where(z => z.Status && z.DeletedAt == null).ToList();
            }
            return(View(model));
        }
        public ActionResult Index(FormCollection form)
        {
            var kAdi   = form["DisplayName"];
            var kSifre = form["Password"];

            using (TatilcimContext _context = new TatilcimContext())
            {
                var kullanici = _context.Users.FirstOrDefault(x => x.DisplayName == kAdi && x.Password == kSifre && x.AuthorityId == 1);
                if (kullanici != null)
                {
                    Session.Add("Id", kullanici.Id);
                    Session.Add("Name", kullanici.Name);

                    return(RedirectToAction("Index", "Home"));
                }
            }
            return(Redirect("/Login"));
            //return View();
        }
Beispiel #7
0
 public JsonResult Activated(int Id)
 {
     using (TatilcimContext _con = new TatilcimContext())
     {
         var otel = _con.Otels.Find(Id);
         otel.Status = true;
         if (_con.SaveChanges() > 0)
         {
             using (var redisManager = new PooledRedisClientManager())
                 using (var redis = redisManager.GetClient())
                 {
                     redis.Add("yeni_otel_" + Id, otel);
                     Services.ElasticServices.CreateIndex();
                 }
             return(Json("success", JsonRequestBehavior.AllowGet));
         }
         return(Json("error", JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #8
0
        public ActionResult Add(FormCollection form)
        {
            var  YetkiId   = Convert.ToInt32(form["AuthorityId"]);
            var  otelBilgi = Convert.ToInt32(form["OtelId"]);
            User kullanici = new User()
            {
                Name        = form["Name"],
                Description = form["Description"],
                Email       = form["Email"],
                AuthorityId = YetkiId,
                DisplayName = form["DisplayName"],
                Password    = form["Password"],
                OtelId      = otelBilgi,
                CreatedAt   = DateTime.Now,
                Image       = "Image",
            };

            using (TatilcimContext _con = new TatilcimContext())
            {
                _con.Users.Add(kullanici);
                _con.SaveChanges();
            }
            return(RedirectToAction("Index", "Uye"));
        }
Beispiel #9
0
 public AbstractBaseRepository()
 {
     context = new TatilcimContext();
 }