public void DeleteTechnologiesDetails(int id) { Technologies Technologies = _context.Technologies.Where(u => u.TechnologyID == id).FirstOrDefault(); _context.Technologies.Remove(Technologies); _context.SaveChanges(); }
public override Application CreateApplication() { Technologies.Add(new Java()); Technologies.Add(new Hibernate()); return(this); }
public Technologies Post(Technologies model) { model.Id = Guid.NewGuid(); var data2 = _repository.Insert(model); return(data2); }
private void FinaliseTechnology(Dictionary <string, float> techInvestment, Dictionary <string, List <string> > techOrder) { foreach (var tech in techInvestment) { Technologies.AddRange(techOrder[tech.Key].GetRange(0, Math.Max(0, (int)tech.Value))); } }
public async Task <ActionResult> Create(Technologies collection) { try { if (ModelState.IsValid) { // TODO: Add insert logic here if (collection.Id == Guid.Empty) { await APIHelpers.PostAsync <Technologies>("api/Technology/Post", collection); TempData["sucess"] = TechnologiesResources.create; } else { await APIHelpers.PutAsync <Technologies>("api/Technology/Put", collection); TempData["sucess"] = TechnologiesResources.update; } return(RedirectToAction("Index")); } else { return(View(collection)); } } catch (Exception ex) { TempData["error"] = CommonResources.error; return(RedirectToAction("AccessDenied", "Error")); } }
public void technologies_valid_method(string[] technos, bool expected) { Technologies technologies = new Technologies(); technologies.technologies = technos; Assert.That(technologies.isValid(), Is.EqualTo(expected)); }
public override Application CreateApplication() { Technologies.Add(new AspNetMvc()); Technologies.Add(new CSharp()); Technologies.Add(new SqlServer()); return(this); }
public async Task <IActionResult> AddTechnologies([FromBody] Technologies entity) { await _context.AddAsync(entity); await _context.SaveChangesAsync(); var newCreatedTech = _context.Technologies.FirstOrDefaultAsync(c => c.Id == entity.Id); return(Created("GetTechnologies", new { Id = newCreatedTech.Id })); }
public void SaveTechnologiesDetails(Technologies objTechnologies) { try { _context.Technologies.Add(objTechnologies); _context.SaveChanges(); } catch (Exception ex) { throw ex; } }
public ActionResult DeleteTech(int TechId) { Technologies model = new Technologies(); using (EmpDbContext Techdb = new EmpDbContext()) { Technologies techlist = Techdb.Technologies.SingleOrDefault(x => x.TechId == TechId); techlist.Checkstatus = "N"; Techdb.SaveChanges(); } return(RedirectToAction("Index", "Technology")); }
public PdxSublist GetHistoryCountryFile(Vic2World world) { var data = new PdxSublist(null); data.AddValue("capital", Capital.ToString()); data.AddValue("primary_culture", PrimaryCulture); AcceptedCultures.ForEach(c => data.AddValue("culture", c)); data.AddValue("religion", Religion); data.AddValue("government", Government); data.AddValue("plurality", Plurality.ToString()); if (NationalValues != null) { data.AddValue("nationalvalue", NationalValues.Value); } data.AddValue("literacy", Literacy.ToString()); data.AddValue("civilized", IsCivilised ? "yes" : "no"); data.AddValue("prestige", Prestige.ToString()); if (Reforms != null) { Reforms.AddData(data); } if (Technologies != null) { Technologies.ForEach(t => data.AddValue(t, "1")); } data.AddValue("consciousness", Consciousness.ToString()); // todo data.AddValue("nonstate_consciousness", (Consciousness / 3).ToString()); if (RulingParty != null) { data.AddValue("ruling_party", RulingParty.Name); } data.AddDate("last_election", LastElection); if (UpperHouse != null) { data.AddSublist("upper_house", UpperHouse.GetData(data)); } if (TechSchools != null) { data.AddValue("schools", Enum.GetName(typeof(TechSchool), TechSchools.TechSchool)); } if (FemaleLeaders && (Reforms.vote_franschise == vote_franschise.universal_voting || Reforms.vote_franschise == vote_franschise.universal_weighted_voting)) { var entry = new PdxSublist(); entry.AddValue("decision", "enact_female_suffrage"); data.AddSublist(world.StartDate, entry); } return(data); }
public void UpdateTechnologiesDetails(Technologies objTechnologies) { try { Technologies Technologies = _context.Technologies.Where(u => u.TechnologyID == objTechnologies.TechnologyID).FirstOrDefault(); Technologies.TechnologyName = objTechnologies.TechnologyName; _context.SaveChanges(); } catch (Exception ex) { throw ex; } }
public IHttpActionResult DeleteTechnologies(int id) { Technologies technologies = db.Technologies.Find(id); if (technologies == null) { return(NotFound()); } db.Technologies.Remove(technologies); db.SaveChanges(); return(Ok(technologies)); }
private Technology GetTechnology(Technologies choice) { switch (choice) { case Technologies.Empty: return(null); case Technologies.PopulationGrowth: return(new PopulationGrowthTechnology(1)); default: throw new ArgumentException("Incorrect argument: no such technology"); } }
public HttpResponseMessage SaveTechnologiesDetails([FromBody] Technologies objTechnologies) { try { _technologiesService.SaveTechnologiesDetails(objTechnologies); var message = new HttpResponseMessage(HttpStatusCode.Created); return(message); } catch (Exception ex) { var message = new HttpResponseMessage(HttpStatusCode.BadRequest); return(message); } }
public ActionResult AddEditTechnology(Technologies technologies) { if (Session["EmpName"] != null) { if (ModelState.IsValid) { try { using (EmpDbContext Techdb = new EmpDbContext()) { if (technologies.TechId > 0) { //update Technologies techlist = Techdb.Technologies.SingleOrDefault(x => x.TechId == technologies.TechId); techlist.Technology = technologies.Technology; techlist.Description = technologies.Description; Techdb.SaveChanges(); } else { //Insert //Technologies techins = new Technologies(); //techins.Technology = technologies.Technology; //techins.Description = technologies.Description; technologies.Checkstatus = "Y"; Techdb.Technologies.Add(technologies); Techdb.SaveChanges(); } } ModelState.Clear(); return(RedirectToAction("Index", technologies)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Technology", "Index"))); } } return(RedirectToAction("AddEditTechnology", technologies.TechId)); } else { return(RedirectToAction("Index", "Home")); } }
public ActionResult AddEditTechnology(int TechID) { Technologies model = new Technologies(); using (EmpDbContext Techdb = new EmpDbContext()) { if (TechID > 0) { Technologies techlist = Techdb.Technologies.SingleOrDefault(x => x.TechId == TechID); model.TechId = techlist.TechId; model.Technology = techlist.Technology; model.Description = techlist.Description; } } return(PartialView("_Create", model)); }
public TechnologiesViewModel(Technologies model) { this.CurrentlyResearching = model.CurrentlyResearching.ToString(); this.EndTime = model.EndTime; this.StartTime = model.StartTime; if (model.EndTime.HasValue) { var mins = model.EndTime.Value - DateTime.Now; this.MinutesLeftToResearch = mins.TotalMinutes; var totalTime = model.EndTime.Value - model.StartTime.Value; var totalSegments = totalTime.TotalMinutes / 100; var percents = 100 - (this.MinutesLeftToResearch / totalSegments); this.PercentsResearched = percents; } }
public IHttpActionResult PostTechnologies(Technologies technologies) { db.Technologies.Add(technologies); try { db.SaveChanges(); } catch (DbUpdateException) { if (TechnologiesExists(technologies.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = technologies.ID }, technologies)); }
private static void ReadFromFile(string path, Technologies techs) { var profs = File.ReadAllLines(path); foreach (var p in profs) { var item = new TechnologyItem(); if (p.EndsWith("g")) { item.Technology = p.Substring(0, p.Length - 1); item.isBold = true; item.isMerged = true; item.Color = 10079487; } else { item.Technology = p; } item.Technology = item.Technology.Trim(); techs.TechnologyList.Add(item); } }
public override void HandleComponentState(ComponentState?curState, ComponentState?nextState) { base.HandleComponentState(curState, nextState); if (curState is not TechnologyDatabaseState state) { return; } Technologies.Clear(); var protoManager = IoCManager.Resolve <IPrototypeManager>(); foreach (var techID in state.Technologies) { if (!protoManager.TryIndex(techID, out TechnologyPrototype? technology)) { continue; } Technologies.Add(technology); } OnDatabaseUpdated?.Invoke(); }
public IHttpActionResult PutTechnologies(int id, Technologies technologies) { if (id != technologies.ID) { return(BadRequest()); } string procedure = ""; int number; string connectionString = @"Data Source=DESKTOP-RDKB255\SQLEXPRESS;Initial Catalog=articles;Integrated Security=True"; SqlConnection connection = new SqlConnection(connectionString); try { string commandStr = $"EXEC TechnologiesRating @id = '{technologies.ID}'," + $" @rating = '{technologies.Rating}'"; connection.Open(); SqlCommand command = new SqlCommand(commandStr, connection); number = command.ExecuteNonQuery(); } catch (SqlException ex) { return(BadRequest(ex.Message)); } finally { connection.Close(); } if (number != null) { return(Ok()); } return(null); }
public Technologies Put(Technologies model) { return(_repository.Update(model)); }
public TechnologiesViewModel(int researchCentreLevel, Technologies model) : this(model) { this.ResearchCentreLevel = researchCentreLevel; }
public void UpdateTechnologiesDetails([FromBody] Technologies objTechnologies) { _technologiesService.UpdateTechnologiesDetails(objTechnologies); }
public ActionResult Index(Technologies technologies) { return(View()); }
public object Convert(object value, Type targetType, object parameter, string language) { if (value != null) { StringBuilder pathToImage = new StringBuilder(); pathToImage.Append("Assets/TechIcons/"); Technologies tech = (Technologies)Enum.Parse(typeof(Technologies), value.ToString()); switch (tech) { case Technologies.Unknown: pathToImage.Append("unknown.png"); break; case Technologies.WebApp: pathToImage.Append("webapp.png"); break; case Technologies.WebSite: pathToImage.Append("website.png"); break; case Technologies.ApiApp: pathToImage.Append("api.png"); break; case Technologies.ConsoleApp: pathToImage.Append("consoleapp.png"); break; case Technologies.WinFormApp: pathToImage.Append("winform.png"); break; case Technologies.UwpApp: pathToImage.Append("uwpapp.png"); break; case Technologies.WpfApp: pathToImage.Append("wpfapp.png"); break; case Technologies.GeneralGuiApp: pathToImage.Append("generalguiapp.png"); break; case Technologies.Driver: pathToImage.Append("driverapp.png"); break; case Technologies.TestUnit: pathToImage.Append("testUnit.png"); break; case Technologies.IoT: pathToImage.Append("iotapp.png"); break; default: break; } return(pathToImage.ToString()); } else { return(null); } }
public Technology(Technologies tech) { currentTechnology = tech; }
public void Dispose() { foreach (var r in AbilityRules.ToArray()) { r.Dispose(); } foreach (var sos in StellarObjectSizes.ToArray()) { sos.Dispose(); } foreach (var x in StellarAbilityTemplates.ToArray()) { x.Dispose(); } foreach (var sot in StellarObjectTemplates.ToArray()) { sot.Dispose(); } foreach (var t in Traits.ToArray()) { t.Dispose(); } foreach (var t in Technologies.ToArray()) { t.Dispose(); } foreach (var f in FacilityTemplates.ToArray()) { f.Dispose(); } foreach (var h in Hulls.ToArray()) { h.Dispose(); } foreach (var c in ComponentTemplates.ToArray()) { c.Dispose(); } foreach (var m in Mounts.ToArray()) { m.Dispose(); } foreach (var sst in StarSystemTemplates.ToArray()) { sst.Dispose(); } foreach (var gt in GalaxyTemplates.ToArray()) { gt.Dispose(); } foreach (var h in HappinessModels.ToArray()) { h.Dispose(); } foreach (var c in Cultures.ToArray()) { c.Dispose(); } foreach (var ai in EmpireAIs.ToArray()) { ai.Dispose(); } if (this == Current) { Current = null; } }
public void addTechnology(string technology) { Technologies.Add(technology); }
public TechnologyChoice(Technologies technology) { this.technology = this.GetTechnology(technology); }
public void removeTechnology(string technology) { Technologies.Remove(technology); }