Example #1
0
 public Cat_SupplierModel Post([Bind] Cat_SupplierModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_SupplierModel>(model, "Cat_Supplier", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_SupplierEntity, Cat_SupplierModel>(model));
 }
Example #2
0
        /// <summary>
        /// [T Lấy dữ liệu Thương Hiệu(Cat_Brand) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_SupplierModel GetById(Guid id)
        {
            string status  = string.Empty;
            var    model   = new Cat_SupplierModel();
            var    service = new ActionService(UserLogin);
            var    entity  = service.GetByIdUseStore <Cat_SupplierEntity>(id, ConstantSql.hrm_cat_sp_get_SupplierById, ref status);

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