예제 #1
0
 public ActionResult SepeteEkle(BasketAddDTO entity)
 {
     if (SabitlerDTO.KullaniciID > 0)
     {
         Basket basket = new Basket();
         basket.CustomerID = SabitlerDTO.KullaniciID;
         basket.ProductID  = entity.ProductID;
         basket.SKU        = entity.SKU;
         basket.Price      = entity.Price;
         basket.Total      = entity.SKU * entity.Price;
         db.Basket.Add(basket);
         db.SaveChanges();
         return(Redirect("http://localhost:62175/home/MutfakDetay/?anakategori=" + ana + "&altkategori=" + alt + ""));
     }
     return(null);
 }
예제 #2
0
 public JsonResult ProfilBilgileriDuzenle(ProfileListDTO entity)
 {
     try
     {
         var profil = db.user.Where(x => x.user_id == SabitlerDTO.KullaniciID).FirstOrDefault();
         profil.user_name          = entity.user_name;
         profil.user_email         = entity.user_email;
         profil.user_password_salt = entity.user_password_salt;
         profil.city_id            = entity.city_id;
         profil.user_cep           = entity.user_cep;
         db.SaveChanges();
         return(Json(profil, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(null);
     }
 }
예제 #3
0
        public bool IsLoginSucces(string user, string pas)
        {
            user resultUser = db.user.Where(x => x.user_email.Equals(user) && x.user_password_salt.Equals(pas)).FirstOrDefault();

            if (resultUser != null)
            {
                SabitlerDTO.KullaniciID     = resultUser.user_id;
                SabitlerDTO.KullaniciDURUM  = (bool)resultUser.user_status;
                resultUser.user_create_date = DateTime.Now;
                db.Entry(resultUser).State  = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return(true);
            }
            return(false);
        }