protected void show_now() //沒有_PAT_ID的時候, 用這個函式來顯示頁面(不論是歷史病患或是當前病患) { DateTime datetime = DateTime.Now; int iOrn = 0; string weekType = (0 == (iOrn = datetime.DayOfWeek.GetHashCode()) ? 7 : iOrn).ToString(); String date = datetime.ToString("yyyy-MM-dd"); String sql; sql = "SELECT p.pif_id, P.pif_name, if (P.pif_sex = 'M','男','女') as sex, P.pif_dob, P.pif_ic, "; sql += "if (b.next_visit_date > '','腹透','血透') as txt_10, "; sql += "b.next_visit_date AS FirstDate, e.dat_9 AS InfoDate, "; sql += "if (g.BI > 0,'V',' ') as txt_101, "; sql += "case f.opt_1 when '1' then '退出' when '2' then '移植' when '3' then '转出' when '4' then '死亡' when '5' then '转入' else '' end AS opt_52, "; sql += "f.info_date, p.pif_docname "; sql += "FROM mac_setup M "; sql += "LEFT JOIN appointment_setup A ON M.mac_flr = A.apptst_flr "; sql += "AND M.mac_sec = A.apptst_sec AND M.mac_bedno = A.apptst_bed AND A.apptst_daytyp='" + weekType + "'"; sql += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + date + "'"; sql += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic "; sql += "LEFT JOIN zinfo_f_012 e ON P.pif_id = e.pat_id "; sql += "LEFT JOIN zinfo_a_07 f ON P.pif_id = f.pat_id "; sql += "LEFT JOIN (SELECT pat_id, MAX(dat_3) AS next_visit_date FROM zinfo_p_06 group by pat_id) b ON P.pif_id=b.pat_id "; sql += "LEFT JOIN BI_SUM_View g ON P.pif_id = g.pat_no "; sql += "WHERE P.pif_id IS NOT NULL "; sql += "ORDER BY A.apptst_timetyp, M.mac_flr, M.mac_bedno"; DataTable dt = db.Query(sql); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
private void LoadDinhBienNhanSu() { int count = 0; var source = new DinhBienNhanSuController().GetByYearAndSearchKey(0, string.Empty, ref count); var store = GridPanel1.GetStore(); store.DataSource = source; store.DataBind(); }
void DataBinder() { DataFactory dal = new DataFactory(); DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ServiceMode_SP", new List <IFields>() { dal.CreateIFields() .Append("Option", "List") .Append("sm_STAT", FSecurityHelper.CurrentUserDataGET()[12]) .Append("dept", userDept) }).GetList(); if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (!string.IsNullOrEmpty(Request["Code"])) { var list = (from p in ds.Tables[0].AsEnumerable() where p.Field <string>("sm_CODE").Equals(txtCode.Text) select p).AsDataView(); if (list.Count > 0) { txtCode.Text = list[0][1].ToString(); CmbCalc.Text = list[0][3].ToString(); CmbGroup.Text = list[0][6].ToString(); txtLine.Text = list[0][4].ToString(); txtDes.Text = list[0][2].ToString(); txtRowID.Text = list[0][0].ToString(); ChbActive.Checked = Convert.ToBoolean(list[0][5].ToString()); string[] statlist = string.IsNullOrEmpty(list[0]["StatList"].ToString()) ? new string[] { } : list[0]["StatList"].ToString().Split(','); CheckGroupClear(); foreach (string str in statlist) { for (int i = 0; i < tblChkGroup.Items.Count(); ++i) { if (tblChkGroup.Items[i].Tag.ToString().Trim().ToUpper() == str.Trim().ToUpper()) { tblChkGroup.Items[i].Checked = true; break; } } } } } if (txtCode.Text != "") { div_bottom.Html = "<p class=''>Status : Edit the record of <span>" + txtCode.Text + "</span>.</p>"; txtCode.Disabled = true; } GridPanel1.GetStore().DataSource = ds; GridPanel1.GetStore().DataBind(); } else { div_bottom.Html = "<p class=''>Status: New Service Mode record .</p>"; } }
private void BindGrid() { DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_PRINTER_SP", new List <IFields>() { dal.CreateIFields().Append("Option", "gradbind") .Append("prt_STAT", CmbStat.SelectedItem.Value) }).GetList(); GridPanel1.GetStore().DataSource = ds; GridPanel1.GetStore().DataBind(); }
protected void show_grid() { string SQL = "SELECT * FROM shift "; SQL += "WHERE sdate IN ('" + _Get_YMD2(txtBegin_DATE.Text) + "', '" + _Get_YMD2(txtEnd_DATE.Text) + "') "; SQL += "ORDER BY sdate DESC"; DataTable dt = db.Query(SQL); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
void DataBinder(string stat) { DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Print_SP", new List <IFields>() { dal.CreateIFields() .Append("Option", "List") .Append("prt_STAT", stat) }).GetList(); GridPanel1.GetStore().DataSource = ds; GridPanel1.GetStore().DataBind(); }
protected void show_grid() { string sql; sql = "SELECT DISTINCT DATE_FORMAT(a.dialysis_date, '%Y-%m-%d') "; sql += "from data_list a where a.person_id = '" + _PAT_IC + "' "; sql += "ORDER BY dialysis_date DESC"; DataTable dt = db.Query(sql); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); }
protected void show_history() { string sql; DateTime datetime = DateTime.Now; sql = " SELECT a.pif_id, a.pif_name, if (a.pif_sex = 'M','男','女') as sex, a.pif_dob, a.pif_ic, "; sql += "if (b.next_visit_date > '','腹透','血透') as txt_10, "; sql += "e.diadate AS FirstDate, '' AS InfoDate, "; sql += "if (g.BI > 0,'V',' ') as txt_101, "; sql += "case f.opt_1 when '1' then '退出' when '2' then '肾移植' when '3' then '转出' when '4' then '死亡' when '5' then '转入' else '' end AS opt_52, "; sql += "f.info_date, a.pif_docname "; sql += "FROM pat_info a "; sql += "LEFT JOIN zinfo_maim c ON a.pif_id=c.pat_id "; sql += "LEFT JOIN (SELECT cln1_patic, MAX(cln1_diadate) AS diadate FROM clinical1_nurse group by cln1_patic) e ON a.pif_ic = e.cln1_patic "; sql += "LEFT JOIN zinfo_a_07 f ON a.pif_id = f.pat_id "; sql += "LEFT JOIN (SELECT pat_id, MAX(dat_3) AS next_visit_date FROM zinfo_p_06 group by pat_id) b ON a.pif_id=b.pat_id "; sql += "LEFT JOIN BI_SUM_View g ON a.pif_id = g.pat_no "; sql += "WHERE 1=1"; if (!string.IsNullOrEmpty(Text_Name.Text)) //姓名篩選 { sql += " and a.pif_name like '%" + Text_Name.Text + "%'"; } if (!string.IsNullOrEmpty(Cbo_Gender.Text)) //姓別篩選 { sql += " and a.pif_sex ='" + GetComboBoxValue(Cbo_Gender) + "'"; } if (!string.IsNullOrEmpty(Text_ID.Text)) //身分證號篩選 { if (Text_ID.Text.Substring(0, 1) != "#") { sql += " and a.pif_ic like '%" + Text_ID.Text + "%'"; } else { sql += " and a.pif_id='" + Text_ID.Text.Substring(1) + "'"; } } if (Common.GetComboBoxText(cbo_Status).ToString() != "") { sql += " AND f.opt_1=" + Common.GetComboBoxValue(cbo_Status).ToString(); } else { sql += " AND f.opt_1 IS Null"; } sql += " ORDER BY a.pif_id "; DataTable dt = db.Query(sql); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void show_grid() { string sSQL = "SELECT uid, Month, Name, Size, SaveDateTime FROM pat_monthdoc "; sSQL += "WHERE uid>0 "; sSQL += "ORDER BY uid DESC"; DataTable dt = db.Query(sSQL); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void show_grid() { string SQL = "SELECT pat_id, info_date, info_user, txt_leader, txt_nurse FROM zinfo_h_08 "; SQL += "WHERE pat_id='" + _PAT_ID + "' "; SQL += "ORDER BY info_date DESC"; DataTable dt = db.Query(SQL); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void show_grid() { string sql = "SELECT pat_id, info_date, dat_1, info_user FROM zinfo_f_06_alasamo "; sql += " WHERE pat_id = '" + _PAT_ID + "' "; sql += "ORDER BY info_date DESC"; DataTable dt = db.Query(sql); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
public void BindGrid(int paramPageIndex, int paramPageSize) { try { string BeginDate = txtBeginDate.Value.Trim(); string EndDate = txtEndDate.Value.Trim(); List <XMLogisticsProject> list = XMLogisticsInfoService.getXMLogisticsProjectList(BeginDate, EndDate, ddlLogisticsCompany.Text); Ext.Net.Store Store1 = GridPanel1.GetStore(); Store1.DataSource = list; Store1.DataBind(); } catch (Exception ex) { Ext.Net.ExtNet.Msg.Alert("提示", ex.Message).Show(); } }
protected void show_grid() { string sSQL = "SELECT * FROM pat_patrol "; //sSQL += "LEFT JOIN pat_info B ON A.pif_ic = B.pif_ic "; sSQL += "WHERE pif_ic='" + _PAT_IC + "' "; if (Doct_Name.Text == "") { sSQL += "AND pat_date>='" + _Get_YMD(start_date.Text) + "' AND pat_date<='" + _Get_YMD(end_date.Text) + "' "; } else { sSQL += "AND pat_emp like '%" + Doct_Name.Text + "%' "; } sSQL += "ORDER BY pat_date DESC"; DataTable dt = db.Query(sSQL); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void Load_Appointment() { toDay = DateTime.Now.ToString("yyyy-MM-dd"); string sSQL = ""; //sSQL = "SELECT a.apptst_patic AS pat_ic, b.pif_name AS pat_name, a.apptst_flr AS floor, a.apptst_sec AS area, a.apptst_bed AS bedno, a.apptst_mactyp AS mactype, a.apptst_daytyp AS daytype, a.apptst_timetyp AS timetype "; //sSQL += "FROM appointment_setup a "; //sSQL += "LEFT JOIN pat_info b ON b.pif_ic=a.apptst_patic "; //sSQL += "WHERE b.pif_ic='" + Text_IC.Text + "' "; //sSQL += "UNION "; //sSQL += "SELECT a.ah_patic AS pat_ic, b.pif_name AS pat_name, a.ah_flr AS floor, a.ah_sec AS area, a.ah_bed AS bedno, a.ah_mactyp AS mactype, a.ah_dycnt AS daytype, a.ah_timetyp AS timetype "; //sSQL += "FROM appointment_change a "; //sSQL += "LEFT JOIN pat_info b ON b.pif_ic=a.ah_patic "; //sSQL += "WHERE a.ah_patic='" + Text_IC.Text + "' AND a.ah_date>='" + toDay + "' "; sSQL = "SELECT b.pif_ic AS pat_ic, b.pif_name AS pat_name, a.pv_floor AS floor, a.pv_sec AS area, a.pv_bedno AS bedno, a.appointment_date as ddate, '0' AS daytype, a.time_type as timetype "; sSQL += "FROM appointment a "; sSQL += "LEFT JOIN pat_info b ON a.pif_id=b.pif_id "; sSQL += "WHERE (b.pif_name='" + Text_Name.Text + "' OR b.pif_ic='" + Text_IC.Text + "') AND a.appointment_date>='" + toDay + "' "; sSQL += "UNION "; sSQL += "SELECT a.ah_patic AS pat_ic, b.pif_name AS pat_name, a.ah_flr AS floor, a.ah_sec AS area, a.ah_bed AS bedno, a.ah_date AS ddate, a.ah_dycnt AS daytype, a.ah_timetyp AS timetype "; sSQL += "FROM appointment_change a "; sSQL += "LEFT JOIN pat_info b ON a.ah_patic=b.pif_ic "; sSQL += "WHERE (b.pif_name='" + Text_Name.Text + "' OR a.ah_patic='" + Text_IC.Text + "') AND a.ah_date>='" + toDay + "' "; sSQL += "ORDER BY ddate"; DataTable dt = db.Query(sSQL); System.Data.DataView dv = dt.DefaultView; for (int i = 0; i < dt.Rows.Count; i++) { DateTime ddate = Convert.ToDateTime(dt.Rows[i]["ddate"].ToString()); dv[i]["daytype"] = GetWeekNo((int)ddate.DayOfWeek); dv[i]["timetype"] = set_ctime(dt.Rows[i]["timetype"].ToString()); } Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void Query_click(object sender, DirectEventArgs e) { DateTime date1 = Convert.ToDateTime(InsertDate.Text); string sSQL; sSQL = "SELECT a.mac_flr AS floor, a.mac_sec AS area, a.mac_bedno AS bedno "; sSQL += ",case '" + Common.GetComboBoxValue(timetype) + "' when '001' then '上午' when '002' then '下午' when '003' then '晚上' end AS timetype "; sSQL += "FROM mac_setup a "; sSQL += "WHERE a.mac_bedno not in "; sSQL += "(SELECT c.mac_bedno FROM mac_setup c "; sSQL += "LEFT JOIN appointment_setup b ON b.apptst_flr =c.mac_flr AND b.apptst_sec =c.mac_sec AND b.apptst_bed =c.mac_bedno "; sSQL += "WHERE c.mac_status='Y' AND b.apptst_daytyp='" + ((int)date1.DayOfWeek).ToString() + "' "; if (timetype.Text != "") { sSQL += "AND b.apptst_timetyp='" + Common.GetComboBoxValue(timetype) + "' "; } sSQL += ") ORDER BY a.mac_flr, a.mac_sec, a.mac_bedno"; DataTable dt = db.Query(sSQL); Store istore = GridPanel1.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void Load_Appointment() { var datasource = new List <BedWeeklySchedule>(); string floor, timetype, area, bedno, mac_typ, machine, kind; floor = Common.GetComboBoxValue(cboFLOOR); if (floor == "") { floor = sFLOOR.Text; } area = Common.GetComboBoxValue(cboArea); if (area == "") { area = sAREA.Text; } timetype = Common.GetComboBoxValue(cboTIME); if (timetype == "") { timetype = sTIME.Text; } else { sTIME.Text = timetype; } string sql = "SELECT a.mac_flr, a.mac_sec, a.mac_bedno, a.mac_typ, a.mac_kind, b.genst_desc AS machine FROM mac_setup a "; sql += "LEFT JOIN general_setup b ON b.genst_code=a.mac_brand "; sql += "WHERE a.mac_status='Y' AND mac_flr='" + floor + "' AND b.genst_ctg='macbrd' "; if (area != "全区") { sql += "AND a.mac_sec='" + area + "' "; } sql += "ORDER BY a.mac_sec, a.mac_bedno"; DataTable dt1 = db.Query(sql); if (dt1.Rows.Count > 0) { foreach (DataRow dr1 in dt1.Rows) { area = dr1["mac_sec"].ToString(); bedno = dr1["mac_bedno"].ToString(); mac_typ = dr1["mac_typ"].ToString(); machine = dr1["machine"].ToString(); kind = dr1["mac_kind"].ToString(); sql = "SELECT a.apptst_patic, a.apptst_daytyp, b.pif_name FROM appointment_setup a "; sql += "LEFT JOIN pat_info b ON b.pif_ic=a.apptst_patic "; sql += "WHERE a.apptst_flr='" + floor + "' AND a.apptst_sec='" + area + "' AND a.apptst_bed='" + bedno + "' AND a.apptst_timetyp='" + timetype + "' "; sql += "ORDER BY a.apptst_daytyp"; DataTable dt2 = db.Query(sql); BedWeeklySchedule.Patient[] patname = new BedWeeklySchedule.Patient[7]; int i = 0; for (i = 0; i < 7; i++) { patname[i] = new BedWeeklySchedule.Patient { Id = "", Name = "", IsChanged = false }; } foreach (DataRow dr2 in dt2.Rows) { i = int.Parse(dr2["apptst_daytyp"].ToString()) - 1; string patic = dr2["apptst_patic"].ToString(); string pif_name = dr2["pif_name"].ToString(); if (dr2["apptst_daytyp"].ToString() == sWEEK.Text) { string sSQL = "SELECT pv_ic FROM pat_visit WHERE pv_ic='" + patic + "' AND pv_datevisit='" + toDay + "'"; DataTable sdt = db.Query(sSQL); if (sdt.Rows.Count > 0) { pif_name += "ST"; } } patname[i] = new BedWeeklySchedule.Patient { Id = patic, Name = pif_name }; } #region 增加臨時預約病患 //int j = GetWeekNo(); DateTime thisDay; for (i = 0; i < 7; i++) { int iweek = Convert.ToInt16(DateTime.Now.DayOfWeek); if (iweek == 0) { iweek = 7; } thisDay = DateTime.Now.AddDays(Convert.ToDouble(1 - iweek) + i); sql = "SELECT a.*, b.pif_name FROM appointment_change a "; sql += "LEFT JOIN pat_info b ON a.ah_patic=b.pif_ic "; sql += "WHERE a.ah_date='" + thisDay.ToString("yyyy-MM-dd") + "' AND a.ah_flr='" + floor + "' AND a.ah_sec='" + area + "' AND a.ah_bed='" + bedno + "' AND a.ah_timetyp='" + timetype + "' "; DataTable dt0 = db.Query(sql); if (dt0.Rows.Count > 0) { string patId = dt0.Rows[0]["ah_patic"] == null ? "" : dt0.Rows[0]["ah_patic"].ToString(); if (patId != "") { //dt2前面宣告使用過: 檢查沒有排入預設排班者,就是臨時排班病人 dt2 = db.Query("SELECT apptst_bed FROM appointment_setup WHERE apptst_patic='" + patId + "'"); string patName = dt0.Rows[0]["pif_name"].ToString(); if (dt0.Rows[0]["ah_dycnt"].ToString() == sWEEK.Text) { string sSQL = "SELECT pv_ic FROM pat_visit WHERE pv_ic='" + dt0.Rows[0]["ah_patic"].ToString() + "' AND pv_datevisit='" + toDay + "'"; DataTable sdt = db.Query(sSQL); if (sdt.Rows.Count > 0) { patName += "ST"; } } if (dt2.Rows.Count == 0) { patName += "(临)"; } patname[i] = new BedWeeklySchedule.Patient { Id = patId, Name = patName, IsChanged = true }; } else { patname[i] = new BedWeeklySchedule.Patient { Id = "", Name = "", IsChanged = true }; } } } #endregion datasource.Add(new BedWeeklySchedule(floor, area, bedno, mac_typ, patname[0], patname[1], patname[2], patname[3], patname[4], patname[5], patname[6], machine, timetype, kind)); } Store store = GridPanel1.GetStore(); store.DataSource = datasource; store.DataBind(); } }
private void BindData() { var store = this.GridPanel1.GetStore(); DataFactory dal = new DataFactory(); DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Location_SP", new List <IFields>() { dal.CreateIFields().Append("Option", "List") .Append("SYS", sys) .Append("code", Request["code"]) .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12]) .Append("dept", FSecurityHelper.CurrentUserDataGET()[28]) }).GetList(); if (ds != null && ds.Tables[0].Rows.Count > 0) { store.DataSource = ds.Tables[0]; store.DataBind(); if (!string.IsNullOrEmpty(Request["code"])) { var list = (from p in ds.Tables[0].AsEnumerable() where p.Field <string>("Code").Equals(Code.Text) select p).AsDataView(); if (list.Count > 0) { Code.Text = list[0]["Code"].ToString(); AirAgent.Text = list[0]["AIR"].ToString(); OceanAgent.Text = list[0]["OCEAN"].ToString(); Name.Text = list[0]["Name"].ToString(); Country.Text = list[0]["Country"].ToString(); City.Text = list[0]["City"].ToString(); Currency.Text = list[0]["Currency"].ToString(); hidRowID.Text = list[0]["RowID"].ToString(); chkActive.Checked = list[0]["Active"].ToString() == "1" ? true : false; string[] statlist = string.IsNullOrEmpty(list[0]["StatList"].ToString()) ? new string[] { } : list[0]["StatList"].ToString().Split(','); CheckGroupClear(); foreach (string str in statlist) { for (int i = 0; i < tblChkGroup.Items.Count(); ++i) { if (tblChkGroup.Items[i].Tag.ToString().Trim().ToUpper() == str.Trim().ToUpper()) { tblChkGroup.Items[i].Checked = true; break; } } } } } if (Code.Text != "") { div_bottom.Html = "<p class=''>Status : Edit the record of <span>" + Code.Text + "</span> .</p>"; Code.Disabled = true; } GridPanel1.GetStore().DataSource = ds; GridPanel1.GetStore().DataBind(); } else { div_bottom.Html = "<p class=''>Status: New location record . </p>"; } //修改Grace 2014-09-23 //不需要在这里给文本框赋值,否则赋值的结果永远是第一个 //if (!string.IsNullOrEmpty(Request["code"]) && Code.Text != "") //{ // //if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) // //{ // // hidRowID.Text = ds.Tables[0].Rows[0]["RowID"].ToString(); // // Code.Text = ds.Tables[0].Rows[0]["Code"].ToString(); // // Code.Disabled = true; // // Name.Text = ds.Tables[0].Rows[0]["Name"].ToString(); // // Country.Text = ds.Tables[0].Rows[0]["Country"].ToString(); // // City.Text = ds.Tables[0].Rows[0]["City"].ToString(); // // Currency.Text = ds.Tables[0].Rows[0]["Currency"].ToString(); // // AirAgent.setValue(ds.Tables[0].Rows[0]["AIR"].ToString()); // // OceanAgent.setValue(ds.Tables[0].Rows[0]["OCEAN"].ToString()); // // div_bottom.Html = "<p class=''>Status : Edit the record of <span>" + Code.Text + "</span> . </p>"; // //} // //else // // div_bottom.Html = "<p class=''>Status : New location record . </p>"; //} //else // div_bottom.Html = "<p class=''>Status : New location record . </p>"; this.Code.Focus(true); }