示例#1
0
        public IActionResult Create(string memberId, int rec_no, string site_visit_desc, int country_code)
        {
            var member = _context.member.Single(m => m.id == new Guid(memberId));

            var mem_site_visit = new mem_site_visit();

            //need to change logic for primaru key rec_no
            mem_site_visit.rec_no          = rec_no;
            mem_site_visit.member_code     = member.member_code;
            mem_site_visit.site_visit_desc = site_visit_desc;
            mem_site_visit.country_code    = country_code;
            mem_site_visit.x_status        = "Y";

            _context.mem_site_visit.Add(mem_site_visit);
            _context.SaveChanges();

            return(Json(new { result = "success" }));
        }
 // GET: mem_site_visit/Details/5
 public IActionResult Details(string id)
 {
     if (id != null)
     {
         mem_site_visit msv = _context.mem_site_visit.Single(m => m.id == new Guid(id));
         if (msv != null)
         {
             return(Json(new { id = msv.id, rec_no = msv.rec_no, site_visit_desc = msv.site_visit_desc, country_code = msv.country_code }));
         }
         else
         {
             return(NotFound());
         }
     }
     else
     {
         return(NotFound());
     }
 }