コード例 #1
0
        public JsonResult CreateEnquiry(Enquiry enquiry)
        {
            db.Enquiry.Add(enquiry);
            db.SaveChanges();

            return Json(true);
        }
コード例 #2
0
        public JsonResult UpdateEnquiry(Enquiry _enquiry)
        {
            Enquiry enquiry = db.Enquiry.Find(_enquiry.Id);
            enquiry.Name = _enquiry.Name;
            enquiry.Email = _enquiry.Email;
            enquiry.Contact = _enquiry.Contact;
            enquiry.Details = _enquiry.Details;
            db.Entry(enquiry).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            return Json(true);
        }