예제 #1
0
        private BaseResponse UpdateKpiAchievement(IEnumerable <ConfigurationViewModel.Item> data)
        {
            var response = new BaseResponse {
                IsSuccess = false, Message = "Data Not Valid"
            };

            if (data != null)
            {
                var batch = new BatchUpdateKpiAchievementRequest();
                foreach (var datum in data)
                {
                    var prepare = new UpdateKpiAchievementItemRequest()
                    {
                        Id = datum.Id, KpiId = datum.KpiId, Periode = datum.Periode, Value = datum.Value, PeriodeType = datum.PeriodeType, Remark = datum.Remark
                    };                                                                                                                                                                                               // data.MapTo<UpdateKpiAchievementItemRequest>();
                    batch.BatchUpdateKpiAchievementItemRequest.Add(prepare);
                }
                response = _kpiAchievementService.BatchUpdateKpiAchievements(batch);
            }
            return(response);
        }
예제 #2
0
        private BaseResponse UpdateKpiAchievement(IEnumerable <ConfigurationViewModel.Item> data)
        {
            var response = new BaseResponse {
                IsSuccess = false, Message = "Data Not Valid"
            };

            if (data != null)
            {
                var batch = new BatchUpdateKpiAchievementRequest();
                foreach (var datum in data)
                {
                    var prepare = new UpdateKpiAchievementItemRequest()
                    {
                        Id = datum.Id, KpiId = datum.KpiId, Periode = datum.Periode, Value = datum.Value, PeriodeType = datum.PeriodeType, Remark = datum.Remark, UpdateFrom = "KPIAchievementForm"
                    };                                                                                                                                                                                                                                 // data.MapTo<UpdateKpiAchievementItemRequest>();
                    batch.BatchUpdateKpiAchievementItemRequest.Add(prepare);
                }
                batch.ControllerName = "File";
                batch.ActionName     = "ProcessFile";
                batch.UserId         = UserProfile().UserId;
                response             = _kpiAchievementService.BatchUpdateKpiAchievements(batch);
            }
            return(response);
        }