示例#1
0
        public static void UpdateRecipe(this Recipe recipe, RecipiesViewModel recipeVm)
        {
            recipe.Name             = recipeVm.Name;
            recipe.SellingPrice     = recipeVm.SellingPrice;
            recipe.DesiredMargin    = recipeVm.DesiredMargin;
            recipe.Ratio            = recipeVm.Ratio;
            recipe.Description      = recipeVm.Description;
            recipe.PlateCost        = recipeVm.PlateCost;
            recipe.DesiredPlateCost = recipeVm.DesiredPlateCost;

            recipe.Difference   = recipeVm.Difference;
            recipe.ActualMargin = recipeVm.ActualMargin;
            recipe.Margin       = recipeVm.Margin;
        }
示例#2
0
        public MainViewModel()
        {
            Settings    = new SettingsViewModel(this);
            Consumables = new ConsumablesViewModel(this);
            Recipies    = new RecipiesViewModel(this);
            Plan        = new PlanViewModel(this);
            Shopping    = new ShoppingListViewModel(this, Plan);

            if (Directory.Exists(Settings.TempPath))
            {
                foreach (var file in Directory.GetFiles(Settings.TempPath))
                {
                    File.Delete(file);
                }
            }
        }