protected void Page_Load(object sender, EventArgs e) { string gtyr = Request["wgyr"].ToString(); string gtmth = Request["wgmth"].ToString(); string seldt = gtyr + "-" + gtmth; if (gtmth == "99") { DBMysql db = new DBMysql(); string sql; sql = "SELECT cln1_diadate, cln1_col6 from clinical1_nurse "; sql += "where cln1_patic = '" + _PAT_IC + "' "; sql += "and substr(cln1_diadate,1,4) = '" + gtyr + "' "; sql += "order by cln1_diadate DESC, cln1_id DESC"; DataTable dt = db.Query(sql); Store istore = Grid_Weight.GetStore(); istore.DataSource = db.GetDataArray_AddRowNum(db.Query(sql)); istore.DataBind(); } else { DBMysql db = new DBMysql(); string sql; sql = "SELECT cln1_diadate, cln1_col6 from clinical1_nurse "; sql += "where cln1_patic = '" + _PAT_IC + "' "; sql += "and substr(cln1_diadate,1,7) = '" + seldt + "' "; sql += "order by cln1_diadate DESC, cln1_id DESC"; DataTable dt = db.Query(sql); Store istore = Grid_Weight.GetStore(); istore.DataSource = db.GetDataArray_AddRowNum(db.Query(sql)); istore.DataBind(); } }
private void Show_FloorArea() { string sql = "SELECT distinct mac_flr, mac_sec FROM mac_setup WHERE 1=1 ORDER BY mac_flr, mac_sec"; dt = db.Query(sql); if (dt.Rows.Count > 0) { if (Session["PAD_FLOOR"] == null) { sFLOOR.Text = dt.Rows[0]["mac_flr"].ToString(); } else { if (Session["PAD_FLOOR"].ToString() != dt.Rows[0]["mac_flr"].ToString()) { Session["PAD_FLOOR"] = dt.Rows[0]["mac_flr"].ToString(); } sFLOOR.Text = Session["PAD_FLOOR"].ToString(); } if (Session["PAD_AREA"] == null) { sAREA.Text = dt.Rows[0]["mac_sec"].ToString(); } else { sAREA.Text = Session["PAD_AREA"].ToString(); } } sql = "SELECT distinct mac_flr FROM mac_setup WHERE 1=1 ORDER BY mac_flr "; DataTable dt1 = db.Query(sql); for (int i = 0; i < dt1.Rows.Count; i++) { Ext.Net.ListItem litem; litem = new Ext.Net.ListItem(dt1.Rows[i]["mac_flr"].ToString() + "楼", dt1.Rows[i]["mac_flr"].ToString()); this.cboFLOOR.Items.Add(litem); } this.cboFLOOR.GetStore().DataBind(); if (dt1.Rows.Count > 0) { this.cboFLOOR.Disabled = false; this.cboFLOOR.Select(sFLOOR.Text); FILL_AREA(sFLOOR.Text, sAREA.Text); FILL_BED(); } else { this.cboFLOOR.Disabled = true; this.cboAREA.Disabled = true; } db.myConnection.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { string sSQL = "SELECT CLASS2_CODE AS CODE, CLASS2_NAME AS NAME FROM a_class2 WHERE CLASS1_CODE='dialysis_symptom' "; DataTable dt_diagnosis = db.Query(sSQL); Common.SetComboBoxItem(cbo_symptom, dt_diagnosis, false, "NAME", "CODE"); cbo_symptom.Select(0); sSQL = "SELECT CLASS2_CODE AS CODE, CLASS2_NAME AS NAME FROM a_class2 WHERE CLASS1_CODE='blood_pressure' "; DataTable dt_blood_pressure = db.Query(sSQL); Common.SetComboBoxItem(cbo_pressure, dt_blood_pressure, false, "NAME", "CODE"); cbo_pressure.Select(0); patient_id.Text = Request["patient_id"].ToString(); patient_name.Text = Request["patient_name"].ToString(); TextField16.Text = Request["hpack"].ToString();//血管通路類型 area.Text = Request["area"].ToString(); time.Text = Request["time"].ToString(); daytyp.Text = Request["daytyp"].ToString(); bedno.Text = Request["bedno"].ToString(); floor.Text = Request["floor"].ToString(); area.Text = Request["area"].ToString(); mechine_model.Text = Request["mechine_model"].ToString(); hpack.Text = Request["hpack"].ToString(); hpack3.Text = Request["hpack3"].ToString(); info_date1.Text = Request["date"].ToString(); Show(); show_time(); db.myConnection.Close(); } }
private String getUserName(String userId) { String sql = "SELECT * FROM access_level WHERE usrnm='" + userId + "' "; DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) { return(dt.Rows[0]["name"].ToString()); } else { return(userId); } }
public String GetPatName(String Id) { String sql = "SELECT pif_name FROM pat_info WHERE pif_id='" + Id + "' OR pif_ic='" + Id + "' "; DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) { return(dt.Rows[0]["pif_name"].ToString()); } else { return(Id); } }
public void ReadDrugMod_List() { string sql = "SELECT a.sid, b.drg_name, a.intake, a.medway, a.freq "; sql += "FROM drug_modual a "; sql += "LEFT JOIN drug_list b ON a.drg_code=b.drg_code "; sql += "WHERE a.status='Y' "; sql += "ORDER BY a.drg_code"; DataTable dt = db.Query(sql); Store istore = Grid_DrugTerm.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); dt.Dispose(); }
//2015.03.26 ANDY 新床位 protected void FILL_BEDN() { DateTime now = DateTime.Now; this.txtTIME.Text = now.ToString("yyyy-MM-dd HH:mm:ss"); sDATE.Text = this.txtTIME.Text.Substring(0, 10); GET_WEEK(); string sSQL = ""; sSQL = "SELECT A.sched_year AS sched_year,A.sched_mon AS sched_mon, " + " A.sched_flr AS sched_flr,A.sched_sec AS sched_sec,A.sched_bedno AS sched_bedno,A.sched_mactyp AS sched_mactyp,A.sched_timen AS sched_timen," + " A.SCHED_1D_NAME AS SCHED_1D_NAME,A.SCHED_2D_NAME AS SCHED_2D_NAME,A.SCHED_3D_NAME AS SCHED_3D_NAME,A.SCHED_4D_NAME AS SCHED_4D_NAME,A.SCHED_5D AS SCHED_5D," + " A.SCHED_6D AS SCHED_6D,A.SCHED_7D AS SCHED_7D,A.SCHED_8D AS SCHED_8D,A.SCHED_9D AS SCHED_9D,A.SCHED_10D AS SCHED_10D," + " A.SCHED_11D AS SCHED_11D,A.SCHED_12D AS SCHED_12D,A.SCHED_13D AS SCHED_13D,A.SCHED_14D AS SCHED_14D,A.SCHED_15D AS SCHED_15D" + " FROM data_sched A "; DBMysql db = new DBMysql(); System.Data.DataTable dt = db.Query(sSQL); Store istore = grdBED_LISTN.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); if (dt.Rows.Count > 0) { } ; //Column5.Text = "25"; Panel5.Title = WFLOOR.Text + "楼" + WAREA.Text + "区"; }
protected void Page_Load(object sender, EventArgs e) { Area.Text = "A"; if (!X.IsAjaxRequest) { try { DBMysql db = new DBMysql(); string sPAD_HEAD = "Styles/mark.png"; DataTable dtPAD_HEAD = db.Query("SELECT * FROM general_setup WHERE genst_code='IPAD_HEAD'"); if (dtPAD_HEAD.Rows.Count > 0) { sPAD_HEAD = dtPAD_HEAD.Rows[0]["genst_desc"].ToString(); //sPAD_HEAD = Server.MapPath(sPAD_HEAD); Image2.ImageUrl = sPAD_HEAD; } } catch (Exception ex) { //_ErrorMsgShow(ex.Message.ToString()); } } DateTime datetime = DateTime.Now; Tex_Datetime.Text = datetime.ToString("yyyy/MM/dd HH:mm:ss"); int iOrn = 0; daytyp.Text = (0 == (iOrn = datetime.DayOfWeek.GetHashCode()) ? 7 : iOrn).ToString(); // 一般程式(Basic,C,Delphi...) 週末指星期六,其實星期日是每週的第一日。 /* * switch (datetime.DayOfWeek) * { * case DayOfWeek.Monday: * daytyp.Text = "1"; * break; * case DayOfWeek.Tuesday: * daytyp.Text = "2"; * break; * case DayOfWeek.Wednesday: * daytyp.Text = "3"; * break; * case DayOfWeek.Thursday: * daytyp.Text = "4"; * break; * case DayOfWeek.Friday: * daytyp.Text = "5"; * break; * case DayOfWeek.Saturday: * daytyp.Text = "6"; * break; * case DayOfWeek.Sunday: * daytyp.Text = "7"; * break; * } */ }
private void Show_Picture() { try { string sPAD_HEAD = "Styles/mark1.png"; DataTable dtPAD_HEAD = db.Query("SELECT * FROM general_setup WHERE genst_code='IPAD_HEAD'"); if (dtPAD_HEAD.Rows.Count > 0) { sPAD_HEAD = dtPAD_HEAD.Rows[0]["genst_desc"].ToString(); Image2.ImageUrl = sPAD_HEAD; } } catch (Exception ex) { Common._ErrorMsgShow(ex.Message.ToString()); } }
protected void Show_shortdrug() { DBMysql db = new DBMysql(); string sql; sql = "SELECT a.shord_dateord, a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_medway,c.genst_desc,a.shord_dtactst, a.shord_usr2,a.shord_comment "; sql += "from shortterm_ordermgt a, drug_list b, general_setup c"; sql += " where a.shord_patic = '" + _PAT_IC + "'"; sql += " and a.shord_drug = b.drg_code "; sql += " and c.genst_ctg = 'ActiveStatus' "; sql += " and a.shord_actst = c.genst_code order by a.shord_id ASC"; DataTable dt = db.Query(sql); Store istore = Grid_Short_Term.GetStore(); istore.DataSource = db.GetDataArray_AddRowNum(db.Query(sql)); istore.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { string sSQL = "SELECT CLASS2_CODE AS CODE, CLASS2_NAME AS NAME FROM a_class2 WHERE CLASS1_CODE='dialysis_symptom' "; DataTable dt_diagnosis = db.Query(sSQL); Common.SetComboBoxItem(cbo_symptom, dt_diagnosis, false, "NAME", "CODE"); cbo_symptom.Select(0); sSQL = "SELECT CLASS2_CODE AS CODE, CLASS2_NAME AS NAME FROM a_class2 WHERE CLASS1_CODE='blood_pressure' "; DataTable dt_blood_pressure = db.Query(sSQL); Common.SetComboBoxItem(cbo_pressure, dt_blood_pressure, false, "NAME", "CODE"); cbo_pressure.Select(0); patient_id.Text = Request.QueryString["patient_id"]; patient_name.Text = Request.QueryString["patient_name"]; machine_type.Text = Request.QueryString["machine_type"]; bedno.Text = Request.QueryString["bedno"]; floor.Text = Request.QueryString["floor"]; area.Text = Request.QueryString["area"]; time.Text = Request.QueryString["time"]; daytyp.Text = Request.QueryString["daytyp"]; TextField16.Text = Request.QueryString["hpack"]; hpack.Text = Request.QueryString["hpack"]; hpack3.Text = Request.QueryString["hpack3"]; mechine_model.Text = Request.QueryString["mechine_model"]; txt_weight_before.Text = Request.QueryString["patient_weight"]; if (patient_name.Text == null) { patient_name.Text = Request.QueryString["amp;patient_name"]; machine_type.Text = Request.QueryString["amp;machine_type"]; hpack.Text = Request.QueryString["amp;hpack"]; bedno.Text = Request.QueryString["amp;bedno"]; floor.Text = Request.QueryString["amp;floor"]; area.Text = Request.QueryString["amp;area"]; time.Text = Request.QueryString["amp;time"]; daytyp.Text = Request.QueryString["amp;daytyp"]; hpack3.Text = Request.QueryString["amp;hpack3"]; mechine_model.Text = Request.QueryString["amp;mechine_model"]; txt_weight_before.Text = Request.QueryString["amp;patient_weight"]; } Show(); show_time(); db.myConnection.Close(); } }
protected void show_grid() { DBMysql db = new DBMysql(); string sql = string.Format(SQL_SELECT_BY_PATIENT, _PAT_ID); DataTable dt = db.Query(sql); Store istore = Grid_clinical1_nurse.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
public void ReadDataList() { string sql1 = "SELECT dialysis_time, column_7, column_6, column_2, column_3, column_10, column_8, column_4 FROM data_list "; sql1 += "WHERE person_id='" + PationID.Text + "' "; sql1 += "AND dialysis_date='" + DialysisDate.Text + "' "; sql1 += "AND dialysis_time='" + OldTime.Text + "'"; DataTable dt = db.Query(sql1); if (dt.Rows.Count > 0) { diagno.Text = dt.Rows[0]["column_7"].ToString(); Column4.Text = dt.Rows[0]["column_6"].ToString(); Column2.Text = dt.Rows[0]["column_2"].ToString(); Column23.Text = dt.Rows[0]["column_3"].ToString(); Column3.Text = dt.Rows[0]["column_10"].ToString(); Column1.Text = dt.Rows[0]["column_8"].ToString(); Column5.Text = dt.Rows[0]["column_4"].ToString(); } dt.Clear(); string sql2 = "SELECT cln2_date, cln2_time, cln2_t, cln2_p, cln2_r, cln2_bp, cln2_rmk, cln2_user, cln2_dateadded FROM clinical2_nurse "; sql2 += "WHERE cln2_patic='" + PationID.Text + "' "; sql2 += "AND cln2_date='" + DialysisDate.Text + "' "; sql2 += "AND cln2_time='" + OldTime.Text + "'"; dt = db.Query(sql2); if (dt.Rows.Count > 0) { Column6.Text = dt.Rows[0]["cln2_t"].ToString(); Column7.Text = dt.Rows[0]["cln2_p"].ToString(); Column8.Text = dt.Rows[0]["cln2_r"].ToString(); Column9.Text = dt.Rows[0]["cln2_bp"].ToString(); Column10.Text = dt.Rows[0]["cln2_rmk"].ToString(); Column11.Text = dt.Rows[0]["cln2_user"].ToString(); //Column12.Text = dt.Rows[0]["cln2_dateadded"].ToString(); } diagno.SelectText(); diagno.Focus(); }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { string sql = "SELECT genst_desc FROM general_setup WHERE genst_ctg='IPConnect' AND genst_code='00001'"; DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) { ip_url.Text = "http://" + dt.Rows[0]["genst_desc"].ToString(); } BuildTree1(TreePanel1.Root); } }
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 FILL_DRGLIST(string _drggrp) { DBMysql db = new DBMysql(); string sSQL = "SELECT drg_name FROM drug_list where drg_grp = '" + _drggrp + "'"; System.Data.DataTable dtDRUGLIST = db.Query(sSQL); for (int k = 0; k < dtDRUGLIST.Rows.Count; k++) { Ext.Net.ListItem litem2; litem2 = new Ext.Net.ListItem(dtDRUGLIST.Rows[k]["drg_name"].ToString()); this.cbo_druglist.Items.Add(litem2); } this.cbo_druglist.GetStore().DataBind(); }
protected void doAllRpr() { string person_id, date1, date2, report, patient_name; person_id = Request["PERSON_ID"].ToString(); date1 = Request["DATE1"].ToString(); date2 = Request["DATE2"].ToString(); report = Request["REPORT"].ToString(); patient_name = Request["PATIENT_NAME"].ToString(); string sqlcmd = ""; sqlcmd = sqlcmd + " select c.pif_name , a.person_id ,a.floor_no,a.bed_no,a.dialysis_date,a.dialysis_time,a.column_7,a.column_8,a.column_9,a.column_41, (hour(dialysis_time)*60 + minute(dialysis_time)) - b.col_min Elapsedtime from data_list a, "; sqlcmd = sqlcmd + " (select person_id,floor_no,bed_no,dialysis_date,(hour(MIN(dialysis_time))*60 + MINUTE(MIN(dialysis_time))) as col_min from data_list "; sqlcmd = sqlcmd + " group by person_id,floor_no,bed_no,dialysis_date) b ,pat_info c "; sqlcmd = sqlcmd + " where a.person_id= b.person_id "; sqlcmd = sqlcmd + " and a.floor_no=b.floor_no "; sqlcmd = sqlcmd + " and a.bed_no=b.bed_no "; sqlcmd = sqlcmd + " and a.dialysis_date = b.dialysis_date "; sqlcmd = sqlcmd + " and a.person_id = c.pif_ic "; sqlcmd = sqlcmd + " and a.person_id ='" + person_id + "' "; sqlcmd = sqlcmd + " order by a.dialysis_date,a.dialysis_time "; DBMysql db = new DBMysql(); DataTable dt = db.Query(sqlcmd); ReportDocument objRpt = new ReportDocument(); objRpt.Load(Server.MapPath("All report.rpt")); //以下順序一定要對,先令報表中參數都為靜態,就是拋轉但報表不接 //參數都在sqlcmd兜好一切 objRpt.SetDataSource(dt); //CrystalReportViewer1.ReportSource = objRpt; CRViewer.ReportSource = objRpt; objRpt.SetParameterValue(0, person_id.ToString()); //給日期起訖 objRpt.ParameterFields["dialysis_date"].CurrentValues.Clear(); objRpt.ParameterFields["dialysis_date"].DefaultValues.Clear(); objRpt.ParameterFields["dialysis_date"].CurrentValues.AddRange(DateTime.Parse(date1), DateTime.Parse(date2), RangeBoundType.BoundInclusive, RangeBoundType.BoundInclusive); //塞入參數值後不要再refresh了 }
protected void show_grid() { DBMysql db = new DBMysql(); string sql = "SELECT a.cln1_diadate,a.cln1_col1,a.cln1_col34,a.cln1_col5, a.cln1_col6,"; sql += " a.cln1_col7,a.cln1_col8,a.cln1_col13,a.cln1_col14,a.cln1_col15 "; sql += " FROM clinical1_nurse a,pat_info b "; sql += " WHERE b.pif_id = '" + _PAT_ID + "' "; sql += " AND a.cln1_patic = b.pif_ic "; sql += "ORDER BY a.cln1_diadate DESC"; DataTable dt = db.Query(sql); //sql = "SELECT pck_code AS CODE, pck_name AS NAME FROM package_setup "; //DataTable dt4 = db.Query(sql); //System.Data.DataView dv4 = dt4.DefaultView; //for (int i = 0; i < dt.Rows.Count; i++) //{ // dv4.RowFilter = "CODE='" + dt.Rows[i]["cln1_col4"].ToString() + "' "; // if (dv4.Count > 0) // dt.Rows[i]["cln1_col4"] = dv4[0]["NAME"].ToString(); //} //20160321 Alex 沒作用刪除 //sql = "SELECT hp_code AS CODE, hp_subgrp AS NAME FROM h_type "; //sql = "SELECT pck_code AS CODE, pck_name AS NAME FROM package_setup"; //修正與FLEX抓取相同資料表 //DataTable dt34 = db.Query(sql); //System.Data.DataView dv34 = dt34.DefaultView; //for (int i = 0; i < dt.Rows.Count; i++) //{ // dv34.RowFilter = "CODE='" + dt.Rows[i]["cln1_col34"].ToString() + "' "; // if (dv34.Count > 0) // dt.Rows[i]["cln1_col34"] = dv34[0]["NAME"].ToString(); //} Store istore = Grid_clinical1_nurse.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); }
protected void Show_shortdrughistory() { DBMysql db = new DBMysql(); string sql; //old sql = "SELECT a.shord_id,a.shord_dateord,a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_comment,c.genst_desc "; //2015.01.20 andy 短期醫囑:增加給藥方式 執行護士 顯示 sql = "SELECT a.shord_id,a.shord_dateord,a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_medway,a.shord_nurs,c.genst_desc,a.shord_comment "; sql += "from shortterm_ordermgt a,drug_list b, general_setup c "; sql += "where a.shord_patic = '" + patient_id.Text + "' "; sql += "and a.shord_drug = b.drg_code "; sql += "and c.genst_ctg = 'ActiveStatus' and a.shord_actst = c.genst_code order by a.shord_id DESC"; DataTable dt = db.Query(sql); Store istore2 = Grid_Show_ORDSHORT.GetStore(); istore2.DataSource = db.GetDataArray(dt); istore2.DataBind(); }
public static List <UserInfoGroupLab> GetData(string sPat_no, string sResult_date) { DBMysql LabGDb = new DBMysql(); DataTable MyLabGDt = new DataTable(); string sSQL = " "; sSQL = sSQL + " select GROUP_CODE as ListGROUP_CODE ,GROUP_NAME as ListGROUP_NAME ,GROUP_NAME_E as ListGROUP_NAME_E ,L.pat_no,L.*, I.* , G.* from a_result_log L "; sSQL = sSQL + " left join a_ritem_setup I on L.result_code = I.ritem_code "; sSQL = sSQL + " left join a_item_group G on L.result_code = G.oitem_code "; sSQL = sSQL + " where L.pat_no = '" + sPat_no + "' and L.result_date = '" + sResult_date + "' "; MyLabGDt = LabGDb.Query(sSQL); UserInfoGroupLabList = null; if (UserInfoGroupLabList == null) { UserInfoGroupLabList = new List <UserInfoGroupLab>(); if (MyLabGDt.Rows.Count > 0) { for (int kk = 0; kk <= MyLabGDt.Rows.Count - 1; kk++) { UserInfoGroupLab UserInfoGroupLab0 = new UserInfoGroupLab(); UserInfoGroupLab0.pat_no = MyLabGDt.Rows[kk]["pat_no"].ToString(); UserInfoGroupLab0.RESULT_DATE = MyLabGDt.Rows[kk]["RESULT_DATE"].ToString(); UserInfoGroupLab0.RESULT_CODE = MyLabGDt.Rows[kk]["RESULT_DATE"].ToString(); UserInfoGroupLab0.ListGROUP_CODE = MyLabGDt.Rows[kk]["ListGROUP_CODE"].ToString(); UserInfoGroupLab0.ListGROUP_NAME = MyLabGDt.Rows[kk]["ListGROUP_NAME"].ToString(); UserInfoGroupLab0.ListGROUP_NAME_E = MyLabGDt.Rows[kk]["ListGROUP_NAME_E"].ToString(); // UserInfoGroupLab0.pat_no = MyLabGDt.Rows[kk]["pat_no"].ToString(); // UserInfoGroupLab0.pat_no = MyLabGDt.Rows[kk]["pat_no"].ToString(); UserInfoGroupLabList.Add(UserInfoGroupLab0); } } } return(UserInfoGroupLabList); }
private void Page_Init(object sender, EventArgs e) { try { DBMysql db = new DBMysql(); string sRPT_LOGO = ""; DataTable dtLOGO = db.Query("SELECT * FROM general_setup WHERE genst_code='RPT_LOGO'"); if (dtLOGO.Rows.Count > 0) { sRPT_LOGO = dtLOGO.Rows[0]["genst_desc"].ToString(); sRPT_LOGO = Server.MapPath(sRPT_LOGO); } string sRPT_NAME = ""; DataTable dtNAME = db.Query("SELECT * FROM general_setup WHERE genst_code='RPT_NAME'"); if (dtNAME.Rows.Count > 0) { sRPT_NAME = dtNAME.Rows[0]["genst_desc"].ToString(); } #region 統計分析-病患人數 int W_COUNT = 0; int W_ZINFO07_COUNT = 0; DataTable dtPAT_INFO = db.Query("SELECT COUNT(*) AS COUNT FROM PAT_INFO "); if (dtPAT_INFO.Rows.Count > 0) { W_COUNT = Convert.ToInt32(dtPAT_INFO.Rows[0]["COUNT"].ToString()); } DataTable dtzinfo07 = db.Query("SELECT COUNT(*) as ZINFO07_COUNT FROM zinfo_a_07 WHERE opt_1 = '1' OR opt_1 = '2' OR opt_1 = '3' OR opt_1 = '4' ORDER BY PAT_ID"); if (dtzinfo07.Rows.Count > 0) { W_ZINFO07_COUNT = Convert.ToInt32(dtzinfo07.Rows[0]["ZINFO07_COUNT"].ToString()); } int W_TOTAL = 0; //線上透析總人數 W_TOTAL = W_COUNT - W_ZINFO07_COUNT; //減去死亡或退出 string sqlCHKREG = "select genst_desc from general_setup where genst_ctg = 'statistics'" + " and genst_code = '001" + "'"; DataTable dt = db.Query(sqlCHKREG); string sql = ""; if (dt.Rows.Count == 0) { sql = "INSERT into general_setup (genst_ctg, genst_code, genst_desc) VALUES('statistics', '001', '" + W_TOTAL + "') "; } else { sql = "UPDATE general_setup a set genst_desc='" + W_TOTAL + "' WHERE a.genst_ctg='statistics' AND a.genst_code='001'"; } db.Excute(sql); #endregion ReportDocument rpt = new ReportDocument(); rpt.Load(Server.MapPath("statistics.rpt")); rpt.DataDefinition.FormulaFields["RPT_LOGO"].Text = "ToText('" + sRPT_LOGO + "')"; rpt.DataDefinition.FormulaFields["RPT_NAME"].Text = "ToText('" + sRPT_NAME + "')"; ParameterDiscreteValue pdv = new ParameterDiscreteValue(); CRViewer.ReportSource = rpt; ConnectionInfo connInfo = new ConnectionInfo(); //Server=192.168.1.118;Database=myhaisv3;UID=root;PWD=; CharSet=utf8 //資料庫連線設定無效,阿亮是使用ODBC連線。 string[] MySqlString = ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString().Split(';'); for (int i = 0; i < MySqlString.Length; i++) { switch (MySqlString[i].ToUpper().Substring(0, 3)) { case "SER": connInfo.ServerName = MySqlString[i].Split('=')[1]; break; case "DAT": connInfo.DatabaseName = MySqlString[i].Split('=')[1]; break; case "UID": connInfo.UserID = MySqlString[i].Split('=')[1]; break; case "PWD": connInfo.Password = MySqlString[i].Split('=')[1]; break; } } //connInfo. ServerName = "192.168.1.130"; //connInfo. DatabaseName = "mysql"; //connInfo. UserID = "root"; //connInfo. Password = ""; TableLogOnInfos tableLogOnInfos = CRViewer.LogOnInfo; foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos) { tableLogOnInfo.ConnectionInfo = connInfo; } } catch (Exception ex) { Common._ErrorMsgShow(ex.Message.ToString()); } }
public static List <UsrInf_Cond_zinfo_a_04> GetData(string sPat_id, string sInfo_date) { DBMysql DbInfo = new DBMysql(); DataTable MyInfoDt = new DataTable(); string sSQL = ""; //sSQL = sSQL + " select z.* ,p.pif_id,pif_name,pif_ic from zinfo_a_04 z left join //pat_info p on p.pif_id = z.pat_id "; //sSQL = sSQL + " where pat_id = '" + sPat_id + "' and info_date = '" + sInfo_date + "' "; if (!string.IsNullOrWhiteSpace(sPat_id)) { sSQL = sSQL + " select z.* ,p.pif_id,pif_name,pif_ic from zinfo_a_04 z left join pat_info p on p.pif_id = z.pat_id "; sSQL = sSQL + " where pat_id = '" + sPat_id + "' and info_date = '" + sInfo_date + "' "; } MyInfoDt = DbInfo.Query(sSQL); UsrInf_Cond_zinfo_a_04_List = null; if (UsrInf_Cond_zinfo_a_04_List == null) { UsrInf_Cond_zinfo_a_04_List = new List <UsrInf_Cond_zinfo_a_04>(); if (MyInfoDt.Rows.Count > 0) { for (int cc = 0; cc <= MyInfoDt.Rows.Count - 1; cc++) { UsrInf_Cond_zinfo_a_04 UsrInf_Cond_zinfo_a_04_00 = new UsrInf_Cond_zinfo_a_04(); //塞欄位到 UsrInf_Cond_zinfo_a_04 class /* * pat_id string * info_date string * info_user string * chk_1 string * txt_2 string * */ // Convert.ToInt32(MyInfoDt.Rows[cc]["ROW_ID"].ToString().Trim()); // MyInfoDt.Rows[cc]["ROW_ID"].ToString().Trim(); UsrInf_Cond_zinfo_a_04_00.pat_id = MyInfoDt.Rows[cc]["pat_id"].ToString().Trim(); UsrInf_Cond_zinfo_a_04_00.info_date = MyInfoDt.Rows[cc]["info_date"].ToString().Trim(); UsrInf_Cond_zinfo_a_04_00.info_user = MyInfoDt.Rows[cc]["info_user"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["chk_1"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_04_00.chk_1 = ""; } else { UsrInf_Cond_zinfo_a_04_00.chk_1 = MyInfoDt.Rows[cc]["chk_1"].ToString().Trim(); } UsrInf_Cond_zinfo_a_04_00.txt_2 = MyInfoDt.Rows[cc]["txt_2"].ToString().Trim(); //pat_info 欄位 pif_name if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["pif_name"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_04_00.pif_name = ""; } else { UsrInf_Cond_zinfo_a_04_00.pif_name = MyInfoDt.Rows[cc]["pif_name"].ToString().Trim(); } //pat_info 欄位 pif_ic if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["pif_ic"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_04_00.pif_ic = ""; } else { UsrInf_Cond_zinfo_a_04_00.pif_ic = MyInfoDt.Rows[cc]["pif_ic"].ToString().Trim(); } UsrInf_Cond_zinfo_a_04_List.Add(UsrInf_Cond_zinfo_a_04_00); } } } return(UsrInf_Cond_zinfo_a_04_List); }//GetData
public static List <UsrInf_Cond_zinfo_a_07> GetData(string sPat_id, string sInfo_date) { DBMysql DbInfo = new DBMysql(); DataTable MyInfoDt = new DataTable(); string sSQL = ""; //sSQL = sSQL + " select z.* ,p.pif_id,pif_name,pif_ic from zinfo_a_07 z left join //pat_info p on p.pif_id = z.pat_id "; //sSQL = sSQL + " where pat_id = '" + sPat_id + "' and info_date = '" + sInfo_date + "' "; if (!string.IsNullOrWhiteSpace(sPat_id)) { sSQL = sSQL + " select z.* ,p.pif_id,pif_name,pif_ic from zinfo_a_07 z left join pat_info p on p.pif_id = z.pat_id "; sSQL = sSQL + " where pat_id = '" + sPat_id + "' and info_date = '" + sInfo_date + "' "; } MyInfoDt = DbInfo.Query(sSQL); UsrInf_Cond_zinfo_a_07_List = null; if (UsrInf_Cond_zinfo_a_07_List == null) { UsrInf_Cond_zinfo_a_07_List = new List <UsrInf_Cond_zinfo_a_07>(); if (MyInfoDt.Rows.Count > 0) { for (int cc = 0; cc <= MyInfoDt.Rows.Count - 1; cc++) { UsrInf_Cond_zinfo_a_07 UsrInf_Cond_zinfo_a_07_00 = new UsrInf_Cond_zinfo_a_07(); //塞欄位到 UsrInf_Cond_zinfo_a_07 class /* * pat_id string * info_date string * info_user string * * opt_1 int * opt_2 int * txt_3 string * opt_4 int * opt_5 int * txt_6 string * chk_7 string * chk_8 string * txt_9 string * chk_10 string * txt_11 string * chk_12 string * txt_13 string * txt_14 string * * */ // Convert.ToInt32(MyInfoDt.Rows[cc]["ROW_ID"].ToString().Trim()); // MyInfoDt.Rows[cc]["ROW_ID"].ToString().Trim(); UsrInf_Cond_zinfo_a_07_00.pat_id = MyInfoDt.Rows[cc]["pat_id"].ToString().Trim(); UsrInf_Cond_zinfo_a_07_00.info_date = MyInfoDt.Rows[cc]["info_date"].ToString().Trim(); UsrInf_Cond_zinfo_a_07_00.info_user = MyInfoDt.Rows[cc]["info_user"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["opt_1"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.opt_1 = 0; //0 是沒選 RadioButton } else { UsrInf_Cond_zinfo_a_07_00.opt_1 = Convert.ToInt32(MyInfoDt.Rows[cc]["opt_1"].ToString().Trim()); } if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["opt_2"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.opt_2 = 0; //0 是沒選 RadioButton } else { UsrInf_Cond_zinfo_a_07_00.opt_2 = Convert.ToInt32(MyInfoDt.Rows[cc]["opt_2"].ToString().Trim()); } UsrInf_Cond_zinfo_a_07_00.txt_3 = MyInfoDt.Rows[cc]["txt_3"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["opt_4"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.opt_4 = 0; //0 是沒選 RadioButton } else { UsrInf_Cond_zinfo_a_07_00.opt_4 = Convert.ToInt32(MyInfoDt.Rows[cc]["opt_4"].ToString().Trim()); } if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["opt_5"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.opt_5 = 0; //0 是沒選 RadioButton } else { UsrInf_Cond_zinfo_a_07_00.opt_5 = Convert.ToInt32(MyInfoDt.Rows[cc]["opt_5"].ToString().Trim()); } UsrInf_Cond_zinfo_a_07_00.txt_6 = MyInfoDt.Rows[cc]["txt_6"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["chk_7"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.chk_7 = ""; } else { UsrInf_Cond_zinfo_a_07_00.chk_7 = MyInfoDt.Rows[cc]["chk_7"].ToString().Trim(); } if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["chk_8"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.chk_8 = ""; } else { UsrInf_Cond_zinfo_a_07_00.chk_8 = MyInfoDt.Rows[cc]["chk_8"].ToString().Trim(); } UsrInf_Cond_zinfo_a_07_00.txt_9 = MyInfoDt.Rows[cc]["txt_9"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["chk_10"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.chk_10 = ""; } else { UsrInf_Cond_zinfo_a_07_00.chk_10 = MyInfoDt.Rows[cc]["chk_10"].ToString().Trim(); } UsrInf_Cond_zinfo_a_07_00.txt_11 = MyInfoDt.Rows[cc]["txt_11"].ToString().Trim(); if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["chk_12"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.chk_12 = ""; } else { UsrInf_Cond_zinfo_a_07_00.chk_12 = MyInfoDt.Rows[cc]["chk_12"].ToString().Trim(); } UsrInf_Cond_zinfo_a_07_00.txt_13 = MyInfoDt.Rows[cc]["txt_13"].ToString().Trim(); UsrInf_Cond_zinfo_a_07_00.txt_14 = MyInfoDt.Rows[cc]["txt_14"].ToString().Trim(); //pat_info 欄位 pif_name if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["pif_name"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.pif_name = ""; } else { UsrInf_Cond_zinfo_a_07_00.pif_name = MyInfoDt.Rows[cc]["pif_name"].ToString().Trim(); } //pat_info 欄位 pif_ic if (string.IsNullOrWhiteSpace((MyInfoDt.Rows[cc]["pif_ic"].ToString().Trim()))) { UsrInf_Cond_zinfo_a_07_00.pif_ic = ""; } else { UsrInf_Cond_zinfo_a_07_00.pif_ic = MyInfoDt.Rows[cc]["pif_ic"].ToString().Trim(); } UsrInf_Cond_zinfo_a_07_List.Add(UsrInf_Cond_zinfo_a_07_00); } } } return(UsrInf_Cond_zinfo_a_07_List); }//GetData
public static Paging <Patinfo> PatinfosPaging(int start, int limit, string sort, string dir, string filter) { List <Patinfo> patinfos = Patinfo.Getpatname; if (filter.Length > 0) { patinfos.Clear(); DBMysql db = new DBMysql(); List <Patinfo> data = new List <Patinfo>(); string sql = "SELECT PY, HZ, ZM FROM pinyin "; if (filter != "*") { sql += "WHERE PY LIKE '%" + filter + "%' AND ZM='" + filter.Substring(0, 1) + "' "; } DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) //使用拼音輸入 { sql = "SELECT pif_ic, pif_name FROM pat_info WHERE (1=0 "; for (int i = 0; i < dt.Rows.Count; i++) { sql += "OR pif_name LIKE '" + dt.Rows[i]["HZ"].ToString() + "%' "; } sql += ") "; DataTable dt1 = db.Query(sql); if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { Patinfo patinfo = new Patinfo(); patinfo.patic = dt1.Rows[j]["pif_ic"].ToString(); patinfo.patname = dt1.Rows[j]["pif_name"].ToString(); patinfos.Add(patinfo); } } dt1.Dispose(); } else { sql = "SELECT pif_ic, pif_name FROM pat_info "; //直接輸入中文字 sql += "WHERE pif_name LIKE '%" + filter + "%' "; dt = db.Query(sql); if (dt.Rows.Count > 0) { for (int j = 0; j < dt.Rows.Count; j++) { Patinfo patinfo = new Patinfo(); patinfo.patic = dt.Rows[j]["pif_ic"].ToString();; patinfo.patname = dt.Rows[j]["pif_name"].ToString(); patinfos.Add(patinfo); } } } dt.Dispose(); db.Close(); } if (!string.IsNullOrEmpty(sort)) { patinfos.Sort(delegate(Patinfo x, Patinfo y) { object a; object b; int direction = dir == "DESC" ? -1 : 1; a = x.GetType().GetProperty(sort).GetValue(x, null); b = y.GetType().GetProperty(sort).GetValue(y, null); return(CaseInsensitiveComparer.Default.Compare(a, b) * direction); }); } if ((start + limit) > patinfos.Count) { limit = patinfos.Count - start; } List <Patinfo> rangePatinfos = (start < 0 || limit < 0) ? patinfos : patinfos.GetRange(start, limit); return(new Paging <Patinfo>(rangePatinfos, patinfos.Count)); }
protected void Show() { GetComboxData(); //取得各項COMBOBOX資料 Label2.Text = patient_name.Text; DataTable dt = new DataTable(); string sql; sql = "SELECT a.*, "; sql += "c.cln1_col11 AS Xian1, c.cln1_col12 AS Xian2, c.cln1_col21 AS Xian3, "; sql += "c.cln1_col22 AS Xian4, c.cln1_col31 AS Xian5, c.cln1_col32 AS Xian6, "; sql += "c.cln1_col41 AS Xian7, "; sql += "b.cln1_col11 as col11, b.cln1_col12 as col12, "; sql += "b.cln1_col21 as col21, b.cln1_col22 as col22, "; sql += "b.cln1_col31 as col31, b.cln1_col32 as col32, "; sql += "b.cln1_col41 as col41, b.cln1_col42 as col42, "; sql += "b.cln1_col50 as col50 FROM clinical1_nurse a "; sql += "LEFT JOIN clinical1_nurse_suzhou b ON a.cln1_patic=b.cln1_patic AND a.cln1_diadate=b.cln1_diadate "; sql += "LEFT JOIN clinical1_nurse_xian c ON a.cln1_patic=c.cln1_patic AND a.cln1_diadate=c.cln1_diadate "; sql += "WHERE a.cln1_patic = '" + patient_id.Text + "' AND a.cln1_diadate='" + info_date1.Text + "'"; dt = db.Query(sql); DataRow row = dt.Rows[0]; Common.SetComboBoxValue(cbo_diagnosis, row["cln1_col1"].ToString(), false); Common.SetComboBoxValue(cbo_h_type, dt.Rows[0]["cln1_col34"].ToString(), false); //血管通路 Common.SetComboBoxValue(cbo_mechine_model, row["cln1_col26"].ToString(), false); //透析器型号 string tube_model = Common.get_tube_model(row, "cln1_col27"); if (tube_model != null) { Common.SetComboBoxValue(cbo_hpack3, tube_model, false); } Common.SetComboBoxValue(cbo_dialysis_type, row["cln1_col3"].ToString(), false); //透析方式 Common.SetComboBoxValue(SelectBox10, row["cln1_col15"].ToString(), false); //肝素 bedno.Text = row["cln1_col2"].ToString(); Label6.Text = row["cln1_col2"].ToString(); txt_weight_after.Text = row["cln1_col8"].ToString(); //透析后体重 txt_weight_after_expect.Text = row["cln1_col6"].ToString(); //干体重 txt_weight_before.Text = dt.Rows[0]["cln1_col5"].ToString(); //透析前体重 TextField3.Text = dt.Rows[0]["cln1_col7"].ToString(); TextField5.Text = dt.Rows[0]["cln1_col10"].ToString(); //透析開始時間 TextField6.Text = dt.Rows[0]["cln1_col11"].ToString(); //透析結束時間 TextField7.Text = dt.Rows[0]["cln1_col12"].ToString(); //透析合計時間 TextFirst.Text = row["cln1_col13"].ToString(); TextAdd.Text = row["cln1_col14"].ToString(); TextAmount.Text = row["cln1_col17"].ToString(); TextReplaceAmount.Text = dt.Rows[0]["cln1_col19"].ToString(); //置換量 // 由 clinical1_nurse_xian 取得的資料 TextField2.Text = row["Xian1"].ToString(); // 體溫 TextField4.Text = row["Xian2"].ToString(); // 心跳 TextField9.Text = row["Xian3"].ToString(); // 呼吸 TextField10.Text = row["Xian4"].ToString(); // 血壓 TextField11.Text = row["Xian5"].ToString(); // 血流量 TextField15.Text = row["Xian6"].ToString(); // 治疗时间 TextField12.Text = dt.Rows[0]["cln1_col20"].ToString(); TextField13.Text = dt.Rows[0]["cln1_col21"].ToString(); //TextField14.Text = dt.Rows[0]["cln1_col22"].ToString(); TextField131.Text = dt.Rows[0]["cln1_col25"].ToString(); //TextField24.Text = dt.Rows[0]["cln1_col35"].ToString(); //TextField25.Text = dt.Rows[0]["cln1_col36"].ToString(); TextField23.Text = dt.Rows[0]["cln1_col33"].ToString(); TextCln1_col35.Text = row["cln1_col35"].ToString(); // 肝素量 //不自動帶 BEG Col11 = dt.Rows[0]["col11"].ToString(); coltext11 = dt.Rows[0]["col12"].ToString(); Col21 = dt.Rows[0]["col21"].ToString(); coltext21 = dt.Rows[0]["col22"].ToString(); Col31 = dt.Rows[0]["col31"].ToString(); coltext31 = dt.Rows[0]["col32"].ToString(); Col41 = dt.Rows[0]["col41"].ToString(); coltext41 = dt.Rows[0]["col42"].ToString(); Col50 = dt.Rows[0]["col50"].ToString(); TextArea1.Text = row["cln1_col23"].ToString(); string[] check = row["cln1_col16"].ToString().Split(new Char[] { ',' }); for (int i = 0; i < check.Length; i++) { if (check[i] == "EPO") { CheckboxEPO.Checked = true; Common.SetComboBoxValue(SelectBoxEPO, dt.Rows[0]["cln1_col28"].ToString(), true); } else if (check[i] == "左卡") { CheckboxLCard.Checked = true; Common.SetComboBoxValue(SelectBoxLcard, dt.Rows[0]["cln1_col29"].ToString(), true); } else if (check[i].Equals("甲钴铵")) { CheckboxMecobalamin.Checked = true; Common.SetComboBoxValue(SelectBoxMecobalamin, dt.Rows[0]["cln1_col30"].ToString(), true); } else if (check[i].Equals("铁剂")) { CheckboxIron.Checked = true; Common.SetComboBoxValue(SelectBoxIron, dt.Rows[0]["cln1_col31"].ToString(), true); } else if (check[i].Equals("溉醇")) { CheckboxCalcitriol.Checked = true; Common.SetComboBoxValue(SelectBoxCalcitriol, dt.Rows[0]["cln1_col32"].ToString(), true); } else if (check[i].Equals("透析液钠")) { CheckboxSodium.Checked = true; Common.SetComboBoxValue(SelectBoxSodium, dt.Rows[0]["cln1_col37"].ToString(), true); } else if (check[i].Equals("透析液钾")) { CheckboxPotassium.Checked = true; Common.SetComboBoxValue(SelectBoxPotassium, dt.Rows[0]["cln1_col38"].ToString(), true); } } init_PAGE2(); dt.Dispose(); CheckcboValue(); db.myConnection.Close(); }
public static Paging <Drug> drugsPaging(int start, int limit, string sort, string dir, string filter) { List <Drug> drugs = Drug.Getdrugname; if (filter.Length > 0) { drugs.Clear(); DBMysql db = new DBMysql(); List <Drug> data = new List <Drug>(); string sql = "SELECT drg_name FROM drug_list "; //簡碼輸入 sql += "WHERE short_code LIKE '%" + filter + "%' AND drg_status='Y'"; DataTable dt1 = db.Query(sql); if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { Drug drug = new Drug(); drug.py = filter; drug.drugname = dt1.Rows[j]["drg_name"].ToString(); //drg_name drugs.Add(drug); } } else //直接輸入中文字 { sql = "SELECT drg_name FROM drug_list "; sql += "WHERE drg_name LIKE '%" + filter + "%' AND drg_status='Y' "; dt1 = db.Query(sql); if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { Drug drug = new Drug(); drug.py = filter; drug.drugname = dt1.Rows[j]["drg_name"].ToString(); //drg_name drugs.Add(drug); } } else { sql = "SELECT PY, HZ, ZM FROM pinyin "; if (filter != "*") { sql += "WHERE PY LIKE '" + filter + "%' AND ZM='" + filter.Substring(0, 1) + "' "; } DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) //使用拼音輸入 { sql = "SELECT drg_name FROM drug_list WHERE (1=0 "; for (int i = 0; i < dt.Rows.Count; i++) { sql += "OR drg_name LIKE '" + dt.Rows[i]["HZ"].ToString() + "%' "; } sql += ") AND drg_status='Y'"; dt1 = db.Query(sql); if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { Drug drug = new Drug(); drug.py = filter.Substring(0, 1); drug.drugname = dt1.Rows[j]["drg_name"].ToString(); //drg_name drugs.Add(drug); } } } dt.Dispose(); } dt1.Dispose(); db.Close(); } } //if (!string.IsNullOrEmpty(filter) && filter != "*") //{ // drugs.RemoveAll(drug => !drug.py.StartsWith(filter)); //} if (!string.IsNullOrEmpty(sort)) { drugs.Sort(delegate(Drug x, Drug y) { object a; object b; int direction = dir == "DESC" ? -1 : 1; a = x.GetType().GetProperty(sort).GetValue(x, null); b = y.GetType().GetProperty(sort).GetValue(y, null); return(CaseInsensitiveComparer.Default.Compare(a, b) * direction); }); } if ((start + limit) > drugs.Count) { limit = drugs.Count - start; } List <Drug> rangeDrugs = (start < 0 || limit < 0) ? drugs : drugs.GetRange(start, limit); return(new Paging <Drug>(rangeDrugs, drugs.Count)); }
protected void Load_Appointment() { var datasource = new List <Project>(); string floor, timetype, area, bedno, mac_typ, machine; try { floor = Common.GetComboBoxValue(cboFLOOR); } catch (Exception ex) { floor = sFLOOR.Text; } try { timetype = Common.GetComboBoxValue(cboTIME); } catch (Exception ex) { timetype = sTIME.Text; } try { area = Common.GetComboBoxValue(cboArea); } catch (Exception ex) { area = sAREA.Text; } string sql = "SELECT a.mac_flr, a.mac_sec, a.mac_bedno, a.mac_typ, 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(); sql = "SELECT apptst_patrefid, apptst_daytyp FROM appointment_setup "; sql += "WHERE apptst_flr='" + floor + "' AND apptst_sec='" + area + "' AND apptst_bed='" + bedno + "' AND apptst_timetyp='" + timetype + "' "; sql += "ORDER BY apptst_daytyp"; DataTable dt2 = db.Query(sql); string[] patname = new string[7]; int i = 0; int k = 0; for (i = 0; i < 7; i++) { patname[i] = ""; } foreach (DataRow dr2 in dt2.Rows) { i = int.Parse(dr2["apptst_daytyp"].ToString()) - 1; patname[i] = dr2["apptst_patrefid"].ToString(); } #region 增加臨時預約病患 int j = GetWeekNo(); for (i = 0; i < 7; i++) { if (i == j) { 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='" + toDay + "' 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) { patname[i] = dt0.Rows[0]["pif_name"].ToString(); } } } #endregion datasource.Add(new Project(area + "区", bedno, mac_typ, patname[0], patname[1], patname[2], patname[3], patname[4], patname[5], patname[6], machine)); } Store1.DataSource = datasource; Store1.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(); } }
protected void show() { GetComboxData(); //取得各項COMBOBOX資料 Label2.Text = patient_name.Text; Label4.Text = floor.Text; Label6.Text = bedno.Text; DataTable dt = new DataTable(); string sql = "SELECT a.*, "; sql += "b.cln1_col11 as col11, b.cln1_col12 as col12, "; sql += "b.cln1_col21 as col21, b.cln1_col22 as col22, "; sql += "b.cln1_col31 as col31, b.cln1_col32 as col32, "; sql += "b.cln1_col41 as col41, b.cln1_col42 as col42, "; sql += "b.cln1_col50 as col50, "; sql += "c.cln3_DialysisMachine, c.cln3_HeparinPumpArtery, c.cln3_HeparinPumpVein, c.cln3_CatheterAccess, c.cln3_MuscleAtrophy "; sql += "FROM clinical1_nurse a "; sql += "LEFT JOIN clinical1_nurse_suzhou b ON a.cln1_patic=b.cln1_patic AND a.cln1_diadate=b.cln1_diadate "; sql += "LEFT JOIN clinical3_nurse c ON a.cln1_patic=c.cln3_patic AND a.cln1_diadate=c.cln3_date "; sql += "WHERE a.cln1_patic = '" + patient_id.Text + "' AND a.cln1_diadate='" + info_date1.Text + "'"; dt = db.Query(sql); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; Common.SetComboBoxValue(cbo_diagnosis, row["cln1_col1"].ToString(), false); Common.SetComboBoxValue(cbo_mechine_model, row["cln1_col26"].ToString(), false);//透析器型号 string tube_model = Common.get_tube_model(row, "cln1_col27"); if (tube_model != null) { Common.SetComboBoxValue(cbo_hpack3, tube_model, false); } Common.SetComboBoxValue(cbo_dialysis_type, row["cln1_col3"].ToString(), false);//透析方式 if (cbo_dialysis_type.Text == "HDF" || cbo_dialysis_type.Text == "HF") { TextField11.Text = "25"; } txt_weight_after.Text = row["cln1_col8"].ToString(); //透析后体重 txt_weight_after_expect.Text = row["cln1_col6"].ToString(); //干体重 try { decimal try_parse = Convert.ToDecimal(dt.Rows[0]["cln1_col5"].ToString()); txt_weight_before.Text = dt.Rows[0]["cln1_col5"].ToString(); //透析前体重 } catch { } TextTotalCap.Text = dt.Rows[0]["cln1_dateadded"].ToString(); //总定容量 TextField5.Text = dt.Rows[0]["cln1_col10"].ToString(); //透析開始時間 TextField6.Text = dt.Rows[0]["cln1_col11"].ToString(); //透析結束時間 TextField7.Text = dt.Rows[0]["cln1_col12"].ToString(); //透析合計時間 TextField3.Text = dt.Rows[0]["cln1_col7"].ToString(); TextField8.Text = row["cln1_col13"].ToString(); TextField9.Text = row["cln1_col14"].ToString(); TextField10.Text = row["cln1_col15"].ToString(); TextField11.Text = dt.Rows[0]["cln1_col19"].ToString(); TextField13.Text = dt.Rows[0]["cln1_col21"].ToString(); TextField131.Text = dt.Rows[0]["cln1_col25"].ToString(); TextField24.Text = dt.Rows[0]["cln1_col35"].ToString(); TextField23.Text = dt.Rows[0]["cln1_col33"].ToString(); Common.SetComboBoxValue(cbo_SelDialysisNa, dt.Rows[0]["cln1_col17"].ToString(), false); //透析液钙 Common.SetComboBoxValue(cbo_h_type, dt.Rows[0]["cln1_col34"].ToString(), false); //血管通路 //Common.SetComboBoxValue(cbo_change_type, dt.Rows[0]["cln1_col18"].ToString(), false);//置换方式(沒用到) //淨化小節移過來的 Common.SetComboBoxValue(cbo_DialysisMachine, dt.Rows[0]["cln3_DialysisMachine"].ToString(), false); //透析器凝血 Common.SetComboBoxValue(cbo_HeparinPump_a, dt.Rows[0]["cln3_HeparinPumpArtery"].ToString(), false); //动脉壶凝血 Common.SetComboBoxValue(cbo_HeparinPump_v, dt.Rows[0]["cln3_HeparinPumpVein"].ToString(), false); //静脉壶凝血 TextFieldCatheterAccess.Text = dt.Rows[0]["cln3_CatheterAccess"].ToString(); TextFieldMuscleAtrophy.Text = dt.Rows[0]["cln3_MuscleAtrophy"].ToString(); //淨化小節移過來的 //不自動帶 BEG if (row["cln1_diadate"].ToString() == info_date1.Text) { Col11 = dt.Rows[0]["col11"].ToString(); coltext11 = dt.Rows[0]["col12"].ToString(); Col21 = dt.Rows[0]["col21"].ToString(); coltext21 = dt.Rows[0]["col22"].ToString(); Col31 = dt.Rows[0]["col31"].ToString(); coltext31 = dt.Rows[0]["col32"].ToString(); Col41 = dt.Rows[0]["col41"].ToString(); coltext41 = dt.Rows[0]["col42"].ToString(); Col50 = dt.Rows[0]["col50"].ToString(); TextArea1.Text = row["cln1_col23"].ToString(); string[] check = row["cln1_col16"].ToString().Split(new Char[] { ',' }); for (int i = 0; i < check.Length; i++) { if (check[i] == "EPO") { Checkbox1.Checked = true; Common.SetComboBoxValue(SelectBoxEPO, dt.Rows[0]["cln1_col28"].ToString(), true); } else if (check[i] == "左卡") { Checkbox2.Checked = true; Common.SetComboBoxValue(SelectBoxLcard, dt.Rows[0]["cln1_col29"].ToString(), true); } else if (check[i] == "铁剂") { Checkbox3.Checked = true; Common.SetComboBoxValue(SelectBoxFe, dt.Rows[0]["cln1_col30"].ToString(), true); } else if (check[i] == "骨化三醇") { Checkbox4.Checked = true; Common.SetComboBoxValue(SelectBoxCalcitriol, dt.Rows[0]["cln1_col31"].ToString(), true); } else if (check[i] == "弥可保") { Checkbox5.Checked = true; Common.SetComboBoxValue(SelectBoxMethycobal, dt.Rows[0]["cln1_col32"].ToString(), true); } else if (check[i] == "维生素B12") { Checkbox6.Checked = true; Common.SetComboBoxValue(SelectBoxB12, dt.Rows[0]["cln1_col37"].ToString(), true); } } } } init_PAGE2(); dt.Dispose(); CheckcboValue(); db.myConnection.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { System.Data.DataTable dtDRUGGRP = db.Query("SELECT distinct drg_grp FROM drug_list"); for (int i = 0; i < dtDRUGGRP.Rows.Count; i++) { Ext.Net.ListItem litem; litem = new Ext.Net.ListItem(dtDRUGGRP.Rows[i]["drg_grp"].ToString()); this.cbo_druggrp.Items.Add(litem); } this.cbo_druggrp.GetStore().DataBind(); System.Data.DataTable dtDRUGFREQ = db.Query("SELECT genst_desc FROM general_setup where genst_ctg = 'drgfreq'"); for (int k = 0; k < dtDRUGFREQ.Rows.Count; k++) { Ext.Net.ListItem litem2; litem2 = new Ext.Net.ListItem(dtDRUGFREQ.Rows[k]["genst_desc"].ToString()); this.cmb_ordfreq.Items.Add(litem2); } this.cmb_ordfreq.GetStore().DataBind(); //給藥方式 System.Data.DataTable dtDRUGFRER = db.Query("SELECT med_name FROM med_way"); for (int k = 0; k < dtDRUGFRER.Rows.Count; k++) { Ext.Net.ListItem litem3; litem3 = new Ext.Net.ListItem(dtDRUGFRER.Rows[k]["med_name"].ToString()); this.cmd_medway.Items.Add(litem3); } this.cmd_medway.GetStore().DataBind(); patient_id.Text = Request.QueryString["person_id"]; patient_name.Text = Request.QueryString["patient_name"]; patient_sex.Text = Request.QueryString["pat_sex"]; txt_orddoc.Text = Request.QueryString["pat_docname"]; floor.Text = Request.QueryString["floor"]; area.Text = Request.QueryString["area"]; time.Text = Request.QueryString["time"]; bedno.Text = Request.QueryString["bedno"]; daytyp.Text = Request.QueryString["daytyp"]; if (patient_name.Text == null) { patient_name.Text = Request.QueryString["amp;patient_name"]; patient_sex.Text = Request.QueryString["amp;pat_sex"]; txt_orddoc.Text = Request.QueryString["amp;pat_docname"]; floor.Text = Request.QueryString["amp;floor"]; area.Text = Request.QueryString["amp;area"]; time.Text = Request.QueryString["amp;time"]; bedno.Text = Request.QueryString["amp;bedno"]; daytyp.Text = Request.QueryString["amp;daytyp"]; } txt_orddate.Text = DateTime.Now.ToString("yyyy-MM-dd"); txt_ordtime.Text = DateTime.Now.ToString("HH:mm"); show(); Show_shortdrughistory(); } }