コード例 #1
0
        public ActionResult Add()
        {
            EmployeeClassAddViewModel model = new EmployeeClassAddViewModel();

            ViewBag.ShiftId = new List <string>();
            return(View("Add", model));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public async Task <JsonResult> checkClassfExist(EmployeeClassAddViewModel data)
 {
     return(await checkClass(data.comp_id, data.class_id)
         ? Json(true, JsonRequestBehavior.AllowGet)
         : Json(false, JsonRequestBehavior.AllowGet));
 }