public ActionResult Create([Bind(Include = "id,mtipId,musteriAdi,tcNo,Email,telEv,telIs,GSM,adres,servisGirisTarih,servisGirisSaat,seriNo,imei,musteriSikayet,Aciklama,takipNo,garantiId,TurunId")] BankoGiris bankoGiris) { if (ModelState.IsValid) { double numara; try { numara = Convert.ToDouble((from s in db.BankoGirisler orderby s.id descending select s).FirstOrDefault().takipNo); } catch (Exception) { numara = 0; } numara++; string num = numara.ToString().PadLeft(7, '0'); bankoGiris.takipNo = num; bankoGiris.servisGirisSaat = DateTime.Now; bankoGiris.servisGirisTarih = DateTime.Now; db.BankoGirisler.Add(bankoGiris); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.mtipId = new SelectList(db.MusteriTipler, "Id", "MusteriTipi", bankoGiris.mtipId); ViewBag.garantiId = new SelectList(db.Garantiler, "ID", "GarantiAdi", bankoGiris.garantiId); ViewBag.TurunId = new SelectList(db.Urunler, "ID", "UrunKodu"); return(View(bankoGiris)); }
public ActionResult Create([Bind(Include = "ID,yetkiadi")] Yetki yetki) { if (ModelState.IsValid) { db.Yetkiler.Add(yetki); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yetki)); }
public ActionResult Create([Bind(Include = "Id,MusteriTipi")] MusteriTip musteriTip) { if (ModelState.IsValid) { db.MusteriTipler.Add(musteriTip); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(musteriTip)); }
public ActionResult Create([Bind(Include = "ID,BolumAdi")] Bolum bolum) { if (ModelState.IsValid) { db.Bolumler.Add(bolum); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bolum)); }
public ActionResult Create([Bind(Include = "id,teknikerNo,teknikerAdi")] tekniker tekniker) { if (ModelState.IsValid) { db.Teknikerler.Add(tekniker); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tekniker)); }
public ActionResult UserKayit(UserG user, HttpPostedFileBase Foto) { if (!ModelState.IsValid) { Response.StatusCode = (int)HttpStatusCode.BadRequest; return(View(user)); } try { UserG email = (from s in DB.Userlar where s.email == user.email select s).FirstOrDefault(); if (email != null) { ModelState.AddModelError("alarm", "Bu mail adresi sisteme kaydolmuş."); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(View(user)); } user.sifre = FormsAuthentication.HashPasswordForStoringInConfigFile(user.sifre, "SHA1").ToLower(); user.ipadres = Request.ServerVariables["REMOTE_ADDR"]; user.uyelikTarih = DateTime.Now; user.girisTarih = DateTime.Now; user.girissayisi = 0; user.yetki = 0; user.onay = true; if (Foto != null) { WebImage img = new WebImage(Foto.InputStream); FileInfo fotoinfo = new FileInfo(Foto.FileName); string newfoto = Guid.NewGuid().ToString() + fotoinfo.Extension; img.Resize(120, 120); img.Save("~/Yuklemeler/UserFoto/" + newfoto); user.foto = "/Yuklemeler/UserFoto/" + newfoto; } //else //{ // WebImage img = new WebImage(Foto.InputStream); // FileInfo fotoinfo = new FileInfo(Foto.FileName); // string newfoto = Guid.NewGuid().ToString() + fotoinfo.Extension; // img.Resize(120, 120); // img.Save("~/Yuklemeler/UserFoto/" + newfoto); // user.foto = "/Yuklemeler/UserFoto/" + newfoto; //} DB.Userlar.Add(user); DB.SaveChanges(); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(Content("Üye kaydınız başarıyla oluşturuldu.")); } catch (Exception) { return(View(user)); } }
// GET: SYADMIN/TeknikerAta public ActionResult Index(int?id, int?Bid) { if (Bid != null) { Session["a"] = Bid.Value; TempData["b"] = Bid.Value;//1. tekniker atama için ilk olarak listele sayfasından seçilen kaydı tempdataya atıyoruz.Tempdata çalışma pirensibi sistem kapanmadan ve üzerine yazılmadan aynı datayı taşıması. } if (id == null) { return(View(DB.Teknikerler.ToList())); } var teknik = (from s in DB.Teknikerler where s.id == id select s).FirstOrDefault(); ViewBag.tek = teknik.teknikerAdi; int sayi = (from s in DB.Teknikerler where s.id == id select s.teknikerIsYuk).FirstOrDefault(); sayi++; int a = Convert.ToInt32(TempData["b"]); BankoGiris bnk = DB.BankoGirisler.First(s => s.id == a); bnk.TeknikerAdi = ViewBag.tek; tekniker guncelle = DB.Teknikerler.First(u => u.id == id); guncelle.teknikerIsYuk = sayi; DB.SaveChanges(); //return View(DB.Teknikerler.ToList()); return(RedirectToAction("Listele")); }
//[HttpPost] public JsonResult YorumYap(string yorumum) { UserG usr = (UserG)Session["userbilgi"]; if (yorumum == null) { return(Json(true, JsonRequestBehavior.AllowGet)); } DB.UserYorumlar.Add(new UserYorum { userId = usr.ID, userAdi = usr.adi, tarih = DateTime.Now, yorum = yorumum, foto = usr.foto }); DB.SaveChanges(); return(Json(false, JsonRequestBehavior.AllowGet)); }
public ActionResult Kaydet(TeknikServisGiris teknikServisGiris) { if (ModelState.IsValid) { DB.TServisler.Add(teknikServisGiris); DB.SaveChanges(); return(RedirectToAction("Listele")); } ViewBag.DurumId = new SelectList(DB.Durumlar, "ID", "DurumKodu", teknikServisGiris.DurumId); ViewBag.BelirtiId = new SelectList(DB.Belirtiler, "ID", "BelirtiKodu", teknikServisGiris.BelirtiId); ViewBag.OnarimId = new SelectList(DB.Onarimlar, "ID", "OnarimKodu", teknikServisGiris.OnarimId); ViewBag.ArizaId = new SelectList(DB.Arizalar, "ID", "ArizaKodu", teknikServisGiris.ArizaId); return(View()); }
public ActionResult kaydet(Kullanicilar kullaniclar) { db.Kullanicilar.Add(kullaniclar); db.SaveChanges(); return(RedirectToAction("Giris", "Home")); }