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(); }
public void Update_EN_IN_ContactCheckup(string OrderNumber ,string EN, string Payor) { ExcData exc = new ExcData(); string SQL = @"UPDATE [Patient] SET [Episode] = '" + EN + "' WHERE [Episode] = '" + OrderNumber + "'"; try { exc.ExecData(SQL); } catch (Exception ex) { ex.ToString(); //MessageBox.Show("Cannot update EN :" + EN + " in Contact Database"); } }
//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 Find() { //if (ddlIsConverted.InvokeRequired) //{ // ddlIsConverted.Invoke(new MethodInvoker(delegate // { // ddlIsConverted.SelectedIndex = 0; // })); //} //else //{ // ddlIsConverted.SelectedIndex = 0; //} setRadButton(btFind, false); setPictureBox(pbCountPT, true); setLabel(lblCountPT, ""); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); ExcData exc = new ExcData(); if (gvPatient.InvokeRequired) { gvPatient.Invoke(new MethodInvoker(delegate { if (gvPatient.Rows.Count > 0) { gvPatient.DataSource = null; gvPatient.Rows.Clear(); } })); } else { if (gvPatient.Rows.Count > 0) { gvPatient.DataSource = null; gvPatient.Rows.Clear(); } } 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(); var clsSQL = new clsSQLNative(); var clsTempData = new clsTempData(); var payor = ""; #region SQLQuery strSQL.Append("SELECT "); strSQL.Append("P.NO,"); strSQL.Append("P.HN,"); strSQL.Append("LTRIM(REPLACE(P.Name, P.PreName, ''))Name,"); strSQL.Append("P.LastName,"); strSQL.Append("P.DOE,"); strSQL.Append("P.Payor,"); strSQL.Append("PL.ChildCompany,"); strSQL.Append("P.StatusOnMobile STS,"); strSQL.Append("CL.RegDate RegisterDate,"); strSQL.Append("P.rowguid PatientUID,"); strSQL.Append("P.SyncWhen,'0' IsConvertPreOrder "); strSQL.Append("FROM "); strSQL.Append("Patient P "); strSQL.Append("INNER JOIN tblCheckList CL ON P.rowguid = CL.PatientUID AND WFID = 1 "); if (rbRegister.Checked) { strSQL.Append("AND (CL.ProStatus='2' OR CL.ProStatus='3') "); } strSQL.Append("LEFT JOIN tblPatientList PL ON P.rowguid = PL.PatientUID "); strSQL.Append("WHERE "); strSQL.Append("(CL.RegDate BETWEEN '" + DateFrom + "' AND '" + DateTo + "') "); if (rbAll.Checked) { //SQL += "AND StatusOnMobile in ('A','R') "; } else if (rbNotRegister.Checked) { strSQL.Append("AND StatusOnMobile IS NULL "); } else if (rbRegister.Checked) { strSQL.Append("AND StatusOnMobile='R' "); } if (ddlPayor.InvokeRequired) { ddlPayor.Invoke(new MethodInvoker(delegate { if (ddlPayor.SelectedItem.ToString() != "- ทั้งหมด -") { payor = ddlPayor.SelectedItem.ToString(); payorChoose = payor; strSQL.Append("AND Payor='" + payor + "' "); } })); } else { if (ddlPayor.SelectedItem.ToString() != "- ทั้งหมด -") { payor = ddlPayor.SelectedItem.ToString(); payorChoose = payor; strSQL.Append("AND Payor='" + payor + "' "); } } strSQL.Append("ORDER BY "); //strSQL.Append("CL.RegDate ASC;"); strSQL.Append("DOE DESC;"); #endregion dtPatient = clsSQL.Bind(strSQL.ToString(), clsSQLNative.DBType.SQLServer, "MobieConnect"); strSQL.Length = 0; strSQL.Capacity = 0; clsTempData.dtIsConverted = null; if (dtPatient != null && dtPatient.Rows.Count > 0) { #region Find Min&Max DOE var col = dtPatient.Columns["DOE"]; var minDOE = dtPatient.AsEnumerable() .Select(cols => cols.Field<DateTime>(col.ColumnName)) .OrderBy(p => p.Ticks) .FirstOrDefault(); var maxDOE = dtPatient.AsEnumerable() .Select(cols => cols.Field<DateTime>(col.ColumnName)) .OrderByDescending(p => p.Ticks) .FirstOrDefault(); #endregion try { //setComboBox(ddlIsConverted, 0); } catch (Exception) { } #region Check IsConvertPreOrder for (int i = 0; i < dtPatient.Rows.Count; i++) { if (clsTempData.IsConverted( dtPatient.Rows[i]["Name"].ToString(), dtPatient.Rows[i]["LastName"].ToString(), dtPatient.Rows[i]["DOE"].ToString(), minDOE.ToString("yyyy-MM-dd HH:mm"), maxDOE.ToString("yyyy-MM-dd HH:mm"))) { dtPatient.Rows[i]["IsConvertPreOrder"] = "1"; } } dtPatient.AcceptChanges(); #endregion #region SearchIsConvertFilter /* if (ddlIsConverted.InvokeRequired) { ddlIsConverted.Invoke(new MethodInvoker(delegate { if (ddlIsConverted.SelectedIndex > 0) { DataView dv = dtPatient.DefaultView; if (ddlIsConverted.SelectedItem.ToString() == "เฉพาะที่ยังไม่ Convert") { dv.RowFilter = "IsConvertPreOrder=0"; } else if(ddlIsConverted.SelectedItem.ToString() == "เฉพาะที่ Convert แล้ว") { dv.RowFilter = "IsConvertPreOrder=1"; } dtPatient = dv.ToTable(); } })); } */ #endregion if (gvPatient.InvokeRequired) { gvPatient.Invoke(new MethodInvoker(delegate { bs.DataSource = dtPatient; gvPatient.DataSource = bs; gvPatient.Columns["No"].Width = 20; gvPatient.Columns["HN"].Width = 100; gvPatient.Columns["Name"].Width = 100; gvPatient.Columns["LastName"].Width = 100; gvPatient.Columns["DOE"].Width = 130; gvPatient.Columns["NO"].Width = 40; gvPatient.Columns["Payor"].Width = 170; gvPatient.Columns["ChildCompany"].Width = 170; gvPatient.Columns["STS"].Width = 40; gvPatient.Columns["RegisterDate"].Width = 130; gvPatient.Columns["SyncWhen"].Width = 130; gvPatient.Columns["IsConvertPreOrder"].IsVisible = false; gvPatient.Columns["PatientUID"].IsVisible = false; gvPatient.Refresh(); })); } else { bs.DataSource = dtPatient; gvPatient.DataSource = bs; gvPatient.Columns["No"].Width = 20; gvPatient.Columns["HN"].Width = 100; gvPatient.Columns["Name"].Width = 100; gvPatient.Columns["LastName"].Width = 100; gvPatient.Columns["DOE"].Width = 130; gvPatient.Columns["NO"].Width = 40; gvPatient.Columns["Payor"].Width = 170; gvPatient.Columns["ChildCompany"].Width = 170; gvPatient.Columns["STS"].Width = 40; gvPatient.Columns["RegisterDate"].Width = 130; gvPatient.Columns["SyncWhen"].Width = 130; gvPatient.Columns["IsConvertPreOrder"].IsVisible = false; gvPatient.Columns["PatientUID"].IsVisible = false; gvPatient.Refresh(); } setLabel(lblCountPT, dtPatient.Rows.Count.ToString() + " Record."); setLabel(lblIsConvertCount, string.Format("พบข้อมูลตรงเงื่อนไข {0} รายการ", dtPatient.Rows.Count.ToString())); CheckAll(); IsConvertFilter(); } else { MessageBox.Show("ไม่พบข้อมูลตามเงื่อนไขที่ต้องการ", "No data.", MessageBoxButtons.OK, MessageBoxIcon.Information); setLabel(lblCountPT, "0 Record."); bs.DataSource = null; if (gvPatient.InvokeRequired) { gvPatient.Invoke(new MethodInvoker(delegate { gvPatient.DataSource = bs; gvPatient.Refresh(); })); } else { gvPatient.DataSource = bs; gvPatient.Refresh(); } } setPictureBox(pbCountPT, false); setRadButton(btFind, true); }
private void btFind_Click(object sender, EventArgs e) { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); ExcData exc = new ExcData(); if (gvPatient.Rows.Count > 0) { gvPatient.DataSource = null; gvPatient.Rows.Clear(); } 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(); var clsSQL = new clsSQLNative(); var clsTempData = new clsTempData(); /* SQL = "SELECT [NO] ,HN,Forename as Name , Surname as LastName , DOE , [ChildCompany],[STS],[SyncWhen],'0' IsConvertPreOrder FROM [tblPatientList] WHERE DOE BETWEEN '" + DateFrom + "' AND '" + DateTo + "' "; if (rbAll.Checked) { SQL += "AND STS in ('A','R') "; } else if (rbNotRegister.Checked) { SQL += "AND STS='A' "; } else if (rbRegister.Checked) { SQL += "AND STS='R' "; } if (ddlPayor.SelectedItem.Value.ToString() != "") { SQL += "AND Payor='"+ddlPayor.SelectedItem.Value.ToString()+"' "; } SQL += "ORDER BY SyncWhen,NO"; */ #region SQLQuery strSQL.Append("SELECT "); strSQL.Append("P.NO,"); strSQL.Append("P.HN,"); strSQL.Append("LTRIM(REPLACE(P.Name, P.PreName, ''))Name,"); strSQL.Append("P.LastName,"); strSQL.Append("P.DOE,"); strSQL.Append("PL.ChildCompany,"); strSQL.Append("P.StatusOnMobile STS,"); strSQL.Append("P.SyncWhen,'0' IsConvertPreOrder,"); strSQL.Append("P.rowguid PatientUID "); strSQL.Append("FROM "); strSQL.Append("Patient P "); strSQL.Append("LEFT JOIN tblPatientList PL ON P.rowguid = PL.PatientUID "); if (rbRegister.Checked) { strSQL.Append("INNER JOIN tblCheckList CL ON P.rowguid = CL.PatientUID AND CL.WFID=1 AND (CL.ProStatus='3' OR CL.ProStatus='2') "); } strSQL.Append("WHERE "); strSQL.Append("(P.DOE BETWEEN '"+DateFrom+"' AND '"+DateTo+"') "); strSQL.Append("AND PL.HNStatus='A' "); if (rbAll.Checked) { //SQL += "AND StatusOnMobile in ('A','R') "; } else if (rbNotRegister.Checked) { strSQL.Append("AND StatusOnMobile IS NULL "); } else if (rbRegister.Checked) { strSQL.Append("AND StatusOnMobile='R' "); } if (ddlPayor.SelectedItem.ToString() != "- ทั้งหมด -") { strSQL.Append("AND Payor='" + ddlPayor.SelectedItem.ToString() + "' "); } strSQL.Append("ORDER BY SyncWhen,NO;"); #endregion dtPatient = clsSQL.Bind(strSQL.ToString(), clsSQLNative.DBType.SQLServer, "MobieConnect"); strSQL.Length = 0;strSQL.Capacity = 0; clsTempData.dtIsConverted = null; if(dtPatient!=null && dtPatient.Rows.Count > 0) { try { ddlIsConverted.SelectedIndex = 0; } catch (Exception) { } #region Check IsConvertPreOrder for(int i = 0; i < dtPatient.Rows.Count; i++) { if (clsTempData.IsConverted( dtPatient.Rows[i]["Name"].ToString(), dtPatient.Rows[i]["LastName"].ToString(), dtPatient.Rows[i]["DOE"].ToString(), DateFrom,DateTo)) { dtPatient.Rows[i]["IsConvertPreOrder"] = "1"; } } dtPatient.AcceptChanges(); #endregion bs.DataSource = dtPatient; gvPatient.DataSource = bs; gvPatient.Columns["No"].Width = 20; gvPatient.Columns["HN"].Width = 100; gvPatient.Columns["Name"].Width = 100; gvPatient.Columns["LastName"].Width = 100; gvPatient.Columns["DOE"].Width = 130; gvPatient.Columns["NO"].Width = 40; gvPatient.Columns["ChildCompany"].Width = 170; gvPatient.Columns["STS"].Width = 40; gvPatient.Columns["SyncWhen"].Width = 130; gvPatient.Columns["IsConvertPreOrder"].IsVisible = false; gvPatient.Columns["PatientUID"].IsVisible = false; gvPatient.Refresh(); lblCountPT.Text = dtPatient.Rows.Count.ToString() + " Record."; lblIsConvertCount.Text = dtPatient.Rows.Count.ToString(); CheckAll(); } else { MessageBox.Show("ไม่พบข้อมูลตามเงื่อนไขที่ต้องการ", "No data.", MessageBoxButtons.OK, MessageBoxIcon.Information); lblCountPT.Text = "0 Record."; bs.DataSource = null; gvPatient.DataSource = bs; gvPatient.Refresh(); } }
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()); }
private void btUpdate_Click(object sender, EventArgs e) { exc = new ExcData(); string SQL = "update tblProchklistMapPackage set StatusFlag = 'D' where ProChkList = '" + gvProchklistMapPackage.CurrentRow.Cells["ProChkList"].Value.ToString() + "' and PackageCode = '" + gvProchklistMapPackage.CurrentRow.Cells["PackageCode"].Value.ToString() + "'"; if(exc.ExecData(SQL) == false) { MessageBox.Show("Cannot delete this package"); } BindProchklistMapPackage(ddlProChkList.SelectedValue.ToString()); }
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(); }
public void Update_TblPatientList(string Forename, string Surname, string DOE, string DOB) { ExcData exc = new ExcData(); string SQL = @"UPDATE [tblPatientList] SET [STS] = 'C' WHERE [Forename] = '" + Forename.Trim() +"' and [Surname] = '" + Surname.Trim() +"' and [DOE] = '" + DOE +"' and [DOB] = '" + DOB +"'"; try { exc.ExecData(SQL); } catch (Exception ex) { ex.ToString(); //MessageBox.Show("Cannot update EN :" + EN + " in Contact Database"); } }
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(); }