private void SaveRecipetButton_Click(object sender, RoutedEventArgs e) { Meal meal = new Meal(); meal.Name = RecipeName.Text; meal.Caloricity = float.Parse((RecipeKCAL.Text).ToString()); if (DT.Text == "Śniadanie") { meal.Daytime = "Sniadanie"; } if (DT.Text == "II śniadanie/podwieczorek") { meal.Daytime = "II sniadanie/podwieczorek"; } meal.Description = RecipeDesc.Text; meal.Ingredients = RecipeIng.Text; meal.FoodRestrictions11 = Diary.IsChecked.ToString() + "," + Gluten.IsChecked.ToString() + "," + Meat.IsChecked.ToString(); DataBaseSolution.AddRecipe(meal); RecipeName.Clear(); RecipeKCAL.Clear(); RecipeDesc.Clear(); DT.ClearValue(NameProperty); RecipeIng.Clear(); Diary.IsChecked = false; Gluten.IsChecked = false; Meat.IsChecked = false; }
private void Search_Callback() { if (DateTo.Date <= DateFrom.Date) { string yesText = (string)Application.Current.FindResource("DLG_BUTTON_YES"); string noText = (string)Application.Current.FindResource("DLG_BUTTON_NO"); string titleText = "Hint"; string infoText = "The DateFrom should be earlier than DateTo."; MessageBoxEx.ShowDialog(DialogType.Warning, titleText, infoText); return; } SearchConditions conditions = new SearchConditions(); conditions.DateFrom = DateFrom.Date; conditions.DateTo = DateTo.Date; conditions.FoupId = FoupId.Trim(); conditions.LotId = LotId.Trim(); conditions.WaferId = WaferId.Trim(); conditions.RecipeName = RecipeName.Trim(); conditions.RecipeType = SelectedRecipeType.ToString(); conditions.ModuleId = SelectedMod.ToString(); inEventAggregator.GetEvent <SearchConditionsEvent>().Publish(conditions); }
/// <summary> Create a new recipe table object </summary> public RecipeTable() { RecipeId = new RecipeId(new NotNull(), new Unique(), new PrimaryKey(true)); RecipeName = new RecipeName(new NotNull(), new Unique()); ProfessionId = new ProfessionId(new NotNull(), new ForeignKey(TableManager.Profession, TableManager.Profession.ProfessionId)); Grade = new Grade(new NotNull()); }
private void SetRecipeProperties(Recipe recipe, DateTime updatedOn) { recipe.Name = RecipeName.Trim(); recipe.ResultingQuantityInGrams = RecipeQuantity; recipe.RecipeType = RecipeViewModel.RecipeType; recipe.UpdatedOn = updatedOn; }
// Validate recipe name is not null or empty // All other variables can be null public bool validate() { if (RecipeName == null || RecipeName.Equals("")) { return(false); } return(true); }
/// <summary> Load a recipe from a datarow from the table </summary> /// <param name="row">The datarow. Must be from this table</param> /// <returns>The recipe corresponding to the datarow</returns> Recipe LoadRecipe(DataRow row) { string name = RecipeName.Parse(row); long professionId = ProfessionId.Parse(row); int grade = Grade.Parse(row); Profession profession = TableManager.Profession.GetProfession(professionId); return(Recipe.Factory.CreateRecipe(name, profession, grade)); }
public void RecipeDone(RecipeName name) { foreach (var page in bookController.bookPages) { if (page.UiRecto != null && page.UiRecto.gameObject.name.Contains(name.ToString())) { page.UiRecto.GetComponentInChildren <AutoBookRecipeCounter>().SetDone(_gameRecipes[name].First); break; } else if (page.UiVerso != null && page.UiVerso.gameObject.name.Contains(name.ToString())) { page.UiVerso.GetComponentInChildren <AutoBookRecipeCounter>().SetDone(_gameRecipes[name].First); break; } } }
private void AddNecroSpell(int spell, int mana, double minSkill, Type type, RecipeName rec, params Type[] regs) { int id = CraftItem.ItemIDOf(regs[0]); int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 30.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI. AddRecipe(index, (int)rec); for (int i = 1; i < regs.Length; ++i) { id = CraftItem.ItemIDOf(regs[i]); AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 5, 501627); } AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); SetManaReq(index, mana); }
/// <summary> /// Добавление данных о том, каких ингредиентов не хватает, составление шаблонного списка рецептов /// </summary> private void AddData() { ICursor selectData = sqliteDB.RawQuery("select name from db", new string[] { }); selectData.MoveToFirst(); int i = 0; do { if (Data.RowData[++i, 0]) { string str = "Не хватает: "; for (int j = 0; j < Data.PrInf.GetLength(1); j++) { if (Data.PrInf[i, j] == true && Data.RowData[i, j] == false) { str += $"{Data.Prod[j]}, "; } } if (str == "Не хватает: ") { str = ""; } else { str = str.Substring(0, str.Length - 2); } string s = selectData.GetString(selectData.GetColumnIndex("name")); helperList.Add(s); RecipeName recipeName = new RecipeName() { ID = i, Name = s, Products = str }; listDb.Add(recipeName); } } while (selectData.MoveToNext()); selectData.Close(); }
public EditRecipeView() { InitializeComponent(); RecipeName.Focus(); }
public AddNewRecipeView() { InitializeComponent(); RecipeName.Focus(); }
void SetUIData() { ui.buttonCopy.SetOnclik(CopyData); ui.buttonPaste.SetOnclik(PasteData); ui.buttonSave.SetOnclik(SaveData); ui.buttonClear.SetOnclik(ClearData); ui.buttonLocal.SetOnclik(LocalImg); ui.ControlButton.SetOnclik(delegate { if (frame - clickFrame < 10) { ui.UIPostionReast(); } clickFrame = frame; }); SetPageData(); for (int i = 0; i < 7; i++) { int index = i; ui.ButtonDataFile[i].SetOnclik(delegate { SelectData = GetData(index); if (SelectData != null) { AddChangeBuild(SelectData); } isShowImg = true; isLookLocal = false; isAreaSelect = false; AreaTrue(); ui.ChangeRecipe.SetActive(true); }); } ui.ButtonDataUp.SetOnclik(delegate { if (atPage > 0) { atPage--; PageTo(); } }); ui.ButtonDataDown.SetOnclik(delegate { if (atPage < 2100000000) { atPage++; PageTo(); } }); //点击撤销按钮 ui.buttonZ.SetOnclik(delegate { if (GameMain.mainPlayer != null && PastIngData != null) { PastIngData.CancelTask(GameMain.mainPlayer); PastIngData.PasteClear(); } }); ui.SelectBuild.onValueChanged.AddListener(delegate { var name = ui.SelectBuild.options[ui.SelectBuild.value].text; if (BuildName.ContainsKey(name)) { AddChangeRecipe(BuildName[name]); } }); ui.ButtonChangeRecipe.SetOnclik(delegate { var name = ui.SelectBuild.options[ui.SelectBuild.value].text; if (BuildName.ContainsKey(name)) { var recipeName = ui.SelectRecipe.options[ui.SelectRecipe.value].text; if (RecipeName.ContainsKey(recipeName)) { int build = BuildName[name]; int recipe = RecipeName[recipeName]; if (SelectData != null) { SelectData.ChangeRecipe(build, recipe); info = SelectData.Name + "\n" + "修改配方成功"; } } } }); ui.ButtonOpneFile.SetOnclik(delegate { string path = System.Environment.CurrentDirectory + "\\BepInEx\\config\\PlanetFactoryData\\"; System.Diagnostics.Process.Start(path); }); ui.ButtonReLoadFile.SetOnclik(delegate { readFile(); SelectData = null; atPage = 0; PageTo(); }); }
private void AddChivSpell(int spell, string spellName, int mana, double minSkill, Type type, RecipeName rec, params Type[] regs) { int id = CraftItem.ItemIDOf(regs[0]); int index = AddCraft(type, 1061677, spellName, minSkill, minSkill + 30, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1); AddRecipe(index, (int)rec); for (int i = 1; i < regs.Length; ++i) { id = CraftItem.ItemIDOf(regs[i]); AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 5, 501627); } AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); SetManaReq(index, mana); }