Esempio n. 1
0
 private void frmViewscan_Load(object sender, EventArgs e)
 {
     try
     {
         frmViewDocScan frmClass = new frmViewDocScan();
         c            = CurrentPage.currentPage;
         countpage    = c;
         lblPage.Text = c + "/" + HistoryData.filelength.ToString();
         if (c == 1 || c == 0)
         {
             imageBox.Image = doc.resizeImage((Image)HistoryData.arrlist[0], new Size(850, 940));
         }
         else
         {
             imageBox.Image = doc.resizeImage((Image)HistoryData.arrlist[c - 1], new Size(850, 940)); //HistoryData.newImage;
         }
         ////Check image page
         if (countpage == 1 && HistoryData.filelength > 1)
         {
             btnNext.Enabled  = true;
             btnFirst.Enabled = false;
         }
         if (countpage == 1 && HistoryData.filelength == 1)
         {
             btnNext.Enabled  = false;
             btnFirst.Enabled = false;
         }
         button1_Click(null, null);
     }
     catch
     {
     }
 }
Esempio n. 2
0
        private void btnFirst_Click(object sender, EventArgs e)
        {
            #region Commented
            //if (HistoryData.count - 1 >= 0)
            //{
            //    pictureBox1.Image = doc.resizeImage((Image)HistoryData.arrlist[HistoryData.count - 1], new Size(450, 500));
            //    //HistoryData.count = HistoryData.count - 1 + 1;
            //    c = HistoryData.count - 1 + 1;
            //    //lblPage.Text = lblPage.Text = HistoryData.count + "/" + HistoryData.filelength.ToString();
            //    lblPage.Text = lblPage.Text = c + "/" + HistoryData.filelength.ToString();
            //}
            #endregion

            try
            {
                if (countpage >= 0)
                {
                    countpage--;
                    //pictureBox1.Image = doc.resizeImage((Image)HistoryData.arrlist[countpage - 1], new Size(450, 500));
                    pictureBox1.Image = doc.resizeImage((Image)HistoryData.arrlist[countpage - 1], new Size(450, 500));
                    lblPage.Text      = lblPage.Text = countpage + "/" + HistoryData.filelength.ToString();
                    int reduceC;
                    reduceC = countpage - 1;//H_countpage - 1;
                    CurrentPage.currentPage = reduceC;
                    H_countpage             = countpage + 1;
                    button1_Click(null, null);
                }
            }
            catch
            {
            }
        }
Esempio n. 3
0
        //Grid  Event
        private void GridResult_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1)
                {
                    string HNno = Convert1.ToString(GridResult["ColHN", e.RowIndex].Value);
                    string En   = Convert1.ToString(GridResult["Colen", e.RowIndex].Value);
                    if (HNno != "")
                    {
                        btnSave.Enabled    = true;
                        btnClear.Enabled   = true;
                        btnPreview.Enabled = true;

                        var objCurrentHN = (from t1 in dbc.trn_pfts
                                            where t1.trn_patient_regi.trn_patient.tpt_hn_no == HNno
                                            select t1).FirstOrDefault();
                        PFTbindingSource1.DataSource = objCurrentHN;
                        if (objCurrentHN != null)
                        {
                            int tpr_id = objCurrentHN.tpr_id;
                            UIProfileHorizontal1.Loaddata(tpr_id, objCurrentHN.trn_patient_regi.mhs_id);// Load Profile
                            var objcurrentQuestionPatient = (from t1 in dbc.trn_ques_patients
                                                             where t1.tpr_id == tpr_id
                                                             select t1).FirstOrDefault();
                            QestionPatientbindingSource1.DataSource = objcurrentQuestionPatient;

                            #region WaitingConfirm
                            ////Load image
                            HistoryData.showform = 'N';
                            //docscan.GetHistory("LR102", "", 4434);
                            docscan.GetHistory("LR102", En, tpr_id);
                            pictureBox_result.SizeMode = PictureBoxSizeMode.AutoSize;
                            pictureBox_result.Image    = docscan.resizeImage(HistoryData.newImage, new Size(450, 500));

                            if (pictureBox_result.Image == null)
                            {
                                btnSend.Enabled    = false;
                                btnPreview.Enabled = false;
                            }
                            else
                            {
                                btnSend.Enabled    = true;
                                btnPreview.Enabled = true;
                            }
                            ////EndLoad image

                            // TestGetDocscan.ServiceSoapClient wsSaveDocscan = new TestGetDocscan.ServiceSoapClient();
                            //DataSet ds = new DataSet();
                            //ds = wsSaveDocscan.getDocumentList("0111006591", "O0113450939", "", "VVF", "A1");
                            //pictureBox_result.SizeMode = PictureBoxSizeMode.AutoSize;
                            //pictureBox_result.Image = docscan.resizeImage(HistoryData.newImage, new Size(450, 500));
                            #endregion
                        }
                    }
                }
            }
            catch
            {
                return;
            }
        }