Beispiel #1
0
        /**
         * prompting the user to save their work (curently loaded patient)
         * */
        public void saveChanges( )
        {
            if (currentPatient != null)
            {
                DatabaseConverter manager = new DatabaseConverter(dbCon);
                DialogResult      result;

                result = MessageBox.Show("Save changes for current patient?", "",
                                         MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    manager.insertPatientNote(currentPatient, notes);
                }

                if (result == System.Windows.Forms.DialogResult.No)
                {
                }
                notes.Clear( );
            }


            else
            {
            }
        }
Beispiel #2
0
        /**
         * This button (View this patient details) loads in selected patient details on the page
         * */
        public void loadCurrentPatient( )
        {
            cleanAll( );


            if (currentPatient != null)
            {
                DatabaseConverter convert = new DatabaseConverter(dbCon, currentPatient);

                convert.loadList( );
                history = convert.HistoryData( );

                if (isDoctor == true)
                {
                    prescriptionList = convert.GetPrescription( );
                    prescriptions    = convert.PrescriptionData( );
                    testresultsList  = convert.getTestResults( );
                    testresults      = convert.TestResults( );
                    ListBoxWriter(testresults, testResultsListBox);
                }
                ListBoxWriter(prescriptions, prescriptiptionsListBox);
                textBoxWriter(history, historyBox);

                detailsBox.Text = currentPatient.FirstName + " " + currentPatient.LastName + " " + currentPatient.DOB.ToShortDateString( ) + "\nGender: " + currentPatient.Gender + "\nNext of kin: " + currentPatient.NextOfKin + "\nAddress " + currentPatient.Address;
                initCurrentPatientOnPrescriptionForm(currentPatient);
            }
            else
            {
                MessageBox.Show("Select patient");
            }
        }
Beispiel #3
0
        protected void Convert()
        {
            PaymentsManager   manager   = new PaymentsManager();
            var               xmlStream = Helper.GetResource("BodyArchitect.UnitTests.DbConverter.V4V5.BAPoints.xml");
            DatabaseConverter converter = new DatabaseConverter(new BACallbackMock(), manager.Load(xmlStream));

            converter.Convert();
        }
Beispiel #4
0
        public void TestMethod1()
        {
            DBConnection      con  = new DBConnection();
            DatabaseConverter test = new DatabaseConverter(con, new Patient());

            Patient p = test.findPatientByName("as", "as");

            Assert.AreEqual(p.ID, 210);
        }
Beispiel #5
0
        /**
         * initialises constructor
         * include time,database components
         * */
        public void Init(DBConnection dbCon)

        {
            this.dbCon = dbCon;
            infoFac    = new PatientFactory(dbCon);
            Timer timer1 = new Timer();

            timer1.Start( );

            converter       = new DatabaseConverter(dbCon);
            prescriptonForm = new AddPrescription(dbCon, this);
        }
Beispiel #6
0
    protected void uxUpdateConfigOnlyButton_Click(object sender, EventArgs e)
    {
        WidgetDirector widgetDirector = new WidgetDirector();

        SystemConfig.UpdateNewConfigValue(widgetDirector.WidgetConfigurationCollection);
        DatabaseConverter convert = new DatabaseConverter();

        convert.UpdateStoreConfigurations();
        AdminUtilities.ClearAllCache();
        uxMessageLabel.ForeColor = System.Drawing.Color.Green;
        uxMessageLabel.Text      = "<strong>Update Config Completed</storng>";
    }
Beispiel #7
0
        public string ExecuteScalarString(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            string result = DatabaseConverter.ToString(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Beispiel #8
0
        public int ExecuteScalarInteger(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            int result = DatabaseConverter.ToInteger(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Beispiel #9
0
        public decimal ExecuteScalarDecimal(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            decimal result = DatabaseConverter.ToDecimal(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Beispiel #10
0
        public bool ExecuteScalarBoolean(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            bool result = DatabaseConverter.ToBoolean(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Beispiel #11
0
        public Guid ExecuteScalarGuid(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;

            Guid result = DatabaseConverter.ToGuid(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Beispiel #12
0
        /// <summary>
        /// savescreate and save a prescription into the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void prescribeButton_Click(object sender, EventArgs e)
        {
            DatabaseConverter manager = new DatabaseConverter(dbCon);
            DialogResult      result;

            result = MessageBox.Show("Do you want to prescribe this medication ?", "",
                                     MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                createNewPrescription(medications[index].ScientificName.ToString());
                this.Hide();
                controlGP.loadCurrentPatient( );
                controlGP.refreshPrescriptionList( );
            }

            if (result == System.Windows.Forms.DialogResult.No)
            {
            }
        }
Beispiel #13
0
    protected void uxExecuteButton_Click(object sender, EventArgs e)
    {
        try
        {
            if (uxExecuteText.Text != "")
            {
                AdminUtilities.RemoveAllCacheInMemory();

                DatabaseConverter databaseConverter = new DatabaseConverter();

                databaseConverter.OnScriptExecuting();
                DataAccess.ExecuteNonQueryNoParameter(uxExecuteText.Text.Trim());
                databaseConverter.OnScriptExecuted();

                // Update configurations
                DataAccessContext.ClearConfigurationCache();
                ConfigurationHelper.ApplyConfigurations();

                databaseConverter.Convert();

                AdminUtilities.RemoveAllCacheInMemory();

                // Set up PaymentModule
                //      PaymentModuleSetup paymentModule = new PaymentModuleSetup();
                //      paymentModule.ProcessDatabaseConnected();

                uxMessageLabel.ForeColor = System.Drawing.Color.Green;
                uxMessageLabel.Text      = "<strong>Upgrade Completed</storng>";
            }
            else
            {
                DisplatError("No command to execute.");
            }
        }
        catch (Exception ex)
        {
            DisplatError(ex.Message);
        }
    }
Beispiel #14
0
        public DateTime ExecuteDataTableDateTime(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? DateTime.MinValue : DatabaseConverter.ToDateTime(dataTable.Rows[0][0]));
        }
Beispiel #15
0
        public bool ExecuteDataTableBoolean(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? false : DatabaseConverter.ToBoolean(dataTable.Rows[0][0]));
        }
Beispiel #16
0
        public decimal ExecuteDataTableDecimal(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToDecimal(dataTable.Rows[0][0]));
        }
Beispiel #17
0
        public Guid ExecuteDataTableGuid(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? Guid.Empty : DatabaseConverter.ToGuid(dataTable.Rows[0][0]));
        }
Beispiel #18
0
        public string ExecuteDataTableString(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? string.Empty : DatabaseConverter.ToString(dataTable.Rows[0][0]));
        }
Beispiel #19
0
        public long ExecuteDataTableLong(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToLong(dataTable.Rows[0][0]));
        }
Beispiel #20
0
        public int ExecuteDataTableInteger(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToInteger(dataTable.Rows[0][0]));
        }