public JsonResult Edit(AboutUs us) { var res = false; if (us.Id == null || us.Id == Guid.Empty.ToSafeTrim()) { us.Id = Guid.NewGuid().ToSafeTrim(); res = new BaseService().Insert<AboutUs>(us); } else res = new BaseService().Update<AboutUs>(us); return Json(new { res = res }); }
public model.AboutUs Get() { var sql = "select * from [AboutUs]"; var us = new model.AboutUs(); using (var sReader = SqlDBHelper.ExecuteReader(sql)) { while (sReader.Read()) { us.Id = sReader["Id"].ToString(); us.Cont = sReader["Cont"].ToString(); } } return us; }