Example #1
0
        /// <summary>
        /// [Chuc.Nguyen] - Lấy dữ liệu bảng Tai Nạn(Hre_Accident) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FIN_CashAdvanceItemModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new FIN_CashAdvanceItemModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Fin_CashAdvanceItemEntity>(id, ConstantSql.hrm_hr_sp_get_CashAdvanceItemById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <FIN_CashAdvanceItemModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Example #2
0
        public FIN_CashAdvanceItemModel Post([Bind] FIN_CashAdvanceItemModel model)
        {
            #region Validate

            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <FIN_CashAdvanceItemModel>(model, "FIN_CashAdvanceItem", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }

            #endregion
            ActionService service = new ActionService(UserLogin);

            return(service.UpdateOrCreate <Fin_CashAdvanceItemEntity, FIN_CashAdvanceItemModel>(model));
        }