public string Create(MusteriViewModel model)  //yeni bir tane film tur ekleme yapar
        {
            try
            {
                SinemaOtomasyonuEntities db = new SinemaOtomasyonuEntities();
                Musteri ft = null;
                if (model.MusteriIDNumber > 0)
                {
                    ft = db.Musteri.FirstOrDefault(f => f.MusteriID == model.MusteriIDNumber);
                }
                else
                {
                    ft = new Musteri();
                }
                ft.MusteriAdı      = model.MusteriAdıNumber;
                ft.MusteriSoyad    = model.MusteriSoyadNumber;
                ft.MusteriUserName = model.MusteriUserNameNumber;
                ft.MusteriPassWord = model.MusteriPassWordNumber;

                if (model.MusteriIDNumber == 0)
                {
                    db.Musteri.Add(ft);
                }

                db.SaveChanges();

                return("1");
            }
            catch
            {
                return("-1");
            }
        }
예제 #2
0
        public ActionResult DashboardPanel()
        {
            MusteriViewModel model = new MusteriViewModel();

            model.MusteriListe = _musteriService.CustomerList();
            return(View(model));
        }
 public object NewCustomer(MusteriViewModel model)
 {
     try
     {
         var db = new CustomerDatabaseEntities();
         db.Customers.Add(new Customer()
         {
             AdSoyad       = model.AdSoyad,
             Cinsiyet      = model.Cinsiyet,
             Adres         = model.Adres,
             DogumTarihi   = model.DogumTarihi,
             YasadigiSehir = model.YasadigiSehir,
             Email         = model.Email,
             Meslek        = model.Meslek,
             Telefon       = model.Tel,
             ReklamMaili   = model.ReklamMaili,
             WebSite       = model.WebSite,
             Notlar        = model.Notlar
         });
         db.SaveChanges();
         return(new
         {
             success = true
         });
     }
     catch (Exception ex)
     {
         return(new
         {
             success = false,
             message = ex.Message
         });
     }
 }
 public object UpdateCustomer(MusteriViewModel model)
 {
     try
     {
         var db  = new CustomerDatabaseEntities();
         var cus = db.Customers.Find(model.Id);
         cus.AdSoyad       = model.AdSoyad;
         cus.Cinsiyet      = model.Cinsiyet;
         cus.DogumTarihi   = model.DogumTarihi;
         cus.YasadigiSehir = model.YasadigiSehir;
         cus.Email         = model.Email;
         cus.Meslek        = model.Meslek;
         cus.Telefon       = model.Tel;
         cus.ReklamMaili   = model.ReklamMaili;
         cus.WebSite       = model.WebSite;
         cus.Notlar        = model.Notlar;
         db.SaveChanges();
         return(new
         {
             success = true
         });
     }
     catch (Exception ex)
     {
         return(new
         {
             success = false,
             message = ex.Message
         });
     }
 }
예제 #5
0
        public JsonResult MusteriParkOdeme(int id)
        {
            MusteriViewModel model = new MusteriViewModel();

            model.Musteri = _musteriService.Customer(id);
            model.Park    = _musteriService.CustomerPark(id);
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
예제 #6
0
        public ActionResult CustomerPayment(int id)
        {
            MusteriDTO       musteri = _musteriService.Customer(id);
            MusteriParkDTO   park    = _musteriService.CustomerPark(id);
            MusteriViewModel model   = new MusteriViewModel();

            model.Musteri = musteri;
            model.Park    = park;
            return(View(model));
        }
        public JsonResult MusteriGetir(int id)
        {
            SinemaOtomasyonuEntities db = new SinemaOtomasyonuEntities();
            Musteri          kullanici  = db.Musteri.FirstOrDefault(f => f.MusteriID == id);
            MusteriViewModel model      = new MusteriViewModel();

            model.MusteriIDNumber       = kullanici.MusteriID;
            model.MusteriAdıNumber      = kullanici.MusteriAdı;
            model.MusteriPassWordNumber = kullanici.MusteriPassWord;
            model.MusteriSoyadNumber    = kullanici.MusteriSoyad;
            model.MusteriUserNameNumber = kullanici.MusteriUserName;
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        // GET: Musteri
        public ActionResult Index()
        {


            using (UrunContext ctx = new UrunContext())
            {
                MusteriViewModel ovm = new MusteriViewModel();
                ovm.Musteriler = ctx.Musteriler.ToList();

                return View(ovm);
            }

        }
예제 #9
0
        public ActionResult CustomerInsert(int id)
        {
            MusteriViewModel model = new MusteriViewModel();

            model.AracModel = AracModel();
            if (id == 1)
            {
                model.CustomerPartial = "Park";
            }
            else if (id == 2)
            {
                model.CustomerPartial = "Yıkama";
            }
            return(View(model));
        }
예제 #10
0
        public ActionResult CustomerDetail(int id)
        {
            MusteriViewModel model = new MusteriViewModel();

            model.Musteri = _musteriService.Customer(id);
            if (model.Musteri.HizmetTuru == "Yıkama")
            {
                model.Yikama = _musteriService.CustomerWashing(id);
            }
            else if (model.Musteri.HizmetTuru == "Park")
            {
                model.Park = _musteriService.CustomerPark(id);
            }
            return(View(model));
        }
예제 #11
0
 public MusteriView()
 {
     InitializeComponent();
     DataContext = new MusteriViewModel();
 }
        public ActionResult Index()
        {
            MusteriViewModel model = new MusteriViewModel();

            return(View(model));
        }