public ActionResult Add() { EmployeeClassAddViewModel model = new EmployeeClassAddViewModel(); ViewBag.ShiftId = new List <string>(); return(View("Add", model)); }
public async Task <ActionResult> Add(EmployeeClassAddViewModel data) { if (ModelState.IsValid) { try { data.createdDateTime = DateTime.Now; data.createdBy = Session["user_id"].ToString(); var postTask = await client.PostAsJsonAsync("/api/EmployeeClass/Add", data); if (postTask.IsSuccessStatusCode) { return(Json(true, JsonRequestBehavior.DenyGet)); } } catch (Exception e) { return(Json(e.Message, JsonRequestBehavior.DenyGet)); } } return(Json(false, JsonRequestBehavior.DenyGet)); }
public async Task <JsonResult> checkClassfExist(EmployeeClassAddViewModel data) { return(await checkClass(data.comp_id, data.class_id) ? Json(true, JsonRequestBehavior.AllowGet) : Json(false, JsonRequestBehavior.AllowGet)); }