Example #1
0
 public Cat_JobTitleModel Post([Bind] Cat_JobTitleModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_JobTitleModel>(model, "Cat_JobTitle", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_JobTitleEntity, Cat_JobTitleModel>(model));
 }
Example #2
0
        /// <summary>
        /// [Son.Vo] - Lấy dữ liệu JobTitle(Cat_JobTitle) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_JobTitleModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Cat_JobTitleModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_JobTitleEntity>(id, ConstantSql.hrm_cat_sp_get_JobTitleById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <Cat_JobTitleModel>();
            }
            model.ActionStatus = status;
            return(model);
        }