Beispiel #1
0
 public CatCategoryModel Post([Bind] CatCategoryModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <CatCategoryModel>(model, "Cat_Category", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_CategoryEntity, CatCategoryModel>(model));
 }
Beispiel #2
0
        /// <summary>
        /// [Tin.Nguyen] - Lấy dữ liệu Loại Thiết Bị(Cat_Category) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public CatCategoryModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new CatCategoryModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_CategoryEntity>(id, ConstantSql.hrm_cat_sp_get_CategoryById, ref status);

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