private void UserGroupListUI_Load(object sender, EventArgs e) { Type _Type = typeof(UserGroup); FieldInfo[] myFieldInfo; myFieldInfo = _Type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public); loSearch = new SearchUI(myFieldInfo, _Type, "tsmUserGroup"); }
private void ListFormUI_Load(object sender, EventArgs e) { System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip(); ToolTip1.SetToolTip(this.btnExit, "Close Tab"); System.Windows.Forms.ToolTip ToolTip2 = new System.Windows.Forms.ToolTip(); ToolTip1.SetToolTip(this.txtSearch, "Enter to View"); FieldInfo[] myFieldInfo; myFieldInfo = lType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public); loSearch = new SearchUI(myFieldInfo, lType, "tsm" + lType.Name); }
void OpenSearch() { int i = 0; foreach (MajorClass major in majorList) { GameObject li = Instantiate(MajorListItem, MajorContentTransform); li.GetComponent <Image>().color = Color.white; li.transform.GetChild(0).GetComponent <Text>().text = major.majorName; li.transform.GetChild(1).GetComponent <Image>().sprite = major.majorImage; AddMajorButtonListener(li.transform.GetChild(2).GetComponent <Button>(), i); li.GetComponent <RectTransform>().localScale = Vector3.one; i++; } SearchUI.SetActive(true); SearchUI.GetComponent <Animator>().SetBool("SlideIn", true); OptionMenuUI.GetComponent <Animator>().SetBool("SlideIn", false); }
// Player presses back button on SwitchUI public void ExitSwitchMenu() { hideMoveOverviews(); if (isSearch) { StartCoroutine(AnimateClose(BankUI, false)); SearchUI.SetActive(true); SearchUI.GetComponent <Animator>().SetBool("SlideIn", true); } else { StartCoroutine(AnimateClose(BankUI, true)); } // Reset switch-in data HouseDeltIndex = -1; PosseDeltIndex = -1; HouseSwitchIn = null; HouseOverview.gameObject.SetActive(false); PosseOverview.gameObject.SetActive(false); }
public static StringBuilder GetMain() { StringBuilder _str = new StringBuilder(); _str.AppendLine("<div class='ui horizontal divider header container'>"); _str.AppendLine(" <i class='student icon font-th regular black'></i> "); _str.AppendLine(" <span class='lang lang-th f7 font-th regular black'>ทุน</span>"); _str.AppendLine(" <span class='lang lang-en f7 font-en regular black'>Scholarship</span>"); _str.AppendLine("</div>"); _str.AppendLine("<div class='paddingTop10'>"); _str.AppendFormat(" <div class='ui container' id='{0}'>", _idContent); _str.AppendFormat(" <div class='mini ui button' id='{0}-btnadd'>", _idContent); _str.AppendLine(" <i class='icon plus font-th regular black'></i>"); _str.AppendLine(" <span class='lang lang-th f9 font-th regular black'>เพิ่มทุนใหม่</span>"); _str.AppendLine(" <span class='lang lang-en f9 font-en regular black'>Add Scholarship</span>"); _str.AppendLine(" </div>"); _str.AppendFormat(" <div id='{0}'>{1}</div>", SearchUI._idContent, SearchUI.GetMain()); _str.AppendFormat(" <div id='{0}'></div>", AddUpdateUI._idContent); _str.AppendFormat(" <div id='{0}'></div>", ListUI._idContent); _str.AppendLine(" </div>"); _str.AppendLine("</div>"); return(_str); }
/// <summary> /// If possible, bind the controls to the data of the currently active context</summary> /// <param name="sender">Sender of event</param> /// <param name="e">Event args</param> private void contextRegistry_ActiveContextChanged(object sender, EventArgs e) { SearchUI.Bind(m_contextRegistry.GetActiveContext <IQueryableContext>()); ResultsUI.Bind(m_contextRegistry.GetActiveContext <IQueryableResultContext>()); ReplaceUI.Bind(m_contextRegistry.GetActiveContext <IQueryableReplaceContext>()); }
static void Main(string[] args) { var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", false, true); IConfigurationRoot configurationRoot = builder.Build(); var connectionString = configurationRoot.GetConnectionString("DebugConnectionString"); var providerName = configurationRoot.GetSection("AppConfig").GetChildren().Single(item => item.Key == "ProviderName").Value; DbProviderFactories.RegisterFactory(providerName, SqlClientFactory.Instance); EnsureDatabase.For.SqlDatabase(connectionString); var upgrader = DeployChanges.To .SqlDatabase(connectionString) .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly()) .LogToConsole() .Build(); upgrader.PerformUpgrade(); using (var context = new ShopContext(connectionString, providerName)) { var category = new Category { Name = "Монитор", ImagePath = "D:/1/123" }; context.Categories.Add(category); context.Categories.Add(new Category { Name = "Компьютерная переферия", ImagePath = "D:/1/123" }); context.Categories.Add(new Category { Name = "Клавиатуры", ImagePath = "D:/1/123" }); context.Users.Add(new User { PhoneNumber = "123123", Password = "******" }); context.Items.Add(new Item { Name = "LG-001", Description = "Монитор для мониторинга", ImagePath = "C:/2/1", Price = 1111, CategoryId = category.Id }); context.Items.Add(new Item { Name = "LG-002", Description = "Монитор не для мониторинга", ImagePath = "C:/2/2", Price = 1112, CategoryId = category.Id }); context.Items.Add(new Item { Name = "LG-003", Description = "Монитор", ImagePath = "C:/2/3", Price = 1113, CategoryId = category.Id }); context.Items.Add(new Item { Name = "LG-004", Description = "Монитор для игр", ImagePath = "C:/2/4", Price = 1114, CategoryId = category.Id }); context.Items.Add(new Item { Name = "LG-005", Description = "Монитор красивый", ImagePath = "C:/2/5", Price = 1115, CategoryId = category.Id }); var categories = context.Categories.GetAll().ToList(); category.ImagePath = "C:/2/535"; context.Categories.Update(category); var searchService = new SearchUI(context); var index = 0; var isExit = false; while (!isExit) { Console.Clear(); Console.WriteLine("1 - Вывод всех товаров"); Console.WriteLine("2 - Выбор категории"); Console.WriteLine("3 - Поиск товара по имени"); Console.WriteLine("0 - Выход"); if (int.TryParse(Console.ReadLine(), out var menu)) { switch (menu) { case 0: isExit = true; break; case 1: searchService.ShowItems(); break; case 2: Console.WriteLine("Выберите категорию: "); categories = context.Categories.GetAll().ToList(); index = 0; categories.ForEach(x => Console.WriteLine($"{++index} - {x.Name}")); if (int.TryParse(Console.ReadLine(), out index) && index <= categories.Count && index > 0) { searchService.ShowCategoryItems(categories[--index]); } else { Console.WriteLine("Неккоректный выбор пункта меню! Нажмите любую клавишу что бы вернуться в меню."); Console.ReadKey(); } break; case 3: Console.WriteLine("Введите имя товара или часть его названия: "); searchService.SearchByName(Console.ReadLine()); break; default: Console.WriteLine("Неккоретный выбор пункта меню! Нажмите любую клавишу что бы вернуться в меню."); break; } } } } }
public static StringBuilder GetMain() { StringBuilder _str = new StringBuilder(); _str.AppendLine(" <div class='ui horizontal divider header container'>"); _str.AppendLine(" <i class='pointing up icon font-th regular black'></i> "); _str.AppendLine(" <span class='lang lang-th f7 font-th regular black'>สมัครรับทุน</span>"); _str.AppendLine(" <span class='lang lang-en f7 font-en regular black'>Register Scholarship</span>"); _str.AppendLine(" </div>"); _str.AppendLine(" <div class='paddingTop10'>"); _str.AppendFormat(" <div class='ui container' id='{0}'>", _idContent); _str.AppendFormat(" <div id='{0}'>{1}</div>", SearchUI._idContent, SearchUI.GetMain()); _str.AppendFormat(" <div id='{0}'></div>", ListUI._idContent); _str.AppendLine(" </div>"); _str.AppendLine(" </div>"); return(_str); }