Beispiel #1
0
        static void Main(string[] args)
        {
            using (var db = new ProjectContext())
            {
                Coordinate coor = new Coordinate(5, 4);

                var f  = new ReportFall(65, new DateTime(1998, 3, 3), "kkk", "sss", "sss", 2, 2, coor);
                var f2 = new Reporter("mayshar", "1234");
                var f3 = new Analystic("sara", "1234");
                //var f = new ReportFall();// (600,new DateTime(1998,6,6),"name","street","city",2,2,3,3);
                Console.WriteLine("start");
                db.Reports.Add(f);
                db.Reporters.Add(f2);
                db.Analystics.Add(f3);
                Console.WriteLine("mid");
                db.SaveChanges();
                Console.WriteLine("finish");
                //updating
                //var result = db.Falls.SingleOrDefault(f1 => f1.FallId == 3);
                //if (result != null)
                //{
                //    Console.WriteLine("if_start");
                //    result.LatFall = 100;
                //    db.SaveChanges();
                //    Console.WriteLine("if_end");
                //}
                //var f4 = new ReportFall(65, new DateTime(2019, 9, 3,7,32,0), "sari", "Ahad Ha'Am St 3", "Ramat Gan", 1, 2, coor);
                //var f5 = new Fall(3, "Matania 19 - 11", "Ramat Gan", Coordinate coordinateF, DateTime date, String imageLocation));
            }
        }
Beispiel #2
0
        public bool IsAnalystic(Analystic analystic)
        {
            using (var db = new ProjectContext())
            {
                var result = db.Analystics.SingleOrDefault(r1 => r1.user == analystic.user && r1.password == analystic.password);

                if (result == null)
                {
                    return(false);
                }
                else
                {
                    //if(reporter.password== result.password)
                    return(true);
                    //return false;
                }
            }
        }
Beispiel #3
0
        public void CheckUser(string password)
        {
            if (Role.Equals("Reporter"))
            {
                Reporter reporter = new Reporter(UserName, password);
                bool     result   = myModel.MyBL.IsReporter(reporter);
                if (result)
                {
                    ViewService.LogInReporter();
                }
            }

            else
            {
                Analystic analystic = new Analystic(UserName, password);
                bool      result    = myModel.MyBL.IsAnalystic(analystic);
                if (result)
                {
                    ViewService.LogInAnalystic();
                }
            }
        }
Beispiel #4
0
 public bool IsAnalystic(Analystic analystic)
 {
     return(myDal.IsAnalystic(analystic));
 }