IPill pill;                             //stores pill when found

        public SearchPillForm(PillForm pillForm, ref PillDB pillDB, SearchType searchType)
        {
            InitializeComponent();

            this.pillForm   = pillForm;
            this.pillDB     = pillDB;
            this.searchType = searchType;
        }
Beispiel #2
0
        //login correct, proceeds to main app form
        private void CorrectLogin()
        {
            //opens the main application
            PillForm pillForm = new PillForm(ref pillDB);

            pillForm.Show();

            this.Hide();
        }
        private PillDB pillDB;     //reference to the database

        public PillReportForm(PillForm pillForm, ref PillDB pillDB)
        {
            InitializeComponent();

            this.pillForm = pillForm;
            this.pillDB   = pillDB;

            InitializePillDataGridView();
        }
        PillDB pillDB;             //reference to pill database

        public AddPillForm(PillForm pillForm, ref PillDB pillDB)
        {
            InitializeComponent();

            this.pillForm = pillForm;
            this.pillDB   = pillDB;

            //allows for date time picker to accept both date and time
            creationTimeDateTimePicker.CustomFormat = "MM/dd/yyyy hh:mm:ss";
        }
        string pillOriginalImprint; //holds pill oroginal imprint in case that it is modified

        public ModifyPillForm(PillForm pillForm, ref PillDB pillDB, IPill pill)
        {
            InitializeComponent();

            this.pillForm = pillForm;
            this.pillDB   = pillDB;
            this.pill     = pill;

            //allows for date time picker to accept both date and time
            creationTimeDateTimePicker.CustomFormat = "MM/dd/yyyy hh:mm:ss";

            //moves pill information to the form
            imprintTextBox.Text              = pill.Imprint;
            colorComboBox.Text               = pill.Color;
            shapeComboBox.Text               = pill.Shape;
            drugNameTextBox.Text             = pill.DrugName;
            drugStrengthTextBox.Text         = pill.DrugStrength;
            selectImageTextBox.Text          = pill.Photo;
            creationTimeDateTimePicker.Value = DateTime.Parse(pill.CreationTimestamp);

            pillOriginalImprint = pill.Imprint;
        }
        private IPill pill;        //holds the pill whose information is shown
        public IdentifyPillForm(PillForm pillForm, IPill pill)
        {
            InitializeComponent();

            this.pillForm = pillForm;
            this.pill     = pill;

            //adds pil information to form
            imprintTextBox.Text      = pill.Imprint;
            colorTextBox.Text        = pill.Color;
            shapeTextBox.Text        = pill.Shape;
            drugNameTextBox.Text     = pill.DrugName;
            drugStrengthTextBox.Text = pill.DrugStrength;
            imageTextBox.Text        = pill.Photo;

            //allows for date time picker to accept both date and time
            creationTimeDateTimePicker.CustomFormat = "MM/dd/yyyy hh:mm:ss";

            creationTimeDateTimePicker.Value = DateTime.Parse(pill.CreationTimestamp);

            //trick to make the date time picker unchangable
            creationTimeDateTimePicker.MinDate = DateTime.Parse(pill.CreationTimestamp);
            creationTimeDateTimePicker.MaxDate = DateTime.Parse(pill.CreationTimestamp);
        }