private void BindProchklistMapPackage(string Prochklist)
 {
     exc = new ExcData();
     string SQL = "SELECT [ProChkList] ,[PackageCode] FROM [tblProchklistMapPackage] where [ProChkList] = '" + Prochklist  + "' AND StatusFlag = 'A'";
     gvProchklistMapPackage.DataSource = exc.data_Table(SQL);
     gvProchklistMapPackage.Refresh();
 }
 private void BindProChkList()
 {
     exc = new Database.ExcData();
     string SQL = "SELECT [CheckList] ,[CheckListDesc] FROM [Checklist] ORDER BY CheckList DESC";
     ddlProChkList.DataSource = exc.data_Table(SQL);
     ddlProChkList.DisplayMember = "CheckList";
     ddlProChkList.ValueMember = "CheckList";
     ddlProChkList.Refresh();
 }
 private void btFind_Click(object sender, EventArgs e)
 {
     ExcData exc = new ExcData();
     DataTable dtPatient = new DataTable();
     string DateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd") + " " + dtpTimeFrom.Value.ToString("HH:mm");
     string DateTo = dtpDateTo.Value.ToString("yyyy-MM-dd") + " " + dtpTimeTo.Value.ToString("HH:mm");
     string SQL = "SELECT Forename as Name , Surname as LastName , DOE , ProChkList, NO FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "'";
     dtPatient = exc.data_Table(SQL);
     gvPatient.DataSource = dtPatient;
     gvPatient.Columns["Check"].Width = 50;
     gvPatient.Refresh();
     lblCountPT.Text = dtPatient.Rows.Count.ToString();
     CheckAll();
 }
Exemplo n.º 4
0
 //public string FindPatientScheduleOrderUID(string PatientUID, string DOE)
 //{
 //    string PatientScheduleOrderUID = "";
 //    string SQL = "select UID,ScheduleOrderNumber from PatientScheduleOrder where PatientUID = '" + PatientUID + "' and ScheduledDttm = '" + DOE + "'";
 //    exc = new ExcData();
 //    DataTable dt = new DataTable();
 //    dt = exc.data_Table(SQL);
 //    PatientScheduleOrderUID = dt.Rows[0]["UID"].ToString();
 //    return PatientScheduleOrderUID;
 //    SqlCommand cmd = new SqlCommand();
 //    DataTable dt = new DataTable();
 //    string SQL = @"select UID,ScheduleOrderNumber from PatientScheduleOrder where PatientUID = '" + PatientUID + "' and ScheduledDttm = '" + DOE + "'";
 //    string PatientUID = string.Empty;
 //    try
 //    {
 //        this.Connect();
 //        cmd.Connection = con;
 //        cmd.CommandType = CommandType.Text;
 //        cmd.CommandText = SQL;
 //        dt.Load(cmd.ExecuteReader());
 //        PatientUID = dt.Rows[0]["UID"].ToString();
 //    }
 //    catch (Exception er)
 //    {
 //        MessageBox.Show(er.Message.ToString());
 //    }
 //    finally
 //    {
 //        this.Disconnect();
 //    }
 //    return PatientUID;
 //}
 public DataTable FindPackage(string PackageCode)
 {
     DataTable dt = new DataTable();
     string SQL = "select UID , PackageName from BillPackage where Code = '" + PackageCode + "'";
     exc = new ExcData();
     dt = exc.data_Table(SQL);
     return dt;
 }
 private void btSave_Click(object sender, EventArgs e)
 {
     exc = new ExcData();
     string SQL = string.Empty;
     string SQLChk = string.Empty;
     int NowRow = 0;
     foreach (DataGridViewRow row in gvPackage.Rows)
     {
         //Loop ทำงานเฉพาะคนที่ Check Box
         if (Convert.ToBoolean(row.Cells["Check"].Value) == true)
         {
             SQLChk = "SELECT * FROM [tblProchklistMapPackage] where ProChkList = '" + ddlProChkList.SelectedValue.ToString() + "' and PackageCode = '" + gvPackage.Rows[NowRow].Cells["Code"].Value.ToString() + "' and StatusFlag = 'A'";
             DataTable dtChk = new DataTable();
             dtChk = exc.data_Table(SQLChk);
             if (dtChk.Rows.Count <= 0 || dtChk == null)
             {
                 SQL = "INSERT INTO [tblProchklistMapPackage]([ProChkList] ,[PackageCode] ,[StatusFlag])"
                     + " VALUES('" + ddlProChkList.SelectedValue.ToString() + "' ,'" + gvPackage.Rows[NowRow].Cells["Code"].Value.ToString() + "' ,'A')";
                 if (exc.ExecData(SQL) == false)
                 {
                     MessageBox.Show("Save package code : " + gvPackage.Rows[NowRow].Cells["Code"].Value.ToString() + " failed.");
                 }
             }
         }
         NowRow++;
     }
     BindProchklistMapPackage(ddlProChkList.SelectedValue.ToString());
 }
Exemplo n.º 6
0
        private void btFind_Click(object sender, EventArgs e)
        {
            ExcData exc = new ExcData();

            string DateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd") + " " + dtpTimeFrom.Value.ToString("HH:mm");
            string DateTo = dtpDateTo.Value.ToString("yyyy-MM-dd") + " " + dtpTimeTo.Value.ToString("HH:mm");
                string SQL = string.Empty;
            if(lblGenLabNo.Checked == true)
            {
                SQL = "SELECT Forename as Name , Surname as LastName , DOE , [NO] , [ChildCompany],[STS] FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' ORDER BY NO";
            }
            else
            {
                SQL = "SELECT Forename as Name , Surname as LastName , DOE , [NO] , [ChildCompany],[STS] FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' AND STS in ('A','R') ORDER BY STS DESC , NO";
            }

            dtPatient = exc.data_Table(SQL);
            bs.DataSource = dtPatient;
            gvPatient.DataSource = bs;
            gvPatient.Refresh();

            lblCountPT.Text = dtPatient.Rows.Count.ToString();

            if (lblGenLabNo.Checked == true)
            {
                CheckAll();
            }
            else
            {
                CheckOnlyStatusRA();
            }
        }
        private void btFind_Click(object sender, EventArgs e)
        {
            ExcData exc = new ExcData();

            string DateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd") + " " + dtpTimeFrom.Value.ToString("HH:mm");
            string DateTo = dtpDateTo.Value.ToString("yyyy-MM-dd") + " " + dtpTimeTo.Value.ToString("HH:mm");
            string SQL = string.Empty;
            var strSQL = new StringBuilder();
            if (rdbPayor.IsChecked == true)
            {
                strSQL.Append("SELECT A.HN,A.Name,A.LastName,A.DOE,A.[NO],A.[Payor],B.[BookCreate],A.[Shift],A.[LabEpisode] LabNo,A.[DOB] ");
                strSQL.Append("FROM [Patient] A ");
                strSQL.Append("LEFT JOIN tblPatientList B ON A.HN=B.HN AND A.DOE=B.DOE ");
                strSQL.Append("WHERE A.DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' ORDER BY NO;");
                //SQL = "SELECT HN, Name , LastName , DOE , [NO] , [Payor],[BookCreate],[Shift], [LabEpisode] LabNo ,[DOB] FROM [Patient] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' ORDER BY NO";
            }
            else
            {
                strSQL.Append("SELECT A.HN,A.Name,A.LastName,A.DOE,A.[NO],A.[Payor],B.[BookCreate],A.[Shift],A.[LabEpisode] LabNo,A.[DOB] ");
                strSQL.Append("FROM [Patient] A ");
                strSQL.Append("LEFT JOIN tblPatientList B ON A.HN=B.HN AND A.DOE=B.DOE ");
                strSQL.Append("WHERE A.HN='" + txtHN.Text.Trim() + "' ORDER BY NO;");
                //SQL = "SELECT HN, Name , LastName , DOE , [NO] , [Payor],[BookCreate],[Shift], [LabEpisode] LabNo ,[DOB] FROM [Patient] WHERE HN = '" + txtHN.Text.Trim() + "' ORDER BY DOE DESC";
            }
            dtPatient = exc.data_Table(strSQL.ToString());
            strSQL.Length = 0; strSQL.Capacity = 0;
            if (dtPatient != null && dtPatient.Rows.Count > 0)
            {
                bs.DataSource = dtPatient;
                gvPatient.DataSource = bs;

                gvPatient.Columns["HN"].Width = 80;
                gvPatient.Columns["Name"].Width = 130;
                gvPatient.Columns["LastName"].Width = 130;
                gvPatient.Columns["DOE"].Width = 100;
                gvPatient.Columns["NO"].Width = 50;
                gvPatient.Columns["Payor"].Width = 200;
                gvPatient.Columns["BookCreate"].Width = 100;
                gvPatient.Columns["Shift"].Width = 80;
                gvPatient.Columns["LabNo"].Width = 50;
                gvPatient.Columns["DOB"].Width = 50;
                gvPatient.Refresh();
            }
            else
            {
                MessageBox.Show("ไม่พบข้อมูล");
            }
            lblCountPT.Text = dtPatient.Rows.Count.ToString() + " Record.";

            CheckAll();
        }
 private DataTable FindProchklistMapPackage(string ProChkList)
 {
     exc = new ExcData();
     //db = new SQL();
     string SQL = "SELECT [ProChkList] ,[PackageCode] FROM [tblProchklistMapPackage] WHERE [ProChkList] = '" + ProChkList + "' AND StatusFlag = 'A'";
     return exc.data_Table(SQL);
 }
        private void btFind_Click(object sender, EventArgs e)
        {
            ExcData exc = new ExcData();
            DataTable dtPatient = new DataTable();
            string DateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd") + " " + dtpTimeFrom.Value.ToString("HH:mm");
            string DateTo = dtpDateTo.Value.ToString("yyyy-MM-dd") + " " + dtpTimeTo.Value.ToString("HH:mm");
            string SQL = "SELECT Forename as Name , Surname as LastName , DOE , ProChkList, NO, ChildCompany FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "'";
            dtPatient = exc.data_Table(SQL);

            bs.DataSource = dtPatient;
            gvPatient.DataSource = bs;
            gvPatient.Columns["Name"].Width = 150;
            gvPatient.Columns["LastName"].Width = 150;
            gvPatient.Columns["DOE"].Width = 140;
            gvPatient.Columns["NO"].Width = 50;
            gvPatient.Columns["ChildCompany"].Width = 200;
            gvPatient.Columns["ProChkList"].Width = 100;
            gvPatient.Refresh();
            lblCountPT.Text = dtPatient.Rows.Count.ToString();
            CheckAll();

            txtFilterPayor.Enabled = true;
            btLoad.Enabled = true;
        }
        private void btFind_Click(object sender, EventArgs e)
        {
            ExcData exc = new ExcData();

            string DateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd") + " " + dtpTimeFrom.Value.ToString("HH:mm");
            string DateTo = dtpDateTo.Value.ToString("yyyy-MM-dd") + " " + dtpTimeTo.Value.ToString("HH:mm");
            string SQL = string.Empty;

            SQL = "SELECT Forename as Name , Surname as LastName , DOE , [NO] , [ChildCompany],HNStatus,[STS] FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' ORDER BY NO";

            dtPatient = exc.data_Table(SQL);
            bs.DataSource = dtPatient;
            gvPatient.DataSource = bs;

            gvPatient.Columns["Name"].Width = 150;
            gvPatient.Columns["LastName"].Width = 150;
            gvPatient.Columns["DOE"].Width = 140;
            gvPatient.Columns["NO"].Width = 50;
            gvPatient.Columns["ChildCompany"].Width = 230;
            gvPatient.Columns["HNStatus"].Width = 50;
            gvPatient.Columns["STS"].Width = 50;
            gvPatient.Refresh();

            lblCountPT.Text = dtPatient.Rows.Count.ToString() + " Record.";

            CheckAll();
        }