Exemplo n.º 1
0
 public Cat_MasterProjectModel Post([Bind] Cat_MasterProjectModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_MasterProjectModel>(model, "Cat_MasterProject", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_MasterProjectEntity, Cat_MasterProjectModel>(model));
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_MasterProjectModel GetById(Guid id)
        {
            string status  = string.Empty;
            var    model   = new Cat_MasterProjectModel();
            var    service = new ActionService(UserLogin);
            var    entity  = service.GetByIdUseStore <Cat_MasterProjectEntity>(id, ConstantSql.hrm_cat_sp_get_MasterProjectByIds, ref status);

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