// GET: mem_worklist/Details/5 public IActionResult Details(string id) { if (id != null) { mem_worklist mw = _context.mem_worklist.Single(m => m.id == new Guid(id)); if (mw != null) { return(Json(new { id = mw.id, rec_no = mw.rec_no, company_name_th = mw.company_name_th, company_name_eng = mw.company_name_eng, position_name_th = mw.position_name_th, position_name_eng = mw.position_name_eng, work_year = mw.work_year, office_address = mw.office_address })); } else { return(NotFound()); } } else { return(NotFound()); } }
public IActionResult Create(string memberId, int rec_no, string company_name_th, string company_name_eng, string position_name_th, string position_name_eng, string work_year, string office_address) { var member = _context.member.Single(m => m.id == new Guid(memberId)); var mem_worklist = new mem_worklist(); mem_worklist.member_code = member.member_code; mem_worklist.rec_no = rec_no; mem_worklist.company_name_th = company_name_th; mem_worklist.company_name_eng = company_name_eng; mem_worklist.position_name_th = position_name_th; mem_worklist.position_name_eng = position_name_eng; mem_worklist.work_year = work_year; mem_worklist.office_address = office_address; mem_worklist.x_status = "Y"; _context.mem_worklist.Add(mem_worklist); _context.SaveChanges(); return(Json(new { result = "success" })); }