示例#1
0
        public void HandleData(ref DAERSEntities db, ref List <TBLExercise> Data, string Query, string target, ref int tcount, string series, ref int scount, string choice, ref int count, string Backup, string query, bool secondary)
        {
            int       temp = scount;
            Stopwatch sw   = new Stopwatch();

            sw.Start();
            while (count < 3 && Data.Count == 0 && sw.Elapsed < TimeSpan.FromSeconds(5))
            {
                scount++;
                string tempp = AdjustQuery(query, target, ref tcount, series, ref scount, choice, ref count, Backup, secondary);
                Data = db.TBLExercises.SqlQuery(tempp).ToList();
                if (scount > 3 && Data.Count == 0)
                {
                    scount = 1;
                    count++;
                }
                if (Data.Count == 0 && count == 3)
                {
                    count  = 0;
                    scount = -1;
                }
            }



            scount = temp;
        }
示例#2
0
        public ActionResult Login(TBLCustomer User)
        {
            DAERSEntities Object        = new DAERSEntities();
            var           Authorization = Object.TBLCustomers.Where(recognize => recognize.Email == User.Email && recognize.Password == User.Password).Count();

            if (Authorization > 0)
            {
                FormsAuthentication.SetAuthCookie(User.Email, false);
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                TempData["Login"] = "******";
                return(View());
            }
        }
示例#3
0
        public void SaveInTemp(ref List <TBLExercise> Data, ref DAERSEntities db, ref TBLTemp temp, int j)
        {
            var a = new TBLExercise();

            if (Data.Count >= 2)
            {
                a = Data[random.Next(0, Data.Count - 1)];
            }
            else
            {
                a = Data[Data.Count - 1];
            }

            SetData(ref temp, ref a, j);
            db.TBLTemps.Add(temp);
            db.SaveChanges();
        }//save in temp table