Ejemplo n.º 1
0
 public Cat_TopicModel Post([Bind] Cat_TopicModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_TopicModel>(model, "Cat_Topic", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_TopicEntity, Cat_TopicModel>(model));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_TopicModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Cat_TopicModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_TopicEntity>(id, ConstantSql.hrm_cat_sp_get_TopicById, ref status);

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