Esempio n. 1
0
        public NewDistillationForm()
        {
            InitializeComponent();

            Season season = AdministrationLogic.GetActiveSeason();
            Period period = AdministrationLogic.GetActivePeriod();

            _distillation = new Distillation
            {
                StartTime = DateTime.Now,
                Date      = DateTime.Today.Date,
                Payed     = false,
                Season    = season,
                Season_Id = season.Id,
                Period    = period,
                Period_Id = period.Id
            };

            _reqTBs = new List <TextBox>
            {
                tbAmount,
                tbDistVolume,
                tbPercAlc
            };


            materialCB.DataSource    = MaterialLogic.GetAllMaterial();
            materialCB.DisplayMember = "Name";



            tbPeriod.Text = period.Name;
            tbSeason.Text = season.Name;
        }
Esempio n. 2
0
 private void NewDistClick(object sender, EventArgs e)
 {
     if (AdministrationLogic.GetActivePeriod() != null && AdministrationLogic.GetActiveSeason() != null)
     {
         NewDistillationForm ndf = new NewDistillationForm();
         AddMdiChild(ndf);
     }
     else
     {
         MessageBox.Show("Není nastavená sezóna nebo měsíční období přejděte do administrace.", "Upozornění", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Esempio n. 3
0
        private void SaveClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(periodNameTBox.Text))
            {
                MessageBox.Show("Není vypněno jméno období!", "Upozorneni", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            Period p = new Period
            {
                Name      = periodNameTBox.Text,
                StartDate = startDate.Value,
                EndDate   = null,
                Finished  = false,
                Season    = AdministrationLogic.GetActiveSeason(),
                Season_Id = AdministrationLogic.GetActiveSeason().Id
            };

            NewPeriod = p;

            DialogResult = DialogResult.OK;
        }
Esempio n. 4
0
 private void NewPeriodForm_Load(object sender, EventArgs e)
 {
     seasonTBox.Text = AdministrationLogic.GetActiveSeason().Name;
     startDate.Value = DateTime.Today;
 }
Esempio n. 5
0
 public AdministrationForm()
 {
     InitializeComponent();
     _activeSeason = AdministrationLogic.GetActiveSeason();
     _activePeriod = AdministrationLogic.GetActivePeriod();
 }