コード例 #1
0
 public Cat_CommunistPartyPositionModel Post([Bind] Cat_CommunistPartyPositionModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_CommunistPartyPositionModel>(model, "Cat_CommunistPartyPosition", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_CommunistPartyPositionEntity, Cat_CommunistPartyPositionModel>(model));
 }
コード例 #2
0
        /// <summary>
        /// [Kiet.Chung] - Lấy dữ liệu WorkPlace(Cat_CommunistPartyPosition) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_CommunistPartyPositionModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Cat_CommunistPartyPositionModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_CommunistPartyPositionEntity>(id, ConstantSql.hrm_cat_sp_get_CommunistPartyPositionById, ref status);

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