Beispiel #1
0
        public ServiceWindow(Service service)
        {
            InitializeComponent();

            dtpServiceDate.Value = service.dateAndTime;
            dtpServiceDate.Enabled = false;
            dtpServiceTime.Value = service.dateAndTime;
            dtpServiceTime.Enabled = false;

            tbMaster.Text = service.master;

            tbServiceName.Text = service.name;
            tbServiceShortName.Text = service.shortName;
            tbPrice.Text = service.price.ToString();
            tbTotalPrice.Text = service.GetTotalPrice().ToString();

            cbFactor.Items.Clear();
            for (int i = 1; i <= 1000; i++)
            {
                cbFactor.Items.Add(i.ToString());
            }
            cbDiscount.Items.Clear();
            for (int i = 0; i <= 100; i++)
            {
                cbDiscount.Items.Add(i.ToString());
            }
            cbFactor.SelectedIndex = service.factor-1;
            cbDiscount.SelectedIndex = service.discount;

            tbMaster.ReadOnly = true;
            tbServiceShortName.ReadOnly = true;
            tbServiceName.ReadOnly = true;
            tbPrice.ReadOnly = true;
            tbTotalPrice.ReadOnly = true;
            cbDiscount.Enabled = false;
            cbFactor.Enabled = false;
            cbConstService.Enabled = false;

            buttonDeleteLine.Visible = true;
            buttonCancel.Visible = false;
            buttonEditLine.Visible = true;
            buttonSaveLine.Visible = false;
            buttonAddLine.Visible = false;
        }
Beispiel #2
0
 //При добавлении услуги описанной в файле услуг
 public void addService(Service service)
 {
     serviceList.Add(service);
 }