public void TestMethod2() { LocationArea newlocation = new LocationArea(); newlocation.name = "Киев"; LocationList.Add(newlocation); Assert.Equals(newlocation, LocationList.Get()); }
public void TestAccountAreaEquals() { LocationArea newlocation = new LocationArea(); newlocation.name = "Киев"; LocationArea newlocation1 = new LocationArea(); newlocation.name = "Киев"; Assert.Equals(newlocation == newlocation1, newlocation.Equals(newlocation1)); }
/// <summary> /// Метод добавляет в базу данных объект типа LocationArea /// </summary> /// <param name="location_area">Объект типа LocationArea</param> public static void Add(LocationArea location_area) { location_area _location_area = new location_area(); _location_area.id_account = location_area.id_account; _location_area.name = location_area.name; _location_area.lattitude = location_area.lattitude; _location_area.longtitude = location_area.longtitude; _location_area.radius = location_area.radius; _location_area.id = location_area.id; _location_area.time_of_marking = location_area.time_of_marking; using (CustomSuzyEntities db = new CustomSuzyEntities()) { db.location_area.Add(_location_area); db.SaveChanges(); } }
public string SavePosition(float latitude, float longitude, float radius) { string result = string.Empty; try { if(SessionManager.IsAuthorization()) { LocationArea la = new LocationArea(); la.id_account = (int)SessionManager.Get(); la.lattitude = latitude; la.longtitude = longitude; la.radius = radius; la.time_of_marking = DateTime.Now; LocationList.Add(la); } } catch (Exception ex) { Logg.er.Log(ex); } return result; }