using CareFusion.Mosaic.Interfaces.Types.Stock;
using System.Windows.Forms;

namespace StorageSystemSimulator
{
    public partial class FormSelectExpiryDateSource : Form
    {
        public FormSelectExpiryDateSource(ExpiryDateSource selectedSource)
        {
            InitializeComponent();
            this.radioUnknown.Checked = selectedSource == ExpiryDateSource.Unknown;
            this.radioAutoCalculated.Checked = selectedSource == ExpiryDateSource.AutoCalculated;
            this.radioManualEntry.Checked = selectedSource == ExpiryDateSource.ManualEntry;
            this.radioITSystem.Checked = selectedSource == ExpiryDateSource.ITSystem;
            this.radioOCR.Checked = selectedSource == ExpiryDateSource.OCR;
            this.radioBarcode.Checked = selectedSource == ExpiryDateSource.Barcode;
        }

        public ExpiryDateSource GetSelectedSource()
        {
            if (radioUnknown.Checked)
                return ExpiryDateSource.Unknown;
            else if (radioAutoCalculated.Checked)
                return ExpiryDateSource.AutoCalculated;
            else if (radioManualEntry.Checked)
                return ExpiryDateSource.ManualEntry;
            else if (radioITSystem.Checked)
                return ExpiryDateSource.ITSystem;
            else if (radioOCR.Checked)
                return ExpiryDateSource.OCR;
            else if (radioBarcode.Checked)
                return ExpiryDateSource.Barcode;

            return ExpiryDateSource.Unknown;

        }

    }
}
