public ActionResult Create(Cat_MasterDataGroupModel model) { var service = new RestServiceClient <Cat_MasterDataGroupModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Post(_hrm_Hr_Service, "api/Cat_MasterDataGroup/", model); return(Json(result, JsonRequestBehavior.AllowGet)); }
public Cat_MasterDataGroupModel Post([Bind] Cat_MasterDataGroupModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_MasterDataGroupModel>(model, "Cat_MasterDataGroup", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); return(service.UpdateOrCreate <Cat_MasterDataGroupEntity, Cat_MasterDataGroupModel>(model)); }
/// <summary>Lấy dữ liệuMasterDataGroup</summary> /// <param name="id"></param> /// <returns></returns> public Cat_MasterDataGroupModel GetById(Guid id) { string status = string.Empty; var model = new Cat_MasterDataGroupModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Cat_MasterDataGroupEntity>(id, ConstantSql.hrm_cat_sp_get_MasterDataGroupid, ref status); if (entity != null) { model = entity.CopyData <Cat_MasterDataGroupModel>(); } model.ActionStatus = status; return(model); }