Esempio n. 1
0
        public Ins_ChildSickModel GetById(Guid id)
        {
            string status  = string.Empty;
            var    model   = new Ins_ChildSickModel();
            var    service = new ActionService(UserLogin);
            var    entity  = service.GetByIdUseStore <Ins_ChildSickEntity>(id, ConstantSql.hrm_ins_sp_get_ChildSickById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <Ins_ChildSickModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Esempio n. 2
0
        public Ins_ChildSickModel Post([Bind] Ins_ChildSickModel model)
        {
            string status = string.Empty;

            if (model.ProfileID == Guid.Empty)
            {
                model.ProfileID = Common.ConvertToGuid(model.ProfileIDs);
            }
            #region Validate

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

            #endregion

            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <Ins_ChildSickEntity, Ins_ChildSickModel>(model));
        }