static void g_detected(object sender, PinStatusEventArgs e) { edges++; if (edges == 2 && state == 0) { while (true) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); stockView = new stockView(); edges = 0; state = 1; Application.Run(stockView); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); weatherView = new WeatherView(); edges = 0; state = 2; Application.Run(weatherView); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DateAndTime dt = new DateAndTime(); edges = 0; state = 0; dt.Visible = true; Application.Run(dt); } } /* else if (edges == 2 && state == 1) * { * Application.EnableVisualStyles(); * Application.SetCompatibleTextRenderingDefault(false); * ; * } * else if (edges == 2 && state == 2) * { * Application.EnableVisualStyles(); * Application.SetCompatibleTextRenderingDefault(false); * * }*/ }
public ActionResult add() { var T = (from x in dc.tblRetails where x.id == 6 || x.id == 7 || x.id == 4 select x).ToList(); var C = (from x in dc.tblMainCategories select x).ToList(); List <SelectListItem> typelist = new List <SelectListItem>(); List <SelectListItem> categorylist = new List <SelectListItem>(); foreach (var itemm in T) { typelist.Add(new SelectListItem { Text = itemm.name, Value = itemm.id.ToString() }); } foreach (var itemm in C) { categorylist.Add(new SelectListItem { Text = itemm.name, Value = itemm.id.ToString() }); } ViewBag.type = typelist; ViewBag.category = categorylist; stockView sv = new stockView(); return(View(sv)); }