Exemplo n.º 1
0
        public void Load_mlc()
        {
            //Summary = false; Detail = false; MER = false; MLC1 = true ; MLC2 = false;
            R_Seabase_MLC1.Load(@"C:\Report\R_Seabase_MLC.rpt");
            crystalReportViewer2.ReportSource     = R_Seabase_MLC1;
            crystalReportViewer2.SelectionFormula = "{t_result_main1.resultid} = '" + this.Tag.ToString() + "'";

            ClassSql a = new ClassSql();
            TextBox  txt_ForNo = new TextBox(); TextBox txt_RevNo = new TextBox();

            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '14'", txt_ForNo, "Form");
            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '14'", txt_RevNo, "Revision");
            TextObject FormNo      = (TextObject)R_Seabase_MLC1.ReportDefinition.ReportObjects["txt_formNo"];
            TextObject RevNo       = (TextObject)R_Seabase_MLC1.ReportDefinition.ReportObjects["txt_RevNo"];
            TextObject CompanyName = (TextObject)R_Seabase_MLC1.ReportDefinition.ReportObjects["txt_CompanyName"];
            TextObject CompanyAdd  = (TextObject)R_Seabase_MLC1.ReportDefinition.ReportObjects["txt_CompanyAdd"];

            FormNo.Text      = txt_ForNo.Text;
            RevNo.Text       = txt_RevNo.Text;
            CompanyName.Text = Properties.Settings.Default.CompanyName.ToString();
            CompanyAdd.Text  = Properties.Settings.Default.CompanyAdd.ToString();
            //R_Seabase_MLC1.Refresh();
            crystalReportViewer2.RefreshReport();
            RemoveTab(crystalReportViewer2);
            wizard1.SelectedTab = tabPage2;
        }
Exemplo n.º 2
0
 private void frm_Ultrasound_FormClosing(object sender, FormClosingEventArgs e)
 {
     fmain.Ultrasount = true;
     fmain.ts_PrintPreview_Ultra.Enabled = false; fmain.ts_add_ultrasound.Enabled = true; fmain.ts_edit_ultrasound.Enabled = false; fmain.ts_delete_ultrasound.Enabled = false; fmain.ts_save_ultrasound.Enabled = false; fmain.ts_cancel_ultrasound.Enabled = false; fmain.ts_search_ultrasound.Enabled = true; fmain.ts_print_ultrasound.Enabled = false;
     ClassSql.DbClose();
     //   fmain.Strip_sub.Visible = false;
 }
Exemplo n.º 3
0
 private void frm_login_Load(object sender, EventArgs e)
 {
     if (System.Environment.MachineName == "CMSISERVER")
     {
         ClassSql.ConnectSqlInstance(Properties.Settings.Default.InstanceName);
     }
 }
Exemplo n.º 4
0
        public void New()
        {
            EnableDisAble(true);
            NewPatient = true;
            Clear();
            pin.Text        = ClassSql.CreateID();
            txt_update.Text = DateTime.Today.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToString("hh:mm:ss tt");
            txt_reg.Text    = DateTime.Today.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToString("hh:mm:ss tt");
            fmain.ts_add_profile.Enabled  = false; fmain.ts_edit_profile.Enabled = false; fmain.ts_del_profile.Enabled = false; fmain.ts_save_profile.Enabled = true; fmain.ts_search_profile.Enabled = false; fmain.ts_cancel_profile.Enabled = true; fmain.ts_print_profile.Enabled = false;
            fmain.ts_First_Record.Enabled = false;
            fmain.ts_prev_record.Enabled  = false;
            fmain.ts_next_Record.Enabled  = false;
            fmain.ts_last_Record.Enabled  = false;

            dt_end.Format       = DateTimePickerFormat.Custom;
            dt_end.CustomFormat = "00/00/0000";

            this.dt_start.Format  = DateTimePickerFormat.Custom;
            dt_start.CustomFormat = "00/00/0000";

            this.dtbday.Format  = DateTimePickerFormat.Custom;
            dtbday.CustomFormat = "00/00/0000";

            // load_Employer();
        }
Exemplo n.º 5
0
        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            Summary = false; Detail = true; MER = false; MLC1 = true; MLC2 = false;
            R_SeabaseDetailed1.Load(@"C:\Report\R_SeabaseDetailed.rpt");
            crystalReportViewer3.ReportSource     = R_SeabaseDetailed1;
            crystalReportViewer3.SelectionFormula = "{t_result_main1.resultid} = '" + this.Tag.ToString() + "'";
            ClassSql a = new ClassSql();
            TextBox  txt_ForNo = new TextBox(); TextBox txt_RevNo = new TextBox(); TextBox txt_ISO = new TextBox();

            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '12'", txt_ForNo, "Form");
            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '12'", txt_RevNo, "Revision");
            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '12'", txt_ISO, "ISO");
            TextObject FormNo = (TextObject)R_SeabaseDetailed1.ReportDefinition.ReportObjects["txt_formNo"];
            TextObject RevNo  = (TextObject)R_SeabaseDetailed1.ReportDefinition.ReportObjects["txt_RevNo"];
            TextObject ISO    = (TextObject)R_SeabaseDetailed1.ReportDefinition.ReportObjects["txt_iso"];

            FormNo.Text = txt_ForNo.Text;
            RevNo.Text  = txt_RevNo.Text;
            ISO.Text    = txt_ISO.Text;

            //R_SeabaseDetailed1.Refresh();
            crystalReportViewer3.RefreshReport();
            RemoveTab(crystalReportViewer3);
            wizard1.SelectedTab = tabPage3;
        }
Exemplo n.º 6
0
        private void cmd_ok_Click(object sender, EventArgs e)
        {
            this.Close();
            Properties.Settings.Default.InstanceName = txt_Instance.Text;
            Properties.Settings.Default.Save();

            ClassSql.ConnectSqlInstance(Properties.Settings.Default.InstanceName);
        }
Exemplo n.º 7
0
        private void frm_addPatient_Load(object sender, EventArgs e)
        {
            //ClassSql.DbConnect();
            txt_papin.Text = ClassSql.CreateID();

            load();
            load_Employer();
            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 8
0
        private void frm_visit_FormClosing(object sender, FormClosingEventArgs e)
        {
            // fmain.Strip_sub.Visible = false;
            Main.f_visit = true;
            ClassSql.DbClose();

            if (backgroundWorker1.IsBusy)
            {
                backgroundWorker1.CancelAsync();
            }
        }
Exemplo n.º 9
0
        private void frm_patientInfo_FormClosing(object sender, FormClosingEventArgs e)
        {
            ClassSql.DbClose();
            fmain.f_PatientInfo          = true;
            fmain.ts_add_profile.Enabled = true; fmain.ts_edit_profile.Enabled = true; fmain.ts_del_profile.Enabled = true; fmain.ts_save_profile.Enabled = false; fmain.ts_search_profile.Enabled = true; fmain.ts_print_profile.Enabled = false; fmain.ts_cancel_profile.Enabled = false;

            fmain.ts_First_Record.Enabled = true;
            fmain.ts_prev_record.Enabled  = true;
            fmain.ts_next_Record.Enabled  = true;
            fmain.ts_last_Record.Enabled  = true;
        }
Exemplo n.º 10
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            int i = 1;

            //frm_Psych_Evaluation.LabID.Clear();
            //frm_Psych_Evaluation.LabID.Text = ClassSql.Generate_ResultID("SELECT t_psychology.cn FROM t_psychology ORDER BY t_psychology.cn DESC limit 1", "cn", "PSYCHO00");

            papin = ClassSql.CreateID();
            backgroundWorker1.ReportProgress(i, papin);
            i++;
        }
Exemplo n.º 11
0
        void SaveImage()
        {
            if (img.Image != null)
            {
                ClassSql.DbConnect();
                MySqlCommand cmd;


                //  Image myBitmap = Image.FromFile(@"C:\Users\Mark\Downloads\Que(1).png");
                Image myBitmap    = pic_.Image;
                var   imageStream = new MemoryStream();
                using (imageStream)
                {
                    // Save bitmap in some format.
                    myBitmap.Save(imageStream, ImageFormat.Png);
                    imageStream.Position = 0;

                    // Do something with the memory stream. For example:
                    byte[] imageBytes = imageStream.ToArray();
                    // Save bytes to the database.
                    cmd = new MySqlCommand("Update m_patient SET picture = @picture where papin ='" + txt_papin.Text + "'", ClassSql.cnn);
                    // cmd = new MyMySqlCommand("Insert into tbl_pic (pic,i) values (@pic,@i)", ClassSql.cnn);
                    cmd.Parameters.Add("@picture", MySqlDbType.LongBlob, 100);
                    //cmd.Parameters.Add("@lastname", MySqlDbType.VarChar, 254);

                    cmd.Parameters["@picture"].Value = imageBytes;
                    // cmd.Parameters["@lastname"].Value = "sample lastname";
                    cmd.ExecuteNonQuery();
                    //int RowsAffected = cmd.ExecuteNonQuery();

                    //if (RowsAffected > 0)
                    //{
                    //    //  MessageBox.Show("Image saved sucessfully!");
                    //    ClassSql.cnn.Close();
                    //    //loadLisOfFiles();
                    //}

                    ClassSql.cnn.Close();
                }
            }
        }
Exemplo n.º 12
0
 void Delete_Record()
 {
     try
     {
         ClassSql a = new ClassSql();
         a.ExecuteQuery("Delete from t_radiology where resultid = '" + LabID.Text + "' and resulttype= 'XRAY'");
         Tool.MessageBoxDelete();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, string.Format("An error occured {0}", ex.Message), Properties.Settings.Default.SystemName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
     }
     finally
     {
         //if (ClassSql.cnn != null) { ClassSql.DbClose(); }
         if (ClassSql.dr != null)
         {
             ClassSql.dr.Close();
         }
     }
 }
Exemplo n.º 13
0
        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            R_Seabase_MER1.Load(@"C:\Report\R_Seabase_MER.rpt");
            crystalReportViewer4.ReportSource     = R_Seabase_MER1;
            crystalReportViewer4.SelectionFormula = "{t_result_main1.resultid} = '" + this.Tag.ToString() + "'";
            ClassSql a = new ClassSql();
            TextBox  txt_ForNo = new TextBox(); TextBox txt_RevNo = new TextBox();

            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '13'", txt_ForNo, "Form");
            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '13'", txt_RevNo, "Revision");
            TextObject FormNo = (TextObject)R_Seabase_MER1.ReportDefinition.ReportObjects["txt_formNo"];
            TextObject RevNo  = (TextObject)R_Seabase_MER1.ReportDefinition.ReportObjects["txt_RevNo"];

            FormNo.Text = txt_ForNo.Text;
            RevNo.Text  = txt_RevNo.Text;
            // /R_Seabase_MER1.Refresh();
            crystalReportViewer4.RefreshReport();
            RemoveTab(crystalReportViewer4);

            wizard1.SelectedTab = tabPage4;

            tabControl1.SelectedTab = tabPage5;

            Seabase_MER_Page21.Load(@"C:\Report\Seabase_MER_Page2.rpt");
            crystalReportViewer5.ReportSource     = Seabase_MER_Page21;
            crystalReportViewer5.SelectionFormula = "{t_result_main1.resultid} = '" + this.Tag.ToString() + "'";
            //ClassSql a = new ClassSql();
            //TextBox txt_ForNo2 = new TextBox(); TextBox txt_RevNo2 = new TextBox();
            //a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '13'", txt_ForNo, "Form");
            //a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '13'", txt_RevNo, "Revision");
            //TextObject FormNo2 = (TextObject)Seabase_MER_Page21.ReportDefinition.ReportObjects["txt_formNo"];
            //TextObject RevNo2 = (TextObject)Seabase_MER_Page21.ReportDefinition.ReportObjects["txt_RevNo"];
            //FormNo2.Text = txt_ForNo2.Text;
            //RevNo2.Text = txt_RevNo2.Text;

            // /R_Seabase_MER1.Refresh();
            crystalReportViewer5.RefreshReport();
            RemoveTab(crystalReportViewer5);
            // wizard1.SelectedTab = tabPage4;
        }
Exemplo n.º 14
0
        private void dg_result_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 5)
            {
                dg_result.ReadOnly = false;
                dgcn = this.dg_result.SelectedRows[0].Cells["cn"].Value.ToString();

                // string status = Convert.ToString((dg_result.Rows[0].Cells["Status"] as DataGridViewComboBoxCell).FormattedValue.ToString());

                try
                {
                    // ClassSql a = new ClassSql();
                    //  a.ExecuteQuery("Update t_result_main SET status = '" + status.ToString() + "' where cn ='"+cn.ToString()+"' ");
                    // MessageBox.Show(status.ToString());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, string.Format("An error occured {0}", ex.Message), Properties.Settings.Default.SystemName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                finally
                {
                    if (ClassSql.cnn != null)
                    {
                        ClassSql.DbClose();
                    }
                    if (ClassSql.dr != null)
                    {
                        ClassSql.dr.Close();
                    }
                }
            }
            else
            {
                dg_result.ReadOnly = true;
            }
        }
Exemplo n.º 15
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     this.Invoke(new MethodInvoker(delegate() { RegisterPatient(); }));
     this.Invoke(new MethodInvoker(delegate() { txt_papin.Text = ClassSql.CreateID(); }));
 }
Exemplo n.º 16
0
        //private void cmd_add_Employer_Click(object sender, EventArgs e)
        //{
        //    ClassSql a = new ClassSql();
        //    if (a.CountColumn("Select * from tbl_employer where Employer = '" + Tool.ReplaceString(cbo_employer.Text) + "'") >= 1)
        //    {
        //        MessageBox.Show("Employer name already exist", Properties.Settings.Default.SystemName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //        return;
        //    }
        //    else
        //    {
        //        a.ExecuteQuery("Insert into tbl_employer (Employer) values('" + Tool.ReplaceString(cbo_employer.Text) + "')");
        //        MessageBox.Show("Employer name added", Properties.Settings.Default.SystemName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);

        //    }
        //}

        private void frm_addPatient_FormClosing(object sender, FormClosingEventArgs e)
        {
            ClassSql.DbClose();
        }
Exemplo n.º 17
0
 private void frm_Approval_FormClosing(object sender, FormClosingEventArgs e)
 {
     fmain.Approval = true;
     ClassSql.DbClose();
 }
 private void frm_Tumor_Immunological_FormClosing(object sender, FormClosingEventArgs e)
 {
     fmain.Tumor = true;
     fmain.ts_add_tumor.Enabled = true; fmain.ts_edit_tumor.Enabled = false; fmain.ts_delete_tumor.Enabled = false; fmain.ts_save_tumor.Enabled = false; fmain.ts_search_tumor.Enabled = true; fmain.ts_print_tumor.Enabled = false; fmain.ts_cancel_tumor.Enabled = false;
     ClassSql.DbClose();
 }