コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: exytab/Suzy
 public void TestMethod2()
 {
     LocationArea newlocation = new LocationArea();
     newlocation.name = "Киев";
     LocationList.Add(newlocation);
     Assert.Equals(newlocation, LocationList.Get());
 }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: exytab/Suzy
 public void TestAccountAreaEquals()
 {
     LocationArea newlocation = new LocationArea();
     newlocation.name = "Киев";
     LocationArea newlocation1 = new LocationArea();
     newlocation.name = "Киев";
     Assert.Equals(newlocation == newlocation1, newlocation.Equals(newlocation1));
 }
コード例 #3
0
ファイル: LocationList.cs プロジェクト: exytab/Suzy
 /// <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();
     }
 }
コード例 #4
0
ファイル: Common.asmx.cs プロジェクト: exytab/Suzy
        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;
        }