예제 #1
0
        private void InsertNotes()
        {
            Notes = Interaction.InputBox("Enter Note:", "TeleRad - Client", " ");

            string            strSQL = "";
            string            centre = " ";
            Myconnectionclass CN2    = new Myconnectionclass();
            OdbcCommand       Cmd2;
            OdbcDataReader    Rs2;

            CN2.OpenConnection();
            Cmd2 = new System.Data.Odbc.OdbcCommand("SELECT * from UserMaster WHERE UserName='******'", CN2.DBConnection);
            Rs2  = Cmd2.ExecuteReader();
            if (Rs2.HasRows)
            {
                centre = Rs2["Centre"].ToString();
            }
            Rs2.Close();
            Cmd2.Dispose();
            CN2.closeconnection();

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand("SELECT * from Reports WHERE StudyUID='" + StID + "'", CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            if (Rs1.HasRows)
            {
                if (Notes.Length <= 0)
                {
                    strSQL = "UPDATE Reports SET IsNotes=0, Centre='" + centre + "' WHERE StudyUID='" + StID + "'";
                }
                else
                {
                    strSQL = "UPDATE Reports SET Notes='" + Notes + "', IsNotes=1, Centre='" + centre + "' WHERE StudyUID='" + StID + "'";
                }
            }
            else
            {
                if (Notes.Length <= 0)
                {
                    strSQL = "INSERT INTO Reports (StudyUID, IsNotes,Centre) VALUES ('" + StID + "',1,'" + centre + "')";
                }
                else
                {
                    strSQL = "INSERT INTO Reports (StudyUID, Notes, IsNotes,Centre) VALUES ('" + StID + "', '" + Notes + "', 1,'" + centre + "')";
                }
            }
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand(strSQL, CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();
            MessageBox.Show("Successfully Sent Study", "TeleRad - Client", MessageBoxButtons.OK);
        }
예제 #2
0
        private void btnSendNotes_Click(object sender, EventArgs e)
        {
            if (DataGridView1.SelectedCells[14].Value.ToString() == true.ToString())
            {
                MessageBox.Show("Report is ready, so you cannot Send / Resend Notes anymore", "TeleRad - Client", MessageBoxButtons.OK);
                return;
            }

            String Notes = "";

            Notes = Interaction.InputBox("Enter Note:", "TeleRad - Client", " ");

            string strSQL = "";

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand("SELECT * from Reports WHERE StudyUID='" + DataGridView1.SelectedCells[5].Value.ToString() + "'", CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            if (Rs1.HasRows)
            {
                if (Notes.Length <= 0)
                {
                    strSQL = "UPDATE Reports SET IsNotes=0 WHERE StudyUID='" + DataGridView1.SelectedCells[5].Value.ToString() + "'";
                }
                else
                {
                    strSQL = "UPDATE Reports SET Notes='" + Notes + "', IsNotes=1 WHERE StudyUID='" + DataGridView1.SelectedCells[5].Value.ToString() + "'";
                }
            }
            else
            {
                if (Notes.Length <= 0)
                {
                    strSQL = "INSERT INTO Reports (StudyUID, IsNotes) VALUES ('" + DataGridView1.SelectedCells[5].Value.ToString() + "',1)";
                }
                else
                {
                    strSQL = "INSERT INTO Reports (StudyUID, Notes, IsNotes) VALUES ('" + DataGridView1.SelectedCells[5].Value.ToString() + "', '" + Notes + "', 1)";
                }
            }
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand(strSQL, CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();
            MessageBox.Show("Successfully Sent Study", "TeleRad - Client", MessageBoxButtons.OK);
            btnRefresh_Click(this, e);
        }
예제 #3
0
        public bool Show_Reports()
        {
            if (string.IsNullOrEmpty(TeleRadPush.modMain.StudyID))
            {
                //MessageBox.Show("Please select any DICOM Image", "TeleRad-Client", MessageBoxButtons.OK)
                return(true);
            }

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand("SELECT * FROM Reports WHERE StudyUID='" + TeleRadPush.modMain.StudyID + "'", CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            Rs1.Read();
            if (Rs1["IsReports"].ToString() == true.ToString())
            {
                txtReports.Rtf = Rs1["Reports"].ToString();
            }
            else
            {
                txtReports.Text = "";
            }
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();

            return(true);
        }
예제 #4
0
 private void Command1_Click(object sender, EventArgs e)
 {
     nowConnected = false;
     CN.OpenConnection();
     cmd = new System.Data.Odbc.OdbcCommand("SELECT * FROM UserMaster WHERE UserName='******' AND EncodedPass='******'", CN.DBConnection);
     Rs1 = cmd.ExecuteReader();
     if (Rs1.HasRows)
     {
         modMain.UID = txtUser.Text;
         Rs1.Close();
         CN.closeconnection();
         RetrieveDialogType frmRet = new RetrieveDialogType();
         frmRet.Show();
         this.Hide();
     }
     else
     {
         Rs1.Close();
         CN.closeconnection();
         MessageBox.Show("Invalid Login");
         txtUser.Focus();
         txtUser.SelectionStart  = 0;
         txtUser.SelectionLength = txtUser.Text.Length;
     }
 }
예제 #5
0
        private void btnToday_Click(object sender, EventArgs e)
        {
            CN1.OpenConnection();
            CMD1 = new System.Data.Odbc.OdbcCommand("select * from PatientStudyView where datepart(dd,StudyDate)=" + DateTime.Now.Day.ToString() + " and  datepart(MM,StudyDate)=" + DateTime.Now.Month.ToString() + " and  datepart(yy,StudyDate)=" + DateTime.Now.Year.ToString() + "", CN1.DBConnection);

            //Dim dtst As New DataSet
            DicomServerDBDataSet1.PatientStudyViewDataTable table = new DicomServerDBDataSet1.PatientStudyViewDataTable();
            System.Data.Odbc.OdbcDataAdapter adptr = new System.Data.Odbc.OdbcDataAdapter();
            adptr.SelectCommand = CMD1;
            adptr.Fill(table);
            DataGridView1.Refresh();
            DataGridView1.DataSource = null;
            DataGridView1.DataSource = table;
            this.Cursor = Cursors.Default;
            GridDesign();
            CMD1.Dispose();
            CN1.closeconnection();
        }
예제 #6
0
        private void btnViewNotes_Click(object sender, EventArgs e)
        {
            if (DataGridView1.SelectedCells[13].Value.ToString() == false.ToString())
            {
                MessageBox.Show("No Notes to view", "TeleRad - Client", MessageBoxButtons.OK);
                return;
            }

            Myconnectionclass CN = new Myconnectionclass();
            OdbcCommand       Cmd;
            OdbcDataReader    Rs1;

            CN.OpenConnection();
            Cmd = new System.Data.Odbc.OdbcCommand("SELECT * FROM Reports WHERE StudyUID='" + DataGridView1.SelectedCells[5].Value.ToString() + "'", CN.DBConnection);
            Rs1 = Cmd.ExecuteReader();
            Rs1.Read();
            if (Convert.ToBoolean(Rs1["IsNotes"]) == true)
            {
                MessageBox.Show("Notes sent: " + Rs1["Notes"].ToString(), "TeleRad - Client", MessageBoxButtons.OK);
            }
            Rs1.Close();
            Cmd.Dispose();
            CN.closeconnection();
        }