Ejemplo n.º 1
0
        //TODO need to add to SQL
        internal static void AddAFL(AccurateFallLocation afl)
        {
            string key     = CreateKey(afl.Date);
            bool   isAdded = false;


            List <Report> r = new List <Report>();

            double[] latLog      = bl.GetCoordinate(afl.Adress);
            DateTime enteredDate = DateTime.Parse(afl.Date);
            Drop     d1          = new Drop
            {
                Drop_Id     = afl.ID,
                Drop_Adress = afl.Adress,
                Drop_time   = enteredDate,

                Reports_list   = r,
                Real_lat       = latLog[0],
                Real_log       = latLog[1],
                Estimeated_lat = latLog[0],
                Estimeated_log = latLog[1],
            };

            bl.AddDrop(d1);


            foreach (var item in FallLocationData)
            {
                if (item.GruopId.Equals(key))
                {
                    item.AccurateFallLocation = afl;
                    isAdded = true;
                    break;
                }
            }
            if (!isAdded)
            {
                FallsLocationGroup flg = new FallsLocationGroup(key)
                {
                    AccurateFallLocation = afl
                };
                FallLocationData.Add(flg);
            }
            if (DataChanged != null)
            {
                DataChanged.Invoke();
            }
            ;
        }
Ejemplo n.º 2
0
 public AccurateFallLocation(AccurateFallLocation afl) : base(afl.id, afl.adress, afl.date, afl.numberOfFalls)
 {
     PicPath = afl.picPath;
 }