private DataTable GetTable(Guid orderId) { var dbContext = new SCMSEntities(); var orderDetail = dbContext.OrderRequests.First(r => r.Id == orderId); Model.OrderRequest myOrder = (Model.OrderRequest)orderDetail; Model.Currency currency = dbContext.Currencies.First(c => c.Id == myOrder.CurrencyId); Model.CountryProgramme prgm = dbContext.CountryProgrammes.First(p => p.Id == myOrder.CountryProgrammeId); Model.Project subP = dbContext.Projects.FirstOrDefault(p => p.Id == myOrder.ProjectId); Model.Donor donor = dbContext.ProjectDonors.First(d => d.Id == myOrder.ProjectDonorId).Donor; Model.Location reqDes = dbContext.Locations.First(l => l.Id == myOrder.RequestedDestinationId); Model.Location finDes = dbContext.Locations.First(l => l.Id == myOrder.FinalDestinationId); DataTable table = new DataTable(); table.Columns.Add("Order Request", typeof(string)); table.Columns.Add("Date", typeof(string)); table.Columns.Add("Currency of OR", typeof(string)); table.Rows.Add(myOrder.RefNumber, myOrder.OrderDate.Value.ToShortDateString(), currency.Name); table.Rows.Add("Program:", "Project:", "Donor"); table.Rows.Add(prgm.ProgrammeName, subP.Name, donor.Name); table.Rows.Add("Requested Delivery Date:", "Requested Delivery Destination:", "Final Delivery Destination:"); table.Rows.Add(myOrder.DeliveryDate.HasValue ? ((DateTime)myOrder.DeliveryDate).ToString("dd.MMM.yyyy") : "-", reqDes.Name, finDes.Name); return(table); // Return reference. }
public List <Person> Get() { List <Person> result = new List <Person>(); var name = new Model.Name { FirstName = "Alin Stefan", LastName = "Olaru" }; var location = new Model.Location { City = "City", Postcode = "Postcode", State = "State", Street = "Street" }; var user = new Person { Id = "xshteff", Name = name, Email = "*****@*****.**", Phone = "+45 12 34 56 78", Address = location, Picture = "https://avatars1.githubusercontent.com/u/9394141?s=460&v=4", Nationality = "RO", }; result.Add(user); return(result); }
/// <summary> /// Looks for an existing location model first by searching for a raw value, and then by the street, /// city, state, and zip of the specified location stub. If a match is not found, then a new location /// block is returned. /// </summary> /// <param name="location">The location.</param> /// <param name="personId">The person id.</param> /// <returns></returns> private Location GetByLocationDto(LocationDto location, int?personId) { string raw = location.Raw; Location locationModel = GetByRaw(raw); if (locationModel == null) { locationModel = GetByStreet1AndStreet2AndCityAndStateAndZip( location.Street1, location.Street2, location.City, location.State, location.Zip); } if (locationModel == null) { locationModel = new Model.Location(); locationModel.Raw = raw; locationModel.Street1 = location.Street1; locationModel.Street2 = location.Street2; locationModel.City = location.City; locationModel.State = location.State; locationModel.Zip = location.Zip; } return(locationModel); }
public void Read() { userCards = new List <Model.UserCard>(); SqlCommand command = new SqlCommand("select u.Id as Id, u.Name as Name," + "u.Surname as Surname, u.Cash as Cash," + "l.Name as Location, l.Zip as Zip from [dbo].[User] " + "u inner join [dbo].[Location] l on u.Id = l.UserId", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Model.User user = new Model.User(); user.Id = reader["Id"].ToString(); user.Name = reader["Name"].ToString(); user.Surname = reader["Surname"].ToString(); user.Cash = reader["Cash"].ToString(); Model.Location location = new Model.Location(); location.Name = reader["Location"].ToString(); location.UserId = reader["Id"].ToString(); location.Zip = reader["Zip"].ToString(); Model.UserCard userCard = new Model.UserCard(); userCard.UserInfo = user; userCard.LocationInfo = location; userCards.Add(userCard); } connection.Close(); }
void DatagridSelectedData(object sender, DataGridViewCellEventArgs e) { try { if (dgDetails.Rows.Count > 0) { if (oFindOption == FIND_OPTION.AUTHOR) { oMAuthor = new Model.Author(); oMAuthor.PERSON_ID = dgDetails.Rows[e.RowIndex].Cells[0].Value.ToString(); oMAuthor.FIRST_NAME = dgDetails.Rows[e.RowIndex].Cells[1].Value.ToString(); oMAuthor.MIDDLE_NAME = dgDetails.Rows[e.RowIndex].Cells[2].Value.ToString(); oMAuthor.LAST_NAME = dgDetails.Rows[e.RowIndex].Cells[3].Value.ToString(); oMAuthor.STATUS = dgDetails.Rows[e.RowIndex].Cells[4].Value.ToString(); } else if (oFindOption == FIND_OPTION.CATEGORY) { oMCategory = new Model.Category(); oMCategory.CATEGORY_ID = dgDetails.Rows[e.RowIndex].Cells[0].Value.ToString(); oMCategory.CATEGORY = dgDetails.Rows[e.RowIndex].Cells[1].Value.ToString(); oMCategory.STATUS = dgDetails.Rows[e.RowIndex].Cells[2].Value.ToString(); } else if (oFindOption == FIND_OPTION.LOCATION) { oMLocation = new Model.Location(); oMLocation.LOCATION_ID = dgDetails.Rows[e.RowIndex].Cells[0].Value.ToString(); oMLocation.LOCATION = dgDetails.Rows[e.RowIndex].Cells[1].Value.ToString(); oMLocation.STATUS = dgDetails.Rows[e.RowIndex].Cells[2].Value.ToString(); } } } catch (Exception ex) { } }
public async Task <int> GetWeatherId(Model.Location location) { var locationIsUnresolved = location.Longitude == 0 && location.Latitude == 0; if (locationIsUnresolved) { return(0); } var path = $"location/search/?lattlong={location.Latitude.ToString(NumberFormatInfo.InvariantInfo)},{location.Longitude.ToString(NumberFormatInfo.InvariantInfo)}"; HttpResponseMessage response; try { response = await HttpClient.GetAsync(path); } catch (HttpRequestException ex) { throw new HttpRequestException("GetWeatherId failed to connect to it's remote resource", ex); } response.EnsureSuccessStatusCode(); var obj = JsonConvert.DeserializeObject <List <WeatherId> >(await response.Content.ReadAsStringAsync()); return(obj.First().Woeid); }
public LoginVM() { User = new User(); _location = new Model.Location(); LoginCommand = new LoginCommand(this); SignUpCommand = new SignUpCommand(this); //LocationVM = new LocationVM(); //Called FIRST before location code behind }
public static Model.Location Mapper(DAL.Entities.Location _location) { var location = new Model.Location { Name = _location.Name, Woeid = _location.Woeid }; return(location); }
public static DAL.Entities.Location Mapper(Model.Location _location) { var location = new DAL.Entities.Location { Id = Guid.NewGuid(), Name = _location.Name, Woeid = _location.Woeid }; return(location); }
public static void Initialize(dbContext.Parking context) { Model.ParkingModel test = new Model.ParkingModel(12, 32); //Model.Parking te = new Model.Parking(100, "te", "test", "test", 51, 23, 44, 5, 14, 3, test); //te.id = 1; //context.parking.AddRange(te); Model.Location t = new Model.Location(12f, 125f); t.id = 245; context.location.AddRange(t); context.SaveChanges(); }
public IEnumerable<Model.Location> MyLocations(int myId) { Model.Location newLocation; try { List<Model.Location> locations = new List<Model.Location>(); using (HttpClient http = new HttpClient()) { var url = String.Format("http://localhost:50842/User/{0}/locations", myId); http.DefaultRequestHeaders.Accept.Add( new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); var response = http.GetAsync(url).Result; var result = response.Content.ReadAsStringAsync().Result; JArray locationsJson = JArray.Parse(result.ToString()); newLocation = new Model.Location(); string pontoString; foreach (JObject locationJson in locationsJson.Children()) { pontoString = locationJson["Point"]["Geography"]["WellKnownText"].ToString().Substring(7).Replace(')', ' ').Trim(); Geopoint point = new Geopoint(new BasicGeoposition { Latitude = float.Parse(pontoString.Split(' ')[1]), Longitude = float.Parse(pontoString.Split(' ')[0]), }); locations.Add( new Model.Location { Coordenadas = point, TitleName = locationJson["Title"].ToString() }); } } return locations; } // serialize JSON results into .NET objects catch (Exception e) { throw; } return null; }
public bool Get(Model.Location location) { try { string[] contentArr = null; if (location.LBS != null) { contentArr = location.LBS.Split('|'); } if ((contentArr != null) && (contentArr.Length > 0)) { foreach (var strArr in contentArr) { string[] str = strArr.Split(','); if ((str != null) && (str.Length == 5)) { string LbsStr = str[0] + "," + str[1] + "," + str[2] + "," + str[3]; const string sql = "select top 1 [YWLBS].* from [YWLBS] where [YWLBS].[MCC]=@MCC and [YWLBS].[MNC ]=@MNC and [YWLBS].[LAC]=@LAC and [YWLBS].[CID]=@CID order by UpdateTime desc"; DbParameter[] commandParameters = new DbParameter[] { Data.DBHelper.CreateInDbParameter("@MCC", DbType.String, str[0]), Data.DBHelper.CreateInDbParameter("@MNC", DbType.String, str[1]), Data.DBHelper.CreateInDbParameter("@LAC", DbType.String, str[2]), Data.DBHelper.CreateInDbParameter("@CID", DbType.String, str[3]), }; var ds = Data.DBHelper.GetInstance().ExecuteAdapter(Data.Config.GetInstance().DB_LBS, CommandType.Text, sql, commandParameters); var list = base.TableToList <Model.Entity.YWLBS>(ds); if (list.Count > 0) { location.Lat = (double)list[0].OLat; location.Lng = (double)list[0].OLng; location.Radius = 50; location.LocationType = 2; return(true); } } } } return(false); } catch (Exception ex) { Data.Logger.Error(ex); } return(false); }
public async Task <object> Measure ([FromBody] Model.Location location1, Model.Location location2) { object result; if (!ModelState.IsValid) { return(new { Error = ModelState.Errors() });; } result = await distanceMeasureDataProvider.MeasureDistance(location1, location2); return(result); }
public async Task <WeatherDto> GetWeather(Model.Location location) { var woeid = await _weatherDataAccessPoint.GetWeatherId(location); try { return(await _weatherDataAccessPoint.GetWeather(woeid)); } catch (WeatherNotFoundException ex) { ex.Data.Add("locationName", location.Name); throw; } }
public bool Get(Model.Location location) { try { string[] contentArr = null; if (location.WIFI != null) { contentArr = location.WIFI.Split('|'); } if ((contentArr != null) && (contentArr.Length > 0)) { foreach (var strArr in contentArr) { string[] str = strArr.Split(','); if ((str != null) && (str.Length == 3)) { const string sql = "select top 1 [WifiData].* from [WifiData] where [WifiData].[macAddress]=@macAddress order by UpdateTime desc"; DbParameter[] commandParameters = new DbParameter[] { Data.DBHelper.CreateInDbParameter("@macAddress", DbType.String, str[0]), }; var ds = Data.DBHelper.GetInstance().ExecuteAdapter(Data.Config.GetInstance().DB_LBS, CommandType.Text, sql, commandParameters); var list = base.TableToList <Model.Entity.WifiData>(ds); if (list.Count > 0) { location.Lat = (double)list[0].latitude; location.Lng = (double)list[0].longitude; location.Radius = list[0].accuracy; location.LocationType = 3; return(true); } } } } return(false); } catch (Exception ex) { Data.Logger.Error(ex); } return(false); }
public string Create(Model.User user, Model.Location location) { string msg = "Created!"; Model.UserCard userCard = new Model.UserCard(); userCard.LocationInfo = location; userCard.UserInfo = user; SaveToMemory(userCard); dataHub.Create(userCard); msg = string.Format("{0} Now we have {1} items", msg, dataHub.Count() + 1); return(msg); }
public IEnumerable <Model.Location> MyLocations(int myId) { Model.Location newLocation; try { List <Model.Location> locations = new List <Model.Location>(); using (HttpClient http = new HttpClient()) { var url = String.Format("http://localhost:50842/User/{0}/locations", myId); http.DefaultRequestHeaders.Accept.Add( new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); var response = http.GetAsync(url).Result; var result = response.Content.ReadAsStringAsync().Result; JArray locationsJson = JArray.Parse(result.ToString()); newLocation = new Model.Location(); string pontoString; foreach (JObject locationJson in locationsJson.Children()) { pontoString = locationJson["Point"]["Geography"]["WellKnownText"].ToString().Substring(7).Replace(')', ' ').Trim(); Geopoint point = new Geopoint(new BasicGeoposition { Latitude = float.Parse(pontoString.Split(' ')[1]), Longitude = float.Parse(pontoString.Split(' ')[0]), }); locations.Add( new Model.Location { Coordenadas = point, TitleName = locationJson["Title"].ToString() }); } } return(locations); } // serialize JSON results into .NET objects catch (Exception e) { throw; } return(null); }
public async Task <List <Person> > LoadNewUsers(int count, string nationalities) { var users = new List <Person>(); using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://randomuser.me/"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = await client.GetAsync($"api/?nat={nationalities}&inc=name,phone,email,location,picture,login,nat&results={count}"); if (response.IsSuccessStatusCode) { string json = await response.Content.ReadAsStringAsync(); var userResponse = JsonConvert.DeserializeObject <RootObject>(json); foreach (var randomUser in userResponse.Results) { var name = new Model.Name { FirstName = randomUser.Name.First.FirstToUpper(), LastName = randomUser.Name.Last.FirstToUpper() }; var location = new Model.Location { City = randomUser.Location.City.FirstToUpper(), Postcode = randomUser.Location.Postcode, State = randomUser.Location.State.FirstToUpper(), Street = randomUser.Location.Street.Name.FirstToUpper() }; var user = new Person { Id = randomUser.Login.Username, Name = name, Email = randomUser.Email, Phone = randomUser.Phone, Address = location, Picture = randomUser.Picture.Large, Nationality = randomUser.Nat, }; users.Add(user); } } } return(users); }
public async Task Seed() { Uri generatorUri = new Uri(configuration.GeneratorSiteURI); var client = new WebClient(); string data = await client.DownloadStringTaskAsync(generatorUri.AbsoluteUri); var rs = JsonConvert.DeserializeObject <RootObject>(data); if (rs.Results.Count != 0) { foreach (var i in rs.Results) { Model.User user = new Model.User { Gender = i.Gender, Name = i.Name.Title + " " + i.Name.First + " " + i.Name.Last, Email = i.Email, BirthDate = i.Dob.Date, Uuid = i.Login.Uuid, UserName = i.Login.Username, Age = i.Dob.Age, }; context.Users.Add(user); Model.Location location = new Model.Location { UserId = user.UserId, State = i.Location.State, Street = i.Location.Street, City = i.Location.City, PostCode = i.Location.Postcode }; context.Locations.Add(location); await context.SaveChangesAsync(); } } else { throw new NotImplementedException(); } }
private void btnSave_Click(object sender, EventArgs e) { oMLocation = new Model.Location(); oLocation = new DataAccess.Location(); if (eVariable.IsFieldEmpty(pnlBody)) { oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.ALL_FIELDS_ARE_REQUIRED.ToString().Replace("_", " ")); oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } if (eVariable.m_ActionType == eVariable.ACTION_TYPE.EDIT) { oMLocation.LOCATION_ID = eVariable.sUniqueID; oMLocation.LOCATION = txtLocation.Text; oMLocation.STATUS = chkActive.Checked == true ? "ACTIVE" : "INACTIVE"; oLocation.UpdateCategory(oMLocation); } else { oMLocation.LOCATION = txtLocation.Text; oMLocation.STATUS = chkActive.Checked == true ? "ACTIVE" : "INACTIVE"; if (oLocation.isRecordExists(oMLocation)) { oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.RECORD_IS_ALREADY_EXISTS.ToString().Replace("_", " ")); oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } oLocation.InsertLocation(oMLocation); } oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.RECORD_HAS_BEEN_SUCESSFULLY_SAVED.ToString().Replace("_", " ")); oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); eVariable.ClearText(pnlBody); LoadLocation(); }
public async void findMeGps(object parametar) { Geoposition pos = null; var accessStatus = await Geolocator.RequestAccessAsync(); if (accessStatus == GeolocationAccessStatus.Allowed) { Geolocator geolocator = new Geolocator { DesiredAccuracyInMeters = 10 }; pos = await geolocator.GetGeopositionAsync(); } TrenutnaLokacija = pos.Coordinate.Point; var lc = new Model.Location { x = (float)trenutnaLokacija.Position.Latitude, y = (float)trenutnaLokacija.Position.Longitude }; /*MapLocationFinderResult result = await * MapLocationFinder.FindLocationsAtAsync(pos.Coordinate.Point); * if (result.Status == MapLocationFinderStatus.Success) * { * Adresa = "Adresa je " + result.Locations[0].Address.Street; * }*/ MapIcon mapIcon = new MapIcon(); BasicGeoposition snPosition = new BasicGeoposition() { Latitude = trenutnaLokacija.Position.Latitude, Longitude = trenutnaLokacija.Position.Longitude }; mapIcon.Location = new Geopoint(snPosition); mapIcon.NormalizedAnchorPoint = new Point(0.5, 1.0); mapIcon.Title = "I'm here!"; mapIcon.ZIndex = 0; mapa = test.gmapa; popuniMapu(); mapa.MapElements.Add(mapIcon); mapa.Center = trenutnaLokacija; mapa.ZoomLevel = 14; }
void DatagridSelectedData(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0) { if (dgDetails.Rows.Count > 0) { oMLocation = new Model.Location(); eVariable.sUniqueID = dgDetails.Rows[e.RowIndex].Cells[0].Value.ToString(); oMLocation.LOCATION_ID = dgDetails.Rows[e.RowIndex].Cells[0].Value.ToString(); oMLocation.LOCATION = dgDetails.Rows[e.RowIndex].Cells[1].Value.ToString(); oMLocation.STATUS = dgDetails.Rows[e.RowIndex].Cells[2].Value.ToString(); } } } catch (Exception ex) { } }
public static ViewWayBill prepareWB(Guid wbId) { using (var db = new SCMSEntities()) { WayBill entitymodel = db.WayBills.First(p => p.Id == wbId); ViewWayBill model = new ViewWayBill(); model.EntityWBill = entitymodel; WarehouseRelease wrn = model.EntityWBill.WarehouseRelease; model.issuer = db.VStaffDetails.FirstOrDefault(p => p.StaffID == entitymodel.PreparedBy); model.consignee = db.VStaffDetails.FirstOrDefault(p => p.StaffID == entitymodel.Consignee); model.ReceivedBy = db.VStaffDetails.FirstOrDefault(p => p.StaffID == entitymodel.ReceivedBy); model.OrrignWH = db.WareHouses.FirstOrDefault(p => p.Id == entitymodel.IssuerWarehouse); model.destinationWH = db.WareHouses.FirstOrDefault(p => p.Id == entitymodel.DestinationWarehouse); model.DestnationOfiice = db.CountrySubOffices.FirstOrDefault(p => p.Id == entitymodel.DestinationOffice); Model.Location loc = model.destinationWH.Location; Model.CountrySubOffice cso = model.destinationWH.CountrySubOffice; model.OrignSOfiice = db.CountrySubOffices.First(p => p.Id == entitymodel.IssuingOffice); Model.Location l = model.OrignSOfiice.Location; Model.Location lok = model.DestnationOfiice.Location; List <WarehouseReleaseItem> writems = entitymodel.WarehouseRelease.WarehouseReleaseItems.ToList(); foreach (WarehouseReleaseItem item in writems) { Model.Inventory inv = item.Inventory; Model.Item it = inv.Item; Model.ItemCategory ic = it.ItemCategory; Model.UnitOfMeasure u = it.UnitOfMeasure; Model.Asset ast = item.Asset; } model.WRItems = writems; //dummies var person = entitymodel.Staff.Person; if (entitymodel.Staff1 != null) { person = entitymodel.Staff1.Person; } return(model); } }
public async Task <MeasureResponse> Measure(Model.Location location1, Model.Location location2) { await distanceMeasureDataProvider.MeasureDistance(location1, location2); }
public async Task <MeasureResponse> (Model.Location location1, Model.Location location2) { }
private void _adapter_OnLocationGaode(Model.Location loctaion) { this.OnLocationGaode(loctaion); }
private void _adapter_OnLocationLbsWifi(Model.Location loctaion) { this.OnLocationLbsWifi(loctaion); }
//Nesse caso vai retornar uma lista de objeto. Não sei se seu retorno vão ter vários, ou um por vez. Se for um por vez, não precisa usar lista. public List<Model.Location> Select(String pWhere) { List<Model.Location> lstLocation = new List<Model.Location>(); Model.Location lo; SqlCommand cmd = new SqlCommand("Select * From dbo.[Location] " + pWhere, db.Db()); //SQLHelper.ExecuteReader("string de conexao", CommandType.StoredProcedure, "Procedure", null) using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { lo = new Model.Location(); lo = new Model.Location(); if (!dr.IsDBNull(0)) { lo.Location_id = dr.GetInt32(0); } if (!dr.IsDBNull(1)) { lo.Region_id = dr.GetInt32(1); } if (!dr.IsDBNull(2)) { lo.Country_id = dr.GetInt32(2); } if (!dr.IsDBNull(3)) { lo.Agency_id = dr.GetInt32(3); } if (!dr.IsDBNull(4)) { lo.Address = dr.GetString(4); } if (!dr.IsDBNull(5)) { lo.Number = dr.GetInt32(5); } if (!dr.IsDBNull(6)) { lo.City = dr.GetString(6); } lstLocation.Add(lo); } } return lstLocation; }
public GpsMessage() { Location = new Model.Location(); }
public Model.Location Select(Model.Location location) { try { SqlCommand cmd = new SqlCommand("Select * From [FAMIS].[dbo].[Location] Where location_id =" + location.Location_id, db.Db()); SqlDataReader dr = cmd.ExecuteReader(); Model.Location lo; lo = new Model.Location(); while (dr.Read()) { if (!dr.IsDBNull(0)) { lo.Location_id = dr.GetInt32(0); } if (!dr.IsDBNull(1)) { lo.Region_id = dr.GetInt32(1); } if (!dr.IsDBNull(2)) { lo.Country_id = dr.GetInt32(2); } if (!dr.IsDBNull(3)) { lo.Agency_id = dr.GetInt32(3); } if (!dr.IsDBNull(4)) { lo.Address = dr.GetString(4); } if (!dr.IsDBNull(5)) { lo.Number = dr.GetInt32(5); } if (!dr.IsDBNull(6)) { lo.City = dr.GetString(6); } } return lo; } catch (Exception ex) { throw new Exception(ex.Message); } }
protected override void Seed(SeminarDbContext context) { #region Locations var locationLondon = new Model.Location { Name = "London", Building = "Central Building", RoomNumber = "B101" }; var locationVienna = new Model.Location { Name = "Vienna", Building = "Central Building", RoomNumber = "B102" }; var locationSydney = new Model.Location { Name = "Sydney", Building = "Central Building", RoomNumber = "B103" }; var locationNewYork = new Model.Location { Name = "New York", Building = "Central Building", RoomNumber = "B104" }; var locationMoscow = new Model.Location { Name = "Moscow", Building = "Central Building", RoomNumber = "B105" }; context.Locations.Add(locationLondon); context.Locations.Add(locationVienna); context.Locations.Add(locationSydney); context.Locations.Add(locationNewYork); context.Locations.Add(locationMoscow); context.SaveChanges(); #endregion #region Tracks var trackWebDevelopment = new Model.Track { Name = "Web Development" }; var trackMobileDevelopment = new Model.Track { Name = "Mobile Development" }; var trackClientSide = new Model.Track { Name = "Client Side Development" }; var trackServerSide = new Model.Track { Name = "Server Side Development" }; var trackJavascript = new Model.Track { Name = "Javascript Frameworks" }; context.Tracks.Add(trackWebDevelopment); context.Tracks.Add(trackMobileDevelopment); context.Tracks.Add(trackClientSide); context.Tracks.Add(trackServerSide); context.Tracks.Add(trackJavascript); context.SaveChanges(); #endregion #region Levels var levelBeginner = new Model.Level { Name = "Beginner", Scaling = 1 }; var levelIntermediate = new Model.Level { Name = "Intermediate", Scaling = 2 }; var levelExpert = new Model.Level { Name = "Expert", Scaling = 3 }; var levelMaster = new Model.Level { Name = "Master", Scaling = 4 }; context.Levels.Add(levelBeginner); context.Levels.Add(levelIntermediate); context.Levels.Add(levelExpert); context.Levels.Add(levelMaster); context.SaveChanges(); #endregion #region Seminars context.Seminars.Add(new Seminar { Title = "AngularJS 101", Code = "AJS101", Description = "An overview of AngularJS", Level = levelIntermediate, Location = locationSydney, Track = trackJavascript, Date = DateTime.Now.AddDays(5) }); context.Seminars.Add(new Seminar { Title = "Introduction to MVC", Code = "MVC101", Description = "An overview of ASP.NET MVC", Level = levelIntermediate, Location = locationMoscow, Track = trackServerSide, Date = DateTime.Now.AddDays(2) }); context.Seminars.Add(new Seminar { Title = "Windows Phone Fundamentals", Code = "WPH101", Description = "An overview of Windows Phone", Level = levelBeginner, Location = locationNewYork, Track = trackMobileDevelopment, Date = DateTime.Now.AddDays(-2) }); context.Seminars.Add(new Seminar { Title = "Advanced AngularJS", Code = "AJS789", Description = "An advanced look at AngularJS", Level = levelMaster, Location = locationLondon, Track = trackJavascript, Date = DateTime.Now.AddDays(10) }); context.Seminars.Add(new Seminar { Title = "Advanced MVC", Code = "MVC987", Description = "An advanced look at ASP.NET MVC", Level = levelExpert, Location = locationVienna, Track = trackServerSide, Date = DateTime.Now.AddDays(6) }); context.SaveChanges(); #endregion base.Seed(context); }
public void UpdateLocations(Model.Location inputEt) { this._LocationRepository.UpdateLocation(inputEt); }
public void AddLocations(Model.Location inputEt) { this._LocationRepository.AddLocation(inputEt); }
public LocationVM() { LocationCommand = new LocationCommand(this); Location = new Model.Location(); }