Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "UserId,NameSurname,Gender,Email,Password,CountryNo,ImageURL")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "AdviceId,Title,Content,ImageURL,Date,AdviceTopicID")] Advice advice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(advice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(advice));
 }
Ejemplo n.º 3
0
        public ActionResult RenewalPassword(string NewPassword, string NewPasswordRepeat)
        {
            bool?Control = false;

            ViewBag.ControlPassword = "******";

            if (NewPassword == NewPasswordRepeat)
            {
                string Mail    = Request.QueryString["Mail"];
                User   Account = Db.Users.Where(x => x.Email == Mail).FirstOrDefault();
                Account.Password        = NewPassword;
                Db.Entry(Account).State = System.Data.Entity.EntityState.Modified;
                Db.SaveChanges();
                Control = true;
                RedirectToAction("Index");
            }

            return(View(Control));
        }
 public ActionResult Edit([Bind(Include = "InfoID,MailAdress,Password,Name")] AdminProfil adminProfil)
 {
     if (ModelState.IsValid)
     {
         db.Entry(adminProfil).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(adminProfil));
 }
Ejemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "CountryId,CountryName")] Country country)
 {
     if (ModelState.IsValid)
     {
         db.Entry(country).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(country));
 }
 public ActionResult Edit([Bind(Include = "ImageId,ImageURL,LocationId")] LocationImage locationImage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(locationImage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationId = new SelectList(db.Tourisms, "LocationId", "LocationName", locationImage.LocationId);
     return(View(locationImage));
 }
 public ActionResult Edit([Bind(Include = "LocationId,LocationName,Content,Address,CountryId")] Tourism tourism)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tourism).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(db.Countries, "CountryId", "CountryName", tourism.CountryId);
     return(View(tourism));
 }
 public ActionResult Edit([Bind(Include = "TitleId,Text,CommentCategoryId")] ForumTopicTitle forumTopicTitle)
 {
     if (ModelState.IsValid)
     {
         db.Entry(forumTopicTitle).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CommentCategoryId = new SelectList(db.ForumCommentCategories, "CategoryId", "CategoryName", forumTopicTitle.CommentCategoryId);
     return(View(forumTopicTitle));
 }
Ejemplo n.º 9
0
 public ActionResult Edit([Bind(Include = "ImageId,ImageURL,RestaurantId")] RestaurantImage restaurantImage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurantImage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RestaurantId = new SelectList(db.Restaurants, "RestaurantId", "RestaurantName", restaurantImage.RestaurantId);
     return(View(restaurantImage));
 }
 public ActionResult Edit([Bind(Include = "CategoryId,CategoryName,CountryId")] AdviceTopic adviceTopic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(adviceTopic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(db.Countries, "CountryId", "CountryName", adviceTopic.CountryId);
     return(View(adviceTopic));
 }
 public ActionResult Edit([Bind(Include = "RestaurantId,RestaurantName,Content,Address,CoverImageURL,CountryId")] Restaurant restaurant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(db.Countries, "CountryId", "CountryName", restaurant.CountryId);
     return(View(restaurant));
 }
Ejemplo n.º 12
0
 public ActionResult Edit([Bind(Include = "TopicId,TopicTitle,ForumTopicTitleId")] ForumCommentTopic forumCommentTopic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(forumCommentTopic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ForumTopicTitleId = new SelectList(db.ForumTopicTitles, "TitleId", "Text", forumCommentTopic.ForumTopicTitleId);
     return(View(forumCommentTopic));
 }
 public ActionResult Edit([Bind(Include = "CommentId,Content,UserId,RestaurantId")] RestaurantComment restaurantComment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurantComment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RestaurantId = new SelectList(db.Restaurants, "RestaurantId", "RestaurantName", restaurantComment.RestaurantId);
     ViewBag.UserId       = new SelectList(db.Users, "UserId", "NameSurname", restaurantComment.UserId);
     return(View(restaurantComment));
 }
Ejemplo n.º 14
0
 public ActionResult Edit([Bind(Include = "CommentId,Content,UserId,CommentTopicId,Permission")] ForumComment forumComment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(forumComment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId         = new SelectList(db.Users, "UserId", "NameSurname", forumComment.UserId);
     ViewBag.CommentTopicId = new SelectList(db.ForumCommentTopics, "TopicId", "TopicTitle", forumComment.CommentTopicId);
     return(View(forumComment));
 }
Ejemplo n.º 15
0
 public ActionResult Edit([Bind(Include = "ActivityId,ImageURL,Title,Content,Date,StartTime,FinishTime,Address,CountryId,UserId,Permission,Participation,NumberofParticipations")] Activity activity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(activity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(db.Countries, "CountryId", "CountryName", activity.CountryId);
     ViewBag.UserId    = new SelectList(db.Users, "UserId", "NameSurname", activity.UserId);
     return(View(activity));
 }
Ejemplo n.º 16
0
 public ActionResult Edit([Bind(Include = "CommentId,Content,UserId,LocationId,Permission")] LocationComment locationComment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(locationComment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationId = new SelectList(db.Tourisms, "LocationId", "LocationName", locationComment.LocationId);
     ViewBag.UserId     = new SelectList(db.Users, "UserId", "NameSurname", locationComment.UserId);
     return(View(locationComment));
 }
Ejemplo n.º 17
0
        // GET: Panel/Profile

        public ActionResult Index(int?id, int?PersonID)
        {
            PlatformContext db   = new PlatformContext();
            User            User = Db.Users.Find(id);

            if (PersonID != null)
            {
                User User2 = Db.Users.Find(PersonID);
                User2.Score           = User2.Score + 1;//yardım ettiği kişi sayısı arttırılıyor
                Db.Entry(User2).State = System.Data.Entity.EntityState.Modified;
                Db.SaveChanges();
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.CountryName = (Db.Countries.Where(x => x.CountryId == User.CountryNo).Select(x => x.CountryName)).FirstOrDefault();
            return(View(User));
        }
Ejemplo n.º 18
0
        // GET: Panel/Profile

        public ActionResult Index(int?id, int?PersonID)
        {//profilde ilk kişinin profiline gidiliyor id ile daha sonra puan verilirse kişiye kişinin id si tekrar alınıyor person id ile yardım ettiği kişi sayısı arttırılıyor
            PlatformContext db   = new PlatformContext();
            User            User = Db.Users.Find(id);

            if (PersonID != null)
            {
                User User2 = Db.Users.Find(PersonID);
                User2.Score           = User2.Score + 1;//yardım ettiği kişi sayısı arttırılıyor
                Db.Entry(User2).State = System.Data.Entity.EntityState.Modified;
                Db.SaveChanges();
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.CountryName = (Db.Countries.Where(x => x.CountryId == User.CountryNo).Select(x => x.CountryName)).FirstOrDefault();//profilinde ülkeside çıksın diye aldım
            return(View(User));
        }
        //[HttpPost]

        public JsonResult AcceptDeny(int id, int sonuc)
        {
            PlatformContext db          = new PlatformContext();
            Activity        a           = new Activity();
            int             kullaniciId = (int)Session["EnterID"];

            if (sonuc == 1)
            {
                var update = db.Activities.FirstOrDefault(x => x.ActivityId == id);
                var u      = db.Users.Find(kullaniciId);
                update.Participants.Add(u);
                update.Participation   = true;
                db.Entry(update).State = EntityState.Modified;
                db.SaveChanges();
                //a.Participation = true;
                //a.ActivityId = id;
                //a.UserId = kullaniciId;
                return(Json(a));
            }
            else
            {
                //a.Participation = false;
                //a.ActivityId = id;
                //a.UserId = kullaniciId;
                string message = "";
                try
                {
                    //DB Update işlemleri yapılacak
                    //var update = db.Activities.Where(x => x.ActivityId == id);
                    var update = db.Activities.FirstOrDefault(x => x.ActivityId == id && x.UserId == kullaniciId);
                    update.Participation = false;
                    db.SaveChanges();

                    message = "Success";
                }
                catch (Exception ex)
                {
                    message = "Error";
                }

                return(Json(message));
                //kim hangi etkinliğe katılıyor oonu onu bul onun üsütnden calış
            }
        }