Beispiel #1
0
        /// <summary>
        /// [Chuc.Nguyen] - Lấy dữ liệu Nhân Viên (Hre_Profile) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Hre_ProfileModel GetById(Guid id)
        {
            var    service = new Hre_ProfileServices();
            string status  = string.Empty;
            var    entity  = service.GetData <Hre_ProfileEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, UserLogin, ref status).FirstOrDefault();

            //xu ly tam de lay ten loai nghi viec vi hien tai left join nhiu qa trong store khong chay dc
            if (entity.TypeOfStopID != null)
            {
                var catservice       = new Cat_NameEntityServices();
                var entityNameEntity = catservice.GetData <Cat_NameEntityEntity>(Common.DotNetToOracle(entity.TypeOfStopID.ToString()), ConstantSql.hrm_cat_sp_get_NameEntityById, UserLogin, ref status).FirstOrDefault();
                if (entityNameEntity != null)
                {
                    entity.TypeOfStopName = entityNameEntity.NameEntityName;
                }
            }
            var model = entity.CopyData <Hre_ProfileModel>();

            if (model != null && model.DateOfEffect != null)
            {
                model.DateOfEffectOld = model.DateOfEffect;
            }
            model.ActionStatus = status;
            return(model);
        }
Beispiel #2
0
        /// <summary>
        /// [Chuc.Nguyen] - Lấy dữ liệu Nhân Viên (Hre_Profile) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Hre_ProfileModel GetById(Guid id)
        {
            var service = new Hre_ProfileServices();
            string status = string.Empty;
            var entity = service.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, UserLogin, ref status).FirstOrDefault();
            //xu ly tam de lay ten loai nghi viec vi hien tai left join nhiu qa trong store khong chay dc
            if (entity.TypeOfStopID != null)
            {
                var catservice = new Cat_NameEntityServices();
                var entityNameEntity = catservice.GetData<Cat_NameEntityEntity>(Common.DotNetToOracle(entity.TypeOfStopID.ToString()), ConstantSql.hrm_cat_sp_get_NameEntityById, UserLogin, ref status).FirstOrDefault();
                if (entityNameEntity != null)
                {
                    entity.TypeOfStopName = entityNameEntity.NameEntityName;
                }

            }
            var model = entity.CopyData<Hre_ProfileModel>();
            if (model != null && model.DateOfEffect != null)
            {
                model.DateOfEffectOld = model.DateOfEffect;
            }
            model.ActionStatus = status;
            return model;
        }