public static bool saveAboutus(tbl_AboutUs _About) { bool _result = true; using (seckinkirtasiyeEntities db = new seckinkirtasiyeEntities()) { try { if (_About.Aboutus_ID == 0) { db.tbl_AboutUs.Add(_About); } else { db.tbl_AboutUs.Attach(_About); db.Entry(_About).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } catch (Exception) { _result = false; } } return(_result); }
public static bool SaveAboutus(tbl_AboutUs _AboutUs) { bool _result = true; using (PortfolioDBEntities db = new PortfolioDBEntities()) { try { if (_AboutUs.AboutUs_id == 0) { db.tbl_AboutUs.Add(_AboutUs); } else { db.tbl_AboutUs.Attach(_AboutUs); db.Entry(_AboutUs).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } catch (Exception) { _result = false; } } return(_result); }
public ActionResult AboutUs(int aboutusid, string aboutus, tbl_AboutUs _Aboutus) { _Aboutus.AboutUs_id = aboutusid; _Aboutus.AboutUs = aboutus; Data.Data.SaveAboutus(_Aboutus); return(View()); }
public ActionResult aboutus_services(tbl_AboutUs AboutUs) { if (Data.Data.saveAboutus(AboutUs) == false) { ViewBag.Error = "Lütfen Bilgilerinizi Kontrol Ediniz."; return(RedirectToAction("PagenotFound_Error", "Default")); } return(View()); }
public ActionResult Aboutus(tbl_AboutUs aboutus, string aboutustext) { aboutus.Aboutus_ID = 1; aboutus.AboutUs = aboutustext; if (Data.Data.saveAboutus(aboutus) == false) { ViewBag.Error = "Lütfen Bilgilerinizi Kontrol Ediniz."; return(RedirectToAction("Error", "Default")); } return(RedirectToAction("Aboutus_Services", "Admin")); }
public ActionResult Aboutus() { if (Session["AdminUser"] == null) { return(RedirectToAction("AdminLogin", "Admin")); } tbl_AboutUs aboutus = Data.Data.get_aboutus(1); ViewBag.Aboutus = aboutus.AboutUs; return(View()); }
public ActionResult aboutus_services(int?id) { id = 1; if (Session["UserID"] == null) { return(RedirectToAction("Login", "Admin")); } tbl_AboutUs aboutus = Data.Data.get_about(id); ViewBag.aboutus = aboutus.AboutUs; return(View(aboutus)); }