public static bool FirmaKasiyerEkle(Kasiyer model) { try { PolinitKartDbContext _db = new PolinitKartDbContext(); model.AktifMi = true; _db.Kasiyerler.Add(model); _db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public ActionResult KasiyerTanimla() { var id = Request.QueryString["veri"]; if (id == "0" || id == null) { return(RedirectToAction("Login", "../Home")); } else { ViewBag.ID = id; Kasiyer kasiyer = new Kasiyer(); kasiyer.FirmaID = Convert.ToInt32(id); return(View(kasiyer)); } }
public ActionResult KasiyerTanimla(Kasiyer model) { if (FirmaAdminExtention.FirmaKasiyerEkle(model)) { ViewBag.Sonuc = "success"; ViewBag.Mesaj = "Kasiyer Oluşturma Başarılı"; ViewBag.Icon = "glyphicon glyphicon-ok"; ModelState.Clear(); } else { ViewBag.sonuc = "danger"; ViewBag.Mesaj = "Kasiyer Oluşturma Başarısız!!!"; ViewBag.Icon = "glyphicon glyphicon-remove"; } return(View()); }