Beispiel #1
0
 public Cat_ItemModel Post([Bind] Cat_ItemModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_ItemModel>(model, "Cat_Item", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_ItemEntity, Cat_ItemModel>(model));
 }
Beispiel #2
0
        /// <summary>
        /// [Chuc.Nguyen] - Lấy dữ liệu Ngân Hàng(Cat_Bank) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_ItemModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Cat_ItemModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_ItemEntity>(id, ConstantSql.hrm_cat_sp_get_ItemById, ref status);

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