Beispiel #1
0
        public static List <MasterDataModel> GetMastersForAddUser()
        {
            List <MasterDataModel> _finalList = new List <MasterDataModel>();
            MasterDataModel        _master;

            using (PJEntities _entity = new PJEntities())
            {
                var countryData = _entity.Country_Master.ToList();
                var roleData    = _entity.Role_Master.ToList();

                _master = new MasterDataModel();

                _master.CountryMasterList = (from a in countryData
                                             select new CountryMaster_List()
                {
                    CountryId = a.Country_Master_Id,
                    CountryName = a.Country_Name
                }).OrderBy(x => x.CountryName).ToList();

                _master.RoleMasterList = (from a in roleData
                                          select new RoleMaster_List()
                {
                    RoleId = a.Role_Master_Id,
                    RoleName = a.Role_Name
                }).OrderBy(x => x.RoleName).ToList();
                _finalList.Add(_master);
            }
            return(_finalList);
        }
Beispiel #2
0
        public Task BindModelAsync(ModelBindingContext bindingContext)
        {
            //var day = 0;
            //var month = 0;
            //var year = 0;

            //if (!int.TryParse(bindingContext.ActionContext.HttpContext.Request.Query["day"], out day) ||
            //!int.TryParse(bindingContext.ActionContext.HttpContext.Request.Query["month"], out month) ||
            //!int.TryParse(bindingContext.ActionContext.HttpContext.Request.Query["year"], out year))
            //{
            //    return Task.CompletedTask;
            //}

            var result = new MasterDataModel
            {
                MasterCountry           = new List <MasterCountry>(),
                MasterDocumentType      = new List <MasterDocumentType>(),
                MasterEthnicity         = new List <MasterEthnicity>(),
                MasterFundingSource     = new List <MasterFundingSource>(),
                MasterInsurancePCP      = new List <MasterInsurancePCP>(),
                MasterInsuranceType     = new List <MasterInsuranceType>(),
                MasterOccupation        = new List <MasterOccupation>(),
                MasterPreferredLanguage = new List <MasterPreferredLanguage>(),
                MasterRace   = new List <MasterRace>(),
                MasterState  = new List <MasterState>(),
                MasterStatus = new List <MasterStatus>()
            };

            bindingContext.Result = ModelBindingResult.Success(result);
            return(Task.CompletedTask);
        }
Beispiel #3
0
        public virtual ActionResult Index(StatisticsFilterModel filter = null)
        {
            filter = filter ?? new StatisticsFilterModel();

            ViewBag.UserName = filter.UserName;

            ViewBag.Filter = filter;

            ViewBag.CountryDepartmentList = SearchModel.GetCountryDeparmentList();

            ViewBag.SectorDepartmentList = SearchModel.GetSectorDeparmentList();

            ViewBag.DivisionList = SearchModel.GetDivisionBySectorDeparment(null);

            ViewBag.CountryList = SearchModel.GetCountryByCountryDeparment(null);

            ViewBag.OperationTypeList = MasterDataModel.GetMasterDataModels("OPERATION TYPE");
            ((List <ConvergenceMasterDataModel>)ViewBag.OperationTypeList).Insert(0, this.CreateSelectDataModel("Operation Type"));

            ViewBag.OverallStageList = MasterDataModel.GetMasterDataModels("OVERALL_STAGE");
            ((List <ConvergenceMasterDataModel>)ViewBag.OverallStageList).Insert(0, this.CreateSelectDataModel("Overall Stage"));

            var FundList = MasterDataModel.GetMasterDataModels("FUND");

            ViewBag.FundList = MasterDataModel.GetMasterDataModels("FUND");
            ((List <ConvergenceMasterDataModel>)ViewBag.FundList).Insert(0, this.CreateSelectDataModel("Fund"));

            ViewBag.SelectedFilter = SelectedFilter.none;

            var model = new SearchQueryModel();

            model.UserName     = filter.UserName;
            model.ClauseStatus = filter.ClauseStatus;
            return(View(model));
        }
Beispiel #4
0
        public async Task LoadMasterDataFromDatabase(string serverId)
        {
            logService.Log($"Setting up Game Server with id: {serverId}");
            MasterDataModel masterData = await databaseService.GetMasterData(serverId);

            if (masterData == null)
            {
                logService.Log("Master Data is null!");
                throw new AggregateException("Master Data is null");
            }

            // Add universes
            foreach (var item in masterData.Universes)
            {
                gameStateService.UniverseCollection.Add(item);
            }

            // Add Worlds
            foreach (var item in masterData.Worlds)
            {
                gameStateService.WorldCollection.Add(item);
            }

            // Add Areas
            foreach (var item in masterData.Areas)
            {
                gameStateService.AreaCollection.Add(item);
            }

            //Add Sections
            gameStateService.SectionCollection.SetBundle(masterData.Sections);
        }
Beispiel #5
0
        public async Task <ActionResult> SaveGrant(string grantName, string grantCode)
        {
            try
            {
                MasterDataModel model    = new MasterDataModel();
                var             existing = DB.MasterData.FirstOrDefault(x => x.MstName == grantName);
                if (existing != null)
                {
                    return(Json(new { data = false }));
                }
                else
                {
                    model.MstTypeID    = 3;
                    model.MstCode      = grantCode;
                    model.MstName      = grantName;
                    model.IsActive     = true;
                    model.ModifiedDate = DateTime.Now;
                    model.ModifiedBy   = (Int64)Session[Constants.SessionEmpID];
                    DB.MasterData.Add(model);
                    DB.SaveChanges();

                    //send mail
                    await SendEmail(grantName, grantCode);

                    return(Json(new { data = true }));
                }
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog(ex);
                return(Json(new { data = "Error" }));
            }
        }
Beispiel #6
0
        private MasterDataModel CreateNewMasterData()
        {
            // Create Universe
            List <UniverseData> universes = CreateNewUniverse("Test Universe");

            // Create 7 worlds
            List <WorldData> worlds = CreateSevenWorlds(universes[0]);

            // Create areas and populate them
            List <AreaData> areas    = new List <AreaData>();
            SectionBundle   sections = sectionFactory.CreateNewSectionBundle();

            foreach (var world in worlds)
            {
                var worldAreas = CreateWorldAreas(world);
                areas.AddRange(worldAreas);
                SetSectionsIntoWorldAreas(areas, sections);
            }

            MasterDataModel masterData = new MasterDataModel()
            {
                ServerId  = "fake_server",
                Universes = universes,
                Worlds    = worlds,
                Areas     = areas,
                Sections  = sections,
            };

            return(masterData);
        }
Beispiel #7
0
 public void FillCurrentMaster(int id)
 {
     _currentMasterID = id;
     _currentMaster   = Masters.Where(p => p.ID == id).FirstOrDefault();
     if (LoadCurrentMasterComplete != null)
     {
         LoadCurrentMasterComplete(this, new EventArgs());
     }
 }
 private void SaveGameState()
 {
     if (tickCount % 60 == 0)
     {
         Task.Run(() => {
             MasterDataModel masterDataModel = gameStateService.GetMasterData();
         });
     }
 }
Beispiel #9
0
        public void AddMaster(string name, string phone)
        {
            MasterDataModel model = new MasterDataModel
            {
                Name  = name,
                Phone = phone
            };

            SendRequest("UF" + JsonConvert.SerializeObject(model));
        }
Beispiel #10
0
        public MasterDataModel GetMasterData()
        {
            MasterDataModel model = new MasterDataModel();

            model.Universes = UniverseCollection.GetAll();
            model.Worlds    = WorldCollection.GetAll();
            model.Areas     = AreaCollection.GetAll();
            model.Sections  = SectionCollection.Bundle;
            return(model);
        }
Beispiel #11
0
        public void UpdateMaster(string name, string phone, int id)
        {
            MasterDataModel model = new MasterDataModel
            {
                Name  = name,
                Phone = phone,
                ID    = id
            };

            SendRequest("UG" + JsonConvert.SerializeObject(model));
        }
Beispiel #12
0
        /// <summary>
        /// Returns the Data captured by the sensors.
        /// </summary>
        /// <returns></returns>
        public MasterDataModel GetData()
        {
            MasterDataModel masterDataModel = new MasterDataModel();

            masterDataModel.AccelerometerData     = ((AccelerometerCapture)senseors[0]).AccelerometerDataReading;
            masterDataModel.GyroscopeData         = ((GyroscopeCapture)senseors[1]).GyroscopeDataReading;
            masterDataModel.OrientationSensorData = ((OrientationCapture)senseors[2]).OrientationDataReading;
            masterDataModel.CompassData           = ((CompassCapture)senseors[3]).CompassDataReading;
            masterDataModel.MagnetometerData      = ((MagnetometerCapture)senseors[4]).MagnetometerDataReading;
            return(masterDataModel);
        }
Beispiel #13
0
        public SensorPage(MasterDataModel masterDataModel = null)
        {
            InitializeComponent();
            IIoCContainer container = Builder.Build();

            ViewModel = container.Resolve <IBaseViewModel>() as SensorPageViewModel;
            NavigationPage.SetHasNavigationBar(this, false);
            if (masterDataModel != null)
            {
                ViewModel.SensorData = masterDataModel;
            }
        }
Beispiel #14
0
        public MasterDataModel GetMasterModel(int companyId)
        {
            MasterDataModel model = new MasterDataModel();

            model.Company             = GetCompanyInfo(companyId);
            model.Branches            = GetBranches(companyId);
            model.Departments         = GetDepartments(companyId);
            model.InterviewPanel      = GetInterviewPanel(companyId);
            model.TechnologyAndSkills = GetTechnologyAndSkills(companyId);
            model.Types = GetTypes();
            return(model);
        }
Beispiel #15
0
        public async Task UpdateMasterData(MasterDataModel model)
        {
            var filter = Builders <MasterDataModel> .Filter.Eq("ServerId", model.ServerId);

            var update = Builders <MasterDataModel> .Update
                         .Set("Universes", model.Universes)
                         .Set("Worlds", model.Worlds)
                         .Set("Areas", model.Areas)
                         .Set("Sections", model.Sections);

            await masterDataCollection.UpdateOneAsync(filter, update);
        }
Beispiel #16
0
 public MasterDataModel GetMasterDataByName(List <string> masterDataNames)
 {
     try
     {
         MasterDataModel listMasterDataModel = new MasterDataModel();
         GetMasterData(masterDataNames, listMasterDataModel);
         return(listMasterDataModel);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #17
0
        public virtual ActionResult SetExpiredStage(string operationNumber)
        {
            var message     = string.Empty;
            var operation   = _operationRepository.GetOne(x => x.OperationNumber == operationNumber);
            var cmNotStared = _enumMappingService.GetMasterData <CSMilestoneStateEnum>(CSMilestoneStateEnum.NotStarted);
            var cmComplete  = _enumMappingService.GetMasterData <CSMilestoneStateEnum>(CSMilestoneStateEnum.Completed);

            var cmNotStaredModel = new MasterDataModel()
            {
                Code = cmNotStared.Code, MasterId = cmNotStared.MasterDataId, MasterTypeId = cmNotStared.MasterType.MasterTypeId, Name = cmNotStared.NameEn, TypeName = cmNotStared.MasterType.Type
            };
            var cmCompleteModel = new MasterDataModel()
            {
                Code = cmComplete.Code, MasterId = cmComplete.MasterDataId, MasterTypeId = cmComplete.MasterType.MasterTypeId, Name = cmComplete.NameEn, TypeName = cmComplete.MasterType.Type
            };

            if (operation != null)
            {
                var cmb = CMBusiness.Get(operation);

                var activityItems = cmb.Context.ActivityPlanItems;

                foreach (var activityItem in activityItems)
                {
                    activityItem.EndDate   = null;
                    activityItem.StartDate = null;
                    activityItem.StatusId  = CMConstants.ActivityItemStatus.NotStarted.MasterId;
                    cmb.UpdateActivityItem(activityItem);
                }

                var transMilestone = cmb.Context.GetActivityItem("CSCW");
                transMilestone.EndDate   = null;
                transMilestone.StartDate = null;
                transMilestone.StatusId  = CMConstants.ActivityItemStatus.Completed.MasterId;
                cmb.UpdateActivityItem(transMilestone);

                transMilestone           = cmb.Context.GetActivityItem("CSVP");
                transMilestone.EndDate   = null;
                transMilestone.StartDate = null;
                transMilestone.StatusId  = CMConstants.ActivityItemStatus.Completed.MasterId;
                cmb.UpdateActivityItem(transMilestone);

                message = "Operation " + operationNumber + " is in Expired Stage.";
            }
            else
            {
                message = "Operation " + operationNumber + " doesn´t exist.";
            }

            return(View("FakeLifeCycle", model: message));
        }
Beispiel #18
0
        public virtual ActionResult ResultsMatrix()
        {
            ViewBag.SelectedFilter = SelectedFilter.resultsMatrix;

            ViewBag.ResultsMatrixFlags = this.GetResultsMatrixFlags();
            ((List <ConvergenceMasterDataModel>)ViewBag.ResultsMatrixFlags).Insert(0, this.CreateSelectDataModel("Flag"));

            ViewBag.ResultsMatrixPMRRequired = this.GetYesNoOptions();
            ((List <ConvergenceMasterDataModel>)ViewBag.ResultsMatrixPMRRequired).Insert(0, this.CreateSelectDataModel("PMR Required"));

            ViewBag.ResultsMatrixValidationStage = MasterDataModel.GetMasterDataModels("VALIDATION_STAGE");
            ViewBag.ResultsMatrixValidationStage = ((List <ConvergenceMasterDataModel>)ViewBag.ResultsMatrixValidationStage).Where(model => model.Code.StartsWith("PMI")).ToList();
            ((List <ConvergenceMasterDataModel>)ViewBag.ResultsMatrixValidationStage).Insert(0, this.CreateSelectDataModel("Validation Stage"));

            return(View());
        }
Beispiel #19
0
        public List <PresentationSmell> detectPresentationSmells(Slides slides)
        {
            smellsList = new List <PresentationSmell>();
            MasterDataModel dataModel = new MasterDataModel(slides);

            dataModel.build();

            detectTextHellSmell(dataModel);
            detectByobSmell(dataModel);
            detectColormaniaSmell(dataModel);
            detectItsLasVegasSmell(dataModel);
            detectSecretaryofHiPUSmell(dataModel);
            detectChaoticStylistSmell(dataModel);
            detectStungbySpellBeeSmell(dataModel);
            detectSubSubBulletSmell(dataModel);
            return(smellsList);
        }
        public HttpResponseMessage Get(int id)
        {
            try
            {
                MasterDataModel     model    = _repo.GetMasterModel(id);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, model);

                return(response);
            }
            catch (Exception ex)
            {
                _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace);
                return(new HttpResponseMessage(HttpStatusCode.InternalServerError)
                {
                    Content = new StringContent(ex.Message)
                });
            }
        }
        public void Load(string operationNumber)
        {
            OperationContext = new OperationBusiness();
            Globals.Rules.ApplyParentLogic(this, OperationContext);
            OperationContext.Load(operationNumber);
            ResultsMatrixContext = new ResultsMatrixBusiness();
            Globals.Rules.ApplyParentLogic(this, ResultsMatrixContext);
            ResultsMatrixContext.Load(OperationContext);
            Url = new UrlHelper(IDBContext.Current.ContextRequestContext);

            VIS_TL              = MasterDefinitions.GetValidationStage("VIS_TL");
            VIS_REV             = MasterDefinitions.GetValidationStage("VIS_REV");
            VIS_DRAFY           = MasterDefinitions.GetValidationStage("VIS_DRAFY");
            VIS_READY           = MasterDefinitions.GetValidationStage("VIS_READY");
            VIS_COO             = MasterDefinitions.GetValidationStage("VIS_COO");
            LocationTypes       = MasterDefinitions.GetMasterByType("VO_LOCATION_TYPE");
            MediaSourceTypes    = MasterDefinitions.GetMasterByType("MEDIA_SOURCE");
            DeliveryStatusTypes = MasterDefinitions.GetMasterByType("VO_DELIVERY_STATUS")
                                  .OrderByDescending(a => a.Code).ToList();
            Execute("Visualization.Load");
        }
        public MasterDataModel GetMasterData()
        {
            MasterDataModel masterdata = new MasterDataModel()
            {
                ConfirmationTypes = masterDataRepository.GetConfirmationTypes(),
                Controls          = masterDataRepository.GetControls(),
                Education         = masterDataRepository.GetEducations(),
                FamilyTypes       = masterDataRepository.GetFamilyTypes(),
                HF = masterDataRepository.GetHFs(),
                IdentificationTypes = masterDataRepository.GetIdentificationTypes(),
                Languages           = masterDataRepository.GetLanguages(),
                Locations           = masterDataRepository.GetLocations(),
                Officers            = masterDataRepository.GetOfficers(),
                Payers        = masterDataRepository.GetPayers(),
                Products      = masterDataRepository.GetProducts(),
                Professions   = masterDataRepository.GetProfessions(),
                Relations     = masterDataRepository.GetRelations(),
                PhoneDefaults = masterDataRepository.GetPhoneDefaults(),
                Genders       = masterDataRepository.GetGenders()
            };

            return(masterdata);
        }
Beispiel #23
0
        public ActionResult SaveMasterData(MasterDataModel data)
        {
            var result = new List <MasterDataModel>();

            data.LanguageId = CurrentUser.LanguageId;
            var Entity   = MapperHelper.Map <MasterDataModel, MasterDataEntity>(data);
            var response = this._masterDataService.SaveMasterData(Entity);

            if (response != null)
            {
                var resultMasterData = JsonConvert.DeserializeObject <HrmResultModel <MasterDataModel> >(response);
                if (!CheckPermission(resultMasterData))
                {
                    //return to Access Denied
                }
                else
                {
                    result = resultMasterData.Results;
                }
            }

            return(Json(new { Data = result }, JsonRequestBehavior.AllowGet));
        }
Beispiel #24
0
        public void DumpMasterData()
        {
            if (configurator.Config.MasterDataDumpFolder.Equals(string.Empty))
            {
                logService.Log("Dump will no be done because dump folder isn't valid");
            }

            MasterDataModel masterData = gameStateService.GetMasterData();

            var jsonText = JsonConvert.SerializeObject(masterData, Formatting.Indented);
            var fileName = Path.Combine(configurator.Config.MasterDataDumpFolder, $"{DateTime.Now.ToString("yyyy-MM-dd-HH_mm_ss")}_MASTER_DUMP.json");

            logService.Log($"Dumping master data to file: {fileName}");

            try {
                File.WriteAllText(fileName, jsonText);
            }
            catch (Exception e) {
                logService.Log(e);
                throw;
            }

            logService.Log($"Finishded dumping to file: {fileName}");
        }
Beispiel #25
0
 public ChaoticStylistSmellDetectors(MasterDataModel dataModel)
 {
     this.dataModel = dataModel;
 }
Beispiel #26
0
 public void SetCurrentMaster(MasterDataModel model)
 {
     _currentMaster   = model;
     _currentMasterID = model.ID;
     PersonalHandler.Instance.SetCurrentMaster(model.ID);
 }
Beispiel #27
0
        private void detectChaoticStylistSmell(MasterDataModel dataModel)
        {
            ChaoticStylistSmellDetectors detector = new ChaoticStylistSmellDetectors(dataModel);

            smellsList.AddRange(detector.detect());
        }
Beispiel #28
0
 public async Task InsertMasterData(MasterDataModel model)
 {
     await masterDataCollection.InsertOneAsync(model);
 }
Beispiel #29
0
        private void detectStungbySpellBeeSmell(MasterDataModel dataModel)
        {
            StungbySpellBeeSmellDetector detector = new StungbySpellBeeSmellDetector(dataModel);

            smellsList.AddRange(detector.detect());
        }
Beispiel #30
0
        private void detectSubSubBulletSmell(MasterDataModel dataModel)
        {
            SubSubBulletSmellDetector detector = new SubSubBulletSmellDetector(dataModel);

            smellsList.AddRange(detector.detect());
        }