예제 #1
0
        public dynamic GetInfo(int Id)
        {
            TitleInfo model = new TitleInfo();

            try
            {
                model = _titleInfoService.GetObjectById(Id);
            }
            catch (Exception ex)
            {
                LOG.Error("GetInfo", ex);
                Dictionary <string, string> Errors = new Dictionary <string, string>();
                Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Id,
                model.Code,
                model.Name,
                model.Description,
                model.IsShiftable,
                model.IsSalaryAllIn,
                model.AccessLevel,
                model.Errors
            }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public SalaryStandard VHasTitleInfo(SalaryStandard salaryStandard, ITitleInfoService _titleInfoService)
        {
            TitleInfo titleInfo = _titleInfoService.GetObjectById(salaryStandard.TitleInfoId);

            if (titleInfo == null)
            {
                salaryStandard.Errors.Add("TitleInfo", "Tidak ada");
            }
            return(salaryStandard);
        }
예제 #3
0
        public Employee VHasTitleInfo(Employee employee, ITitleInfoService _titleInfoService)
        {
            TitleInfo titleInfo = _titleInfoService.GetObjectById(employee.TitleInfoId);

            if (titleInfo == null)
            {
                employee.Errors.Add("TitleInfo", "Tidak valid");
            }
            return(employee);
        }