public ActionResult Create(Eva_EvaluatorModel model) { var service = new RestServiceClient <Eva_EvaluatorModel>(UserLogin); service.SetCookies(this.Request.Cookies, _Hrm_Hr_Service); var result = service.Post(_Hrm_Hr_Service, "api/Eva_Evaluator360/", model); ViewBag.MsgInsert = "Insert success"; return(Json(result, JsonRequestBehavior.AllowGet)); }
public Eva_EvaluatorModel GetById(Guid id) { string status = string.Empty; var model = new Eva_EvaluatorModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Eva_EvaluatorEntity>(id, ConstantSql.hrm_eva_sp_get_EvaluatorById, ref status); if (entity != null) { model = entity.CopyData <Eva_EvaluatorModel>(); } model.ActionStatus = status; return(model); }
public Eva_EvaluatorModel Post([Bind] Eva_EvaluatorModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Eva_EvaluatorModel>(model, "Eva_Evaluator", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion Eva_EvaluatorServices evaluatorService = new Eva_EvaluatorServices(); var evaluatorEntity = model.CopyData <Eva_EvaluatorEntity>(); evaluatorService.AddEvaluators(evaluatorEntity); return(model); //ActionService service = new ActionService(UserLogin); //return service.UpdateOrCreate<Eva_EvaluatorEntity, Eva_EvaluatorModel>(model); }