Пример #1
0
        // GET: Client/Lienhe
        public ActionResult Index()
        {
            var db     = new LienheBusiness();
            var result = db.GetPage_Lienhe();

            return(View(result));
        }
Пример #2
0
        public ActionResult _AddNewContact(string hoten = "", string diachi = "", string email = "", string sdt = "", string tieude = "Không có tiêu đề", string noidung = "")
        {
            var        db   = new LienheBusiness();
            tbl_lienhe item = new tbl_lienhe();

            item.hoten     = hoten;
            item.diachi    = diachi;
            item.dienthoai = sdt;
            item.email     = email;
            item.tieude    = tieude;
            item.noidung   = noidung;
            item.trangthai = 0;
            item.ngaygui   = DateTime.Now;

            var result = db.BS_AddNewContact(item);

            // luu log - thêm mới
            CheckRuleAndSaveLog.ReturnCheckRuleAndSaveLog(DbLogType.Create.ToString(), result.IsSuccess, JsonConvert.SerializeObject(new { data = item }, Newtonsoft.Json.Formatting.Indented, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));

            return(Json(new { result }, JsonRequestBehavior.AllowGet));
        }