コード例 #1
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            List <Service> services = new List <Service>();

            foreach (var service in Service.getList())
            {
                if (useSerivce.Contains(service.Name))
                {
                    services.Add(service);
                }
            }
            Tariff.Add(NameBox.Text, DescriptionBox.Text, double.Parse(PriceBox.Text));
            List <Tariff> tarrifs = Tariff.getList();

            tarrifs[tarrifs.Count - 1].Services = services;
            Close();
        }
コード例 #2
0
 public double resultPrice()
 {
     price = 0;
     foreach (var tariff in Tariff.getList())
     {
         if (tariff.Name == TariffBox.Text)
         {
             price += tariff.Price;
         }
     }
     for (int i = 0; i < ServiceLstUse.Items.Count; i++)
     {
         foreach (var serviceName in Service.getList())
         {
             if (serviceName.Name == ServiceLstUse.Items[i].ToString())
             {
                 price += serviceName.Price;
             }
         }
     }
     return(price);
 }