Ejemplo n.º 1
0
 public Hre_VisaInfoModel Post([Bind] Hre_VisaInfoModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Hre_VisaInfoModel>(model, "Hre_VisaInfo", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Hre_VisaInfoEntity, Hre_VisaInfoModel>(model));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// [Quoc.Do] - Lấy dữ liệu VisaInfo(Hre_VisaInfo) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Hre_VisaInfoModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Hre_VisaInfoModel();
            ActionService service = new ActionService(UserLogin);
            //var entity = service.GetByIdUseStore<Hre_WorkHistoryEntity>(id, ConstantSql.hrm_hr_sp_get_VisaInfoById, ref status);
            var entity = service.GetData <Hre_VisaInfoEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_VisaInfoById, ref status).FirstOrDefault();

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