public IActionResult Get(int id) { // Check if the data matches the Model if (!ModelState.IsValid) { // check if null, return 404 if true return(BadRequest(ModelState)); } // Check DB to ensure referenced tables exist try { TripType TripType = _context.TripType.Single(c => c.TripTypeId == id); if (TripType == null) { // Return 404 if null return(NotFound()); } return(Ok(TripType)); // Catch statement return 404 for some reason } catch (System.InvalidOperationException) { return(NotFound()); } }
//Add Data From Linked Tables for Display public void EditGroupForDisplay(ClientDetail group) { TripTypeRepository tripTypeRepository = new TripTypeRepository(); TripType tripType = new TripType(); tripType = tripTypeRepository.GetTripType(group.TripTypeId); if (tripType != null) { group.TripType = tripType.TripTypeDescription; } HierarchyRepository hierarchyRepository = new HierarchyRepository(); fnDesktopDataAdmin_SelectClientDetailHierarchy_v1Result hierarchy = new fnDesktopDataAdmin_SelectClientDetailHierarchy_v1Result(); hierarchy = GetGroupHierarchy(group.ClientDetailId); group.HierarchyType = hierarchy.HierarchyType; group.HierarchyCode = hierarchy.HierarchyCode.ToString(); group.HierarchyItem = hierarchy.HierarchyName.Trim(); group.SourceSystemCode = hierarchy.SourceSystemCode; group.ClientDetailName = Regex.Replace(group.ClientDetailName, @"[^\w\s\-()*]", "-"); if (hierarchy.HierarchyType == "ClientSubUnitTravelerType") { group.ClientSubUnitGuid = hierarchy.HierarchyCode.ToString(); group.ClientSubUnitName = hierarchy.HierarchyName.Trim(); group.TravelerTypeGuid = hierarchy.TravelerTypeGuid; group.TravelerTypeName = hierarchy.TravelerTypeName.Trim(); } }
public IActionResult Post([FromBody] TripType TripType) { // check to see if data matches the Model if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // add TripType to the table _context.TripType.Add(TripType); // Save the changes try { _context.SaveChanges(); // Error statement } catch (DbUpdateException) { if (TripTypeExists(TripType.TripTypeId)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } // Return created TripType method: return(CreatedAtRoute("GetSingleTripType", new { id = TripType.TripTypeId }, TripType)); }
public static Query GetSample(TripType tripType = TripType.OneWay) { return(new Query() { adult = 1, departureAirportId = 35248, //lagos nigeria arrivalAirportId = 34277, //jfk, new york departingDate = DateTime.Now.AddDays(4).ToString("dd/MM/yyyy"), returningDate = DateTime.Now.AddDays(8).ToString("dd/MM/yyyy"), flightClass = "economy", tripType = (int)tripType, multiTrip = (new Models.TrvBeta.Query.Trip[] { new Models.TrvBeta.Query.Trip() { arrivalAirportId = 34277, //jfk departureAirportId = 35248, //lagos departingDate = DateTime.Now.AddDays(4).ToString("dd/MM/yyyy") }, new Models.TrvBeta.Query.Trip() { arrivalAirportId = 34979, //los angeles departureAirportId = 34277, //jfk departingDate = DateTime.Now.AddDays(8).ToString("dd/MM/yyyy") } }).ToList() }); }
public Entry(TripType tripType) { TripType = tripType; StartStop = tripType.StopEntries.First().Stop; EndStop = tripType.StopEntries.Last().Stop; AddRange(tripType.StopEntries.Select(e => e.Stop)); }
protected override void ItemShowing() { TripType ct = UpdatingItem as TripType; txtName.Text = ct.Name; txtMemo.Text = ct.Memo; }
public TripField(string name, TripType type, long identifier, Required required) { Name = Enforce.IsNotNull<string>(name, "name"); Type = Enforce.IsNotNull<TripType>(type, "type"); Identifier = identifier; Required = required; }
public IActionResult Put(int id, [FromBody] TripType TripType) { // Check to see if the data matches the model if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // Check for id match, if true, update the table if (id != TripType.TripTypeId) { // return 404 return(BadRequest()); } // update table method _context.TripType.Update(TripType); try { // save changes _context.SaveChanges(); } // Error message for something .net catch (DbUpdateConcurrencyException) { if (!TripTypeExists(id)) { return(NotFound()); } else { throw; } } return(new StatusCodeResult(StatusCodes.Status204NoContent)); }
private void CalculateTripBackTrackingImplementation(int start, TripType type) { _currentCost = 0; _bestCost = MaxTripSentry; _currentPath = new int[Coordinates.Count]; _visitTracks = new bool[Coordinates.Count]; _min = new double[Coordinates.Count]; for (int i = 0; i < Coordinates.Count; i++) { _min[i] = GetMinDistance(i); } _minCost = _min.Sum(); if (type == TripType.AZ) { _minCost -= _min[start]; } _currentPath[0] = start; _visitTracks[start] = true; BackTrackingVisit(1); }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { TripType TripType = item as TripType; row.Tag = TripType; row.Cells["colName"].Value = TripType.Name; row.Cells["colMemo"].Value = TripType.Memo; }
public Trip(TripType type, Line line, Train train, Station[] stations, DateTime startTime) { Type = type; Line = line; Train = train; this.stations.AddRange(stations); this.StartTime = startTime; }
public Outing(TripType tripType, int attendanceNumber, DateTime tripDate, decimal costPP, decimal costOfEvent) { TypeOfTrip = tripType; AttendanceNumber = attendanceNumber; TripDate = tripDate; CostPP = costPP; CostOfEvent = costOfEvent; }
public Parameters(float isk, float cargoSpace, string startingSystem, TripType trip, int accountingLevel) { this.isk = isk; this.cargoSpace = cargoSpace; this.startingSystem = startingSystem; this.trip = trip; taxRate = 0.01f - (accountingLevel * 0.001f); }
public Trip(Location From, Location To, DateTime TravelDateTime, TripType type, TripInformation tripInfo) { this.From = From; this.To = To; this.TravelDateTime = TravelDateTime; this.Type = type; this.TripInformation = tripInfo; }
public ActionResult BookGroupTrip(GroupTripModel groupTripModel) { if (!SessionManager.userIsLoggedIn()) { return(new HttpStatusCodeResult(403)); } if (ModelState.IsValid) { Route route = BL.MainClass.Instance.getRoutes().Find(v => v.id == groupTripModel.routeId); TripType triptype = BL.MainClass.Instance.getTripTypes().Find(v => v.id == groupTripModel.tripTypeId); Ship ship = BL.MainClass.Instance.getShips().Find(v => v.id == groupTripModel.shipTypeId); // Select dummy price categories because of project finish time reasons PriceCategory children = MainClass.Instance.getPriceCategories().Find(v => v.name == "Children"); if (children == null) { BL.PersonCategory pc = new BL.PersonCategory("Children"); MainClass.Instance.addPersonCategory(pc); MainClass.Instance.addPriceCategory(new BL.PriceCategory("Children", triptype, pc, 4, route)); } PriceCategory adults = MainClass.Instance.getPriceCategories().Find(v => v.name == "Adults"); if (adults == null) { BL.PersonCategory pc = new BL.PersonCategory("Adults"); MainClass.Instance.addPersonCategory(pc); MainClass.Instance.addPriceCategory(new BL.PriceCategory("Adults", triptype, pc, 7, route)); } BL.GroupTrip groupTrip = new GroupTrip(route, groupTripModel.depatureTime, triptype, ship); groupTrip.setPersonsOnBoard(children, groupTripModel.children); groupTrip.setPersonsOnBoard(adults, groupTripModel.adults); if (MainClass.Instance.canOrderGroupTrip(groupTrip)) { groupTripModel.totalPrice = groupTrip.getTotalPrice(); groupTripModel.ship = ship; groupTripModel.tripType = triptype; groupTripModel.route = route; groupTripModel.finalGroupTrip = groupTrip; groupTripModel.routeName = route.getRouteString(); groupTripModel.adultPrice = adults.price; groupTripModel.childPrice = children.price; groupTripModel.driveTimeMinutes = (int)groupTrip.getTotalDriveTimeMinutes(); groupTripModel.returnTime = groupTrip.returnTime; System.Web.HttpContext.Current.Session["groupTrip"] = groupTripModel; return(RedirectToAction("OrderGroupTrip", "Trip")); } } ViewBag.Status = false; ViewBag.Message = "Group trip can not be ordered. Please make sure you enter the correct depature time " + "and number of persons not bigger than the capacity according to the price category."; return(initialGroupTripView()); }
//Add Data From Linked Tables for Display public void EditGroupForDisplay(GDSAdditionalEntry group) { TripTypeRepository tripTypeRepository = new TripTypeRepository(); TripType tripType = new TripType(); tripType = tripTypeRepository.GetTripType(group.TripTypeId); if (tripType != null) { group.TripType = tripType.TripTypeDescription; } GDSRepository gDSRepository = new GDSRepository(); GDS gds = new GDS(); gds = gDSRepository.GetGDS(group.GDSCode); if (gds != null) { group.GDSName = gds.GDSName; } SubProductRepository subProductRepository = new SubProductRepository(); SubProduct subProduct = new SubProduct(); subProduct = subProductRepository.GetSubProduct(group.SubProductId); if (subProduct != null) { group.SubProductName = subProduct.SubProductName; Product product = new Product(); product = subProductRepository.GetSubProductProduct(group.SubProductId); group.ProductId = product.ProductId; group.ProductName = product.ProductName; } HierarchyRepository hierarchyRepository = new HierarchyRepository(); fnDesktopDataAdmin_SelectGDSAdditionalEntryHierarchy_v1Result hierarchy = new fnDesktopDataAdmin_SelectGDSAdditionalEntryHierarchy_v1Result(); hierarchy = GetGroupHierarchy(group.GDSAdditionalEntryId); group.GDSAdditionalEntryValue = Regex.Replace(group.GDSAdditionalEntryValue, @"[^\w\-()*]", "-"); if (hierarchy != null) { group.HierarchyType = hierarchy.HierarchyType; group.HierarchyCode = hierarchy.HierarchyCode.ToString(); group.HierarchyItem = hierarchy.HierarchyName.Trim(); if (hierarchy.HierarchyType == "ClientSubUnitTravelerType") { group.ClientSubUnitGuid = hierarchy.HierarchyCode.ToString(); group.ClientSubUnitName = hierarchy.HierarchyName.Trim(); group.TravelerTypeGuid = hierarchy.TravelerTypeGuid; group.TravelerTypeName = hierarchy.TravelerTypeName.Trim(); } } }
public Ticket(string SerialNumber, Trip TicketTrip, string TicketType, TripType tripType, double Price, int NumberOfSeats) { this.SerialNumber = SerialNumber; this.CurrentTrip = TicketTrip; this.TicketType = TicketType; this.TripType = tripType; this.Price = Price; this.NumberOfSeats = NumberOfSeats; }
public async Task <TripAdditionalInfoDTO> GetTripAdditionalInfo(int tripId) { using (_unitOfWork) { TripType tripType = await _unitOfWork.TripRepository.GetTripTripType(tripId); return(_mapper.Map <TripType, TripAdditionalInfoDTO>(tripType)); } }
public ActionResult Edit(int id, FormCollection collection) { //Get TripType TripType tripType = new TripType(); tripType = tripTypeRepository.GetTripType(id); if (tripType == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Update Item from Form try { UpdateModel(tripType); } catch { string n = ""; foreach (ModelState modelState in ViewData.ModelState.Values) { foreach (ModelError error in modelState.Errors) { n += error.ErrorMessage; } } ViewData["Message"] = "ValidationError : " + n; return(View("Error")); } //Database Update try { tripType.VersionNumber = Int32.Parse(collection["VersionNumber"]); tripTypeRepository.Update(tripType); } catch (SqlException ex) { //Versioning Error - go to standard versionError page if (ex.Message == "SQLVersioningError") { ViewData["ReturnURL"] = "/TripType.mvc/Edit/" + id.ToString(); return(View("VersionError")); } LogRepository logRepository = new LogRepository(); logRepository.LogError(ex.Message); ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details"; return(View("Error")); } return(RedirectToAction("List")); }
private void AddOuting() { Console.WriteLine("Enter the number of what you are you making.\n " + "1. Golf\n " + "2. Bowling\n " + "3. Amusement Park\n " + "4. Concert "); int ttCapture = ParseInput(); //TripType tripType = (TripType)ttCapture; //Alternative to Switch case, this is casting. TripType tripType = TripType.Golf; switch (ttCapture) { case 1: tripType = TripType.Golf; break; case 2: tripType = TripType.Bowling; break; case 3: tripType = TripType.Amusement; break; case 4: tripType = TripType.Concert; break; default: break; } Console.WriteLine($"How many people are attending the {tripType}?"); int attendanceNumber = int.Parse(Console.ReadLine()); Console.WriteLine($"What is the date of the trip in mm/dd/yyyy??"); DateTime tripDate = DateTime.Parse(Console.ReadLine()); Console.WriteLine("What is the cost per person?"); decimal costPP = decimal.Parse(Console.ReadLine()); //Cost of Event Console.WriteLine("Press Enter to calculat the Cost of the Event."); decimal costOfEvent = attendanceNumber * costPP; //the line below represents sending two variables to the CalculatorCost method (that's in repo), that method returns to the local orderCost variable. //decimal orderCost = _outingRepo.CalculateAllOutings(tripType, attendanceNumber); Outing outing = new Outing(tripType, attendanceNumber, tripDate, costPP, costOfEvent); _outingRepo.AddToList(outing); Console.ReadKey(); }
//Add a TripType public void Add(TripType tripType) { string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0]; db.spDesktopDataAdmin_InsertTripType_v1( tripType.TripTypeDescription, tripType.BackOfficeTripTypeCode, adminUserGuid ); }
//Delete a TripType public void Delete(TripType tripType) { string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0]; db.spDesktopDataAdmin_DeleteTripType_v1( tripType.TripTypeId, adminUserGuid, tripType.VersionNumber ); }
//Add Data From Linked Tables for Display public void EditGroupForDisplay(CommissionableRouteGroup group) { TripTypeRepository tripTypeRepository = new TripTypeRepository(); TripType tripType = new TripType(); tripType = tripTypeRepository.GetTripType(group.TripTypeId); if (tripType != null) { group.TripType = tripType; } group.CommissionableRouteGroupName = Regex.Replace(group.CommissionableRouteGroupName, @"[^\w\-()*]", "-"); List <fnDesktopDataAdmin_SelectCommissionableRouteGroupHierarchy_v1Result> hierarchy = new List <fnDesktopDataAdmin_SelectCommissionableRouteGroupHierarchy_v1Result>(); hierarchy = GetGroupHierarchy(group.CommissionableRouteGroupId); if (hierarchy.Count > 0) { HierarchyRepository hierarchyRepository = new HierarchyRepository(); HierarchyGroup hierarchyGroup = hierarchyRepository.GetHierarchyGroup( hierarchy[0].HierarchyType ?? "", hierarchy[0].HierarchyCode ?? "", hierarchy[0].HierarchyName ?? "", hierarchy[0].TravelerTypeGuid ?? "", hierarchy[0].TravelerTypeName ?? "", hierarchy[0].SourceSystemCode ?? "" ); if (hierarchyGroup != null) { group.HierarchyType = hierarchyGroup.HierarchyType; group.HierarchyCode = hierarchyGroup.HierarchyCode; group.HierarchyItem = hierarchyGroup.HierarchyItem; group.ClientSubUnitGuid = hierarchyGroup.ClientSubUnitGuid; group.ClientSubUnitName = hierarchyGroup.ClientSubUnitName; group.TravelerTypeGuid = hierarchyGroup.TravelerTypeGuid; group.TravelerTypeName = hierarchyGroup.TravelerTypeName; group.ClientTopUnitName = hierarchyGroup.ClientTopUnitName; group.SourceSystemCode = hierarchyGroup.SourceSystemCode; } } if (hierarchy.Count > 1) { group.IsMultipleHierarchy = true; group.HierarchyType = "Multiple"; group.HierarchyItem = "Multiple"; group.HierarchyCode = "Multiple"; } else { group.IsMultipleHierarchy = false; } }
public static string GetDescription(this TripType type) { switch (type) { case TripType.Transfer: return("Перегонный"); default: return(""); } }
private static void Transactions() { //created a command Command.CommandText = "select * from Transactions"; Reader = Command.ExecuteReader(); while (Reader.Read()) { string SerialNumber = (string)Reader["SerialNumber"]; string CustomerId = (string)Reader["CustomerId"]; string TripId = (string)Reader["TripId"]; string TypeOfTicket = (string)Reader["TypeOfTicket"]; string TypeOfTrip = (string)Reader["TypeOfTrip"]; double Price = (double)Reader["Price"]; int NumberOfSeats = (int)Reader["NumberOfSeats"]; Customer CurrentCustomer = SelectCustomer(CustomerId); Trip CurrentTrip = SelectTrip(TripId); if (CurrentCustomer == null || CurrentTrip == null) { continue; } //gets typeoftrip TripType tripType = null; if (TypeOfTrip == "Family") { tripType = new Family(); } else if (TypeOfTrip == "Couple") { tripType = new Couple(); } else if (TypeOfTrip == "General") { tripType = new General(); } else if (TypeOfTrip == "Lonely") { tripType = new Lonely(); } else if (TypeOfTrip == "Friends") { tripType = new Friends(); } Ticket CurrentTicket = new Ticket(SerialNumber, CurrentTrip, TypeOfTicket, tripType, Price, NumberOfSeats); CurrentCustomer.AddTicket(CurrentTicket); CurrentTrip.AddTicket(CurrentTicket); } Reader.Close(); return; }
public GenType ConvertToGenType(TripType tripType) { foreach (var converter in converters) { if (converter.Accept(tripType)) { return converter.ConvertToGenType(tripType); } } throw new ArgumentException(string.Format("Trip type {0} is unknown!", tripType)); }
//Edit a TripType public void Update(TripType tripType) { string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0]; db.spDesktopDataAdmin_UpdateTripType_v1( tripType.TripTypeId, tripType.TripTypeDescription, tripType.BackOfficeTripTypeCode, adminUserGuid, tripType.VersionNumber ); }
protected override Object GetItemFromInput() { TripType ct = UpdatingItem as TripType; if (IsAdding) { ct = new TripType(); ct.ID = txtName.Text; } ct.Name = txtName.Text; ct.Memo = txtMemo.Text; return(ct); }
public async Task <TripAdditionalInfoDTO> AddItemToPackingList(int tripId, TripStandardListItemDTO item) { using (_unitOfWork) { TripType tripType = await _unitOfWork.TripRepository.GetTripTripType(tripId); tripType.StandardList += "_" + item.item; _unitOfWork.TripTypeRepository.Update(tripType); await _unitOfWork.Save(); return(_mapper.Map <TripType, TripAdditionalInfoDTO>(tripType)); } }
public CommandResult Update(TripType info) { TripType original = ProviderFactory.Create <ITripTypeProvider>(_RepoUri).GetByID(info.ID).QueryObject; if (original != null) { return(ProviderFactory.Create <ITripTypeProvider>(_RepoUri).Update(info, original)); } else { return(new CommandResult(ResultCode.NoRecord, ResultCodeDecription.GetDescription(ResultCode.NoRecord))); } }
// GET: /Create public ActionResult Create() { //Set Access Rights ViewData["Access"] = ""; if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TripType tripType = new TripType(); return(View(tripType)); }
// GET: /View public ActionResult Edit(int id) { QueueMinderGroup queueMinderGroup = new QueueMinderGroup(); queueMinderGroup = queueMinderGroupRepository.GetGroup(id); //Check Exists if (queueMinderGroup == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToQueueMinderGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } if (queueMinderGroup.TripTypeId == null) { TripType tripType = new TripType(); queueMinderGroup.TripType = tripType; } QueueMinderGroupVM queueMinderGroupVM = new QueueMinderGroupVM(); queueMinderGroupRepository.EditGroupForDisplay(queueMinderGroup); queueMinderGroupVM.QueueMinderGroup = queueMinderGroup; TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); queueMinderGroupVM.TripTypes = tripTypesList; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); queueMinderGroupVM.HierarchyTypes = hierarchyTypesList; //Meetings MeetingRepository meetingRepository = new MeetingRepository(); List <Meeting> meetings = meetingRepository.GetAvailableMeetings(queueMinderGroup.HierarchyType, queueMinderGroup.HierarchyCode, null, queueMinderGroup.SourceSystemCode, queueMinderGroup.TravelerTypeGuid); SelectList meetingsList = new SelectList(meetings.ToList(), "MeetingID", "MeetingDisplayName", queueMinderGroup.MeetingID != null ? queueMinderGroup.MeetingID.ToString() : ""); ViewData["Meetings"] = meetingsList; return(View(queueMinderGroupVM)); }
private void VisitTripType(TripType tripType) { if (tripType is IdentifierType) { Visit((IdentifierType)tripType); } else if (tripType is BaseType) { Visit((BaseType)tripType); } else if (tripType is SetType) { Visit((SetType)tripType); } else if (tripType is ListType) { Visit((ListType)tripType); } else if (tripType is MapType) { Visit((MapType)tripType); } }
public GenType ConvertToGenType(TripType type) { var javaTypeName = ConvertToString(type); var mapType = type as MapType; var genType = new GenType(GType.Map, javaTypeName); genType.KeyType = typeToJavaConverter.ConvertToGenType(mapType.KeyType); genType.KeyJavaTypeName = typeToJavaConverter.ConvertToString(mapType.KeyType); genType.ValueType = typeToJavaConverter.ConvertToGenType(mapType.ValueType); genType.ValueJavaTypeName = typeToJavaConverter.ConvertToString(mapType.ValueType); return genType; }
public GenType ConvertToGenType(TripType type) { var csharpTypeName = ConvertToString(type); var baseType = ((BaseType)type).BType; var gType = GTYPE_BASETYPE_MAP[baseType]; var genType = new GenType(gType, csharpTypeName); return genType; }
public string ConvertToString(TripType type) { var baseType = ((BaseType)type).BType; return CSHARP_PRIMITIVES_MAP[baseType]; }
public bool Accept(TripType type) { return type.GetType() == typeof(BaseType); }
public string ConvertToString(TripType type) { var javaType = this.FindJavaTypeFromIdentifierType((IdentifierType)type); return ShortenClassName(javaType.ClassName); }
public GenType ConvertToGenType(TripType type) { var javaTypeName = ConvertToString(type); var javaType = this.FindJavaTypeFromIdentifierType((IdentifierType)type); if (javaType.IsLeanEnum) { return new GenType(GType.Enum, javaTypeName); } else return new GenType(GType.Struct, javaTypeName); }
public GenType ConvertToGenType(TripType type) { var csharpTypeName = ConvertToString(type); var listType = type as ListType; var genType = new GenType(GType.List, csharpTypeName); genType.ElementType = typeToCSharpConverter.ConvertToGenType(listType.Type); genType.ElementCSharpTypeName = typeToCSharpConverter.ConvertToString(listType.Type); return genType; }
public string ConvertToString(TripType type) { var listType = type as ListType; string actualType = typeToCSharpConverter.ConvertToString(listType.Type); return "List<" + actualType + ">"; }
public string ConvertToString(TripType type) { var setType = type as SetType; string actualType = typeToCSharpConverter.ConvertToString(setType.Type); return "HashSet<" + actualType + ">"; }
public GenType ConvertToGenType(TripType type) { var csharpTypeName = ConvertToString(type); var csharpType = this.FindCSharpTypeFromIdentifierType((IdentifierType)type); if (csharpType.IsTripEnum) { return new GenType(GType.Enum, csharpTypeName); } else return new GenType(GType.Struct, csharpTypeName); }
public string ConvertToString(TripType type) { var csharpType = this.FindCSharpTypeFromIdentifierType((IdentifierType)type); var clzName = ShortenClassName(csharpType.TypeFullName); if (csharpType.IsTripEnum) clzName += "?"; return clzName; }
public bool Accept(TripType type) { return type.GetType() == typeof(IdentifierType); }
public string ConvertToString(TripType type) { var mapType = type as MapType; string actualKeyType = typeToJavaConverter.ConvertToString(mapType.KeyType); string actualValueType = typeToJavaConverter.ConvertToString(mapType.ValueType); return string.Format("Map<{0}, {1}>", actualKeyType, actualValueType); }
public GenType ConvertToGenType(TripType type) { var javaTypeName = ConvertToString(type); var listType = type as ListType; var genType = new GenType(GType.List, javaTypeName); genType.ElementType = typeToJavaConverter.ConvertToGenType(listType.Type); genType.ElementJavaTypeName = typeToJavaConverter.ConvertToString(listType.Type); return genType; }
public string ConvertToString(TripType type) { var mapType = type as MapType; string actualKeyType = typeToCSharpConverter.ConvertToString(mapType.KeyType); string actualValueType = typeToCSharpConverter.ConvertToString(mapType.ValueType); return string.Format("Dictionary<{0}, {1}>", actualKeyType, actualValueType); }
public GenType ConvertToGenType(TripType type) { var csharpTypeName = ConvertToString(type); var mapType = type as MapType; var genType = new GenType(GType.Map, csharpTypeName); genType.KeyType = typeToCSharpConverter.ConvertToGenType(mapType.KeyType); genType.KeyCSharpTypeName = typeToCSharpConverter.ConvertToString(mapType.KeyType); genType.ValueType = typeToCSharpConverter.ConvertToGenType(mapType.ValueType); genType.ValueCSharpTypeName = typeToCSharpConverter.ConvertToString(mapType.ValueType); return genType; }
public Parameters(float isk, float cargoSpace, string startingSystem, TripType trip): this(isk, cargoSpace, startingSystem, trip, 0) { }
public MapType(TripType keyType, TripType valueType) { KeyType = Enforce.IsNotNull<TripType>(keyType, "keyType"); ValueType = Enforce.IsNotNull<TripType>(valueType, "valueType"); }
public SetType(TripType type) { this.Type = Enforce.IsNotNull<TripType>(type, "type"); }