using Avalonia.Media.Imaging; using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata.Ecma335; using System.Text; using System.Threading.Tasks; namespace kuzminIVProjectWorkOnDemo.Models { public partial class Sevice { public Bitmap ImageBitmap { get => new Bitmap(Environment.CurrentDirectory + "\\" + Image.Substring(1)); } private static bool isvisibleforadmin = false; public string PriceBackround { get { if (Discount == 0) { return "White"; } else { return "#FFE7FABF"; } } } public string LessonDuration { get { float totalcost = (float)((1 - Discount) * Cost); totalcost = (float)Math.Round(totalcost); string strTotalCost = totalcost.ToString() + " рублей за " + (Duration / 60) + "минут"; return strTotalCost; } } public string DiscountStr { get { return "* скидка " + Math.Round((Double)Discount * 100, 0) + "%"; } } public bool VisibleBlock { get { if (Discount == 0) { return false; } else { return true; } } } public float CostWithDiscount { get { if (Discount != 0) { float cost = (1 - (float)Discount); return (float)Cost * cost; } else { return (float)Cost; } } } public static bool IsVisibleAdmin { get { return isvisibleforadmin; } set { isvisibleforadmin = value; } } } }