private void setControl(String id) { orreq = ic.ivfDB.orreqDB.selectByPk1(id); ptt = ic.ivfDB.pttDB.selectByPk1(orreq.t_patient_id); txtID.Value = orreq.or_req_id; txtHn.Value = orreq.patient_hn; txtPttNameE.Value = orreq.patient_name; txtDob.Value = ic.sVsOld.dob + "[" + ptt.AgeStringShort() + "]"; txtPttId.Value = ptt.t_patient_id; txtSex.Value = ptt.f_sex_id.Equals("1") ? "ชาย" : "หญิง"; txtBg.Value = ptt.f_patient_blood_group_id.Equals("2140000005") ? "O" : ptt.f_patient_blood_group_id.Equals("2140000002") ? "A" : ptt.f_patient_blood_group_id.Equals("2140000003") ? "B" : ptt.f_patient_blood_group_id.Equals("2140000004") ? "AB" : "ไม่ระบุ"; txtID.Value = orreq.or_req_id; txtReqCode.Value = orreq.or_req_code; //txtDiagGrpId.Value = orreq.id txtDiagId.Value = orreq.opera_id; txtAnesId.Value = orreq.anesthesia_id; txtDtrId.Value = orreq.doctor_surgical_id; txtReqDate.Value = orreq.or_req_date; txtDiagGrp.Value = orreq.operation_group_name; txtOpera.Value = orreq.operation_name; txtAnes.Value = orreq.anesthesia_name; cboDiag.Value = orreq.remark; txtOrDate.Value = orreq.or_date; txtOrTime.Value = orreq.or_time; txtDtrName.Value = orreq.surgeon; }
private void chkNull(OrRequest p) { long chk = 0; decimal chk1 = 0; p.date_modi = p.date_modi == null ? "" : p.date_modi; p.date_cancel = p.date_cancel == null ? "" : p.date_cancel; p.user_create = p.user_create == null ? "" : p.user_create; p.user_modi = p.user_modi == null ? "" : p.user_modi; p.user_cancel = p.user_cancel == null ? "" : p.user_cancel; p.or_req_code = p.or_req_code == null ? "" : p.or_req_code; p.or_req_date = p.or_req_date == null ? "" : p.or_req_date; p.patient_hn = p.patient_hn == null ? "" : p.patient_hn; p.remark = p.remark == null ? "" : p.remark; p.patient_name = p.patient_name == null ? "" : p.patient_name; p.status_or = p.status_or == null ? "0" : p.status_or; p.status_urgent = p.status_urgent == null ? "0" : p.status_urgent; p.doctor_anesthesia_id = long.TryParse(p.doctor_anesthesia_id, out chk) ? chk.ToString() : "0"; p.doctor_surgical_id = long.TryParse(p.doctor_surgical_id, out chk) ? chk.ToString() : "0"; p.b_service_point_id = long.TryParse(p.b_service_point_id, out chk) ? chk.ToString() : "0"; p.or_id = long.TryParse(p.or_id, out chk) ? chk.ToString() : "0"; p.opera_id = long.TryParse(p.opera_id, out chk) ? chk.ToString() : "0"; p.t_patient_id = long.TryParse(p.t_patient_id, out chk) ? chk.ToString() : "0"; p.anesthesia_id = long.TryParse(p.anesthesia_id, out chk) ? chk.ToString() : "0"; }
public void getlOrRequest() { //lDept = new List<Position>(); lDept.Clear(); DataTable dt = new DataTable(); dt = selectAll(); foreach (DataRow row in dt.Rows) { OrRequest dept1 = new OrRequest(); dept1.or_req_id = row[orreq.or_req_id].ToString(); dept1.or_req_code = row[orreq.or_req_code].ToString(); dept1.or_req_date = row[orreq.or_req_date].ToString(); dept1.patient_hn = row[orreq.patient_hn].ToString(); //dept1.remark = row[ordg.remark].ToString(); //dept1.date_create = row[ordg.date_create].ToString(); //dept1.date_modi = row[ordg.date_modi].ToString(); //dept1.date_cancel = row[ordg.date_cancel].ToString(); //dept1.user_create = row[ordg.user_create].ToString(); //dept1.user_modi = row[ordg.user_modi].ToString(); //dept1.user_cancel = row[ordg.user_cancel].ToString(); dept1.active = row[orreq.active].ToString(); lDept.Add(dept1); } }
public String insertOrRequest(OrRequest p, String userId) { String re = ""; if (p.or_req_id.Equals("")) { re = insert(p, userId); } else { re = update(p, userId); } return(re); }
public String insert(OrRequest p, String userId) { String re = ""; String sql = ""; p.active = "1"; //p.ssdata_id = ""; chkNull(p); sql = "Insert Into " + orreq.table + " Set " + "" + orreq.or_req_code + " = '" + p.or_req_code + "' " + "," + orreq.or_req_date + " = '" + p.or_req_date + "' " + "," + orreq.patient_hn + " = '" + p.patient_hn.Replace("'", "''") + "' " + "," + orreq.remark + " = '" + p.remark.Replace("'", "''") + "' " + "," + orreq.date_create + " = now() " + "," + orreq.date_modi + " = '" + p.date_modi + "' " + "," + orreq.date_cancel + " = '" + p.date_cancel + "' " + "," + orreq.user_create + " = '" + userId + "' " + "," + orreq.user_modi + " = '" + p.user_modi + "' " + "," + orreq.user_cancel + " = '" + p.user_cancel + "' " + "," + orreq.active + " " + " = '" + p.active + "' " + "," + orreq.patient_name + " " + " = '" + p.patient_name.Replace("'", "''") + "' " + "," + orreq.doctor_anesthesia_id + " " + " = '" + p.doctor_anesthesia_id + "' " + "," + orreq.doctor_surgical_id + " " + " = '" + p.doctor_surgical_id + "' " + "," + orreq.or_date + " " + " = '" + p.or_date + "' " + "," + orreq.or_time + " " + " = '" + p.or_time + "' " + "," + orreq.status_or + " " + " = '" + p.status_or + "' " + "," + orreq.b_service_point_id + " " + " = '" + p.b_service_point_id + "' " + "," + orreq.or_id + " " + " = '" + p.or_id + "' " + "," + orreq.opera_id + " " + " = '" + p.opera_id + "' " + "," + orreq.t_patient_id + " " + " = '" + p.t_patient_id + "' " + "," + orreq.status_urgent + " " + " = '" + p.status_urgent + "' " + "," + orreq.anesthesia_id + " " + " = '" + p.anesthesia_id + "' " + " "; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; } return(re); }
public OrRequest selectByPk1(String copId) { OrRequest cop1 = new OrRequest(); DataTable dt = new DataTable(); String sql = "select orreq.*,opera.opera_name,anes.anesthesia_name, " + "CONCAT(fpp.patient_prefix_description, stf.staff_fname_e, stf.staff_lname_e) as surgeon,ordg.opera_group_name " + "From " + orreq.table + " orreq " + "Left Join or_b_operation opera On orreq.opera_id = opera.opera_id " + "Left Join or_b_operation_group ordg On opera.opera_group_id = ordg.opera_group_id " + "Left Join or_b_anesthesia anes On orreq.anesthesia_id = anes.anesthesia_id " + "Left Join b_staff stf On orreq.doctor_surgical_id = stf.staff_id " + "Left Join f_patient_prefix fpp on stf.prefix_id = fpp.f_patient_prefix_id " + "Where orreq." + orreq.pkField + " ='" + copId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setOrRequest(dt); return(cop1); }
private void initConfig() { orreq = new OrRequest(); orreq.or_req_id = "or_req_id"; orreq.or_req_code = "or_req_code"; orreq.or_req_date = "or_req_date"; orreq.patient_hn = "patient_hn"; orreq.patient_name = "patient_name"; orreq.remark = "remark"; orreq.date_create = "date_create"; orreq.date_modi = "date_modi"; orreq.date_cancel = "date_cancel"; orreq.user_create = "user_create"; orreq.user_modi = "user_modi"; orreq.user_cancel = "user_cancel"; orreq.active = "active"; orreq.doctor_anesthesia_id = "doctor_anesthesia_id"; orreq.doctor_surgical_id = "doctor_surgical_id"; orreq.or_date = "or_date"; orreq.or_time = "or_time"; orreq.status_or = "status_or"; orreq.b_service_point_id = "b_service_point_id"; orreq.or_id = "or_id"; orreq.opera_id = "opera_id"; orreq.t_patient_id = "t_patient_id"; orreq.status_urgent = "status_urgent"; orreq.anesthesia_id = "anesthesia_id"; orreq.operation_name = ""; orreq.operation_group_name = ""; orreq.anesthesia_name = ""; orreq.surgeon = ""; orreq.table = "or_t_request"; orreq.pkField = "or_req_id"; lDept = new List <OrRequest>(); //getlDept(); }
private void initConfig() { pageLoad = true; theme1 = new C1.Win.C1Themes.C1ThemeController(); theme1.Theme = "Office2013Red"; stt = new C1SuperTooltip(); sep = new C1SuperErrorProvider(); orreq = new OrRequest(); ptt = new Patient(); fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold); txtReqDate.Value = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd HH:mm:ss"); ic.ivfDB.orreqDB.setCboRemark(cboDiag); //btnReq.Image = Resources.Ticket_24; btnSearch.Click += BtnSearch_Click; cboFetDay.SelectedIndexChanged += CboFetDay_SelectedIndexChanged; btnSave.Click += BtnSave_Click; btnPrint.Click += BtnPrint_Click; initGrfDiag(); setGrfPosi(""); initGrfReqOr(); setGrfReqOr(""); initGrfAnes(); setGrfAnes(); initGrfDtr(); setGrfDtr(); //ic.ivfDB.itmDB.setCboItem(cboLabReq, ""); //ic.ivfDB.dtrOldDB.setCboDoctor(cboDoctor, ""); //btnSearch.Click += BtnSearch_Click; //btnReq.Click += BtnReq_Click; pageLoad = false; }
private OrRequest setOrRequest(DataTable dt) { OrRequest dept1 = new OrRequest(); if (dt.Rows.Count > 0) { dept1.or_req_id = dt.Rows[0][orreq.or_req_id].ToString(); dept1.or_req_code = dt.Rows[0][orreq.or_req_code].ToString(); dept1.or_req_date = dt.Rows[0][orreq.or_req_date].ToString(); dept1.patient_hn = dt.Rows[0][orreq.patient_hn].ToString(); dept1.remark = dt.Rows[0][orreq.remark].ToString(); dept1.date_create = dt.Rows[0][orreq.date_create].ToString(); dept1.date_modi = dt.Rows[0][orreq.date_modi].ToString(); dept1.date_cancel = dt.Rows[0][orreq.date_cancel].ToString(); dept1.user_create = dt.Rows[0][orreq.user_create].ToString(); dept1.user_modi = dt.Rows[0][orreq.user_modi].ToString(); dept1.user_cancel = dt.Rows[0][orreq.user_cancel].ToString(); dept1.active = dt.Rows[0][orreq.active].ToString(); dept1.doctor_anesthesia_id = dt.Rows[0][orreq.doctor_anesthesia_id].ToString(); dept1.patient_name = dt.Rows[0][orreq.patient_name].ToString(); dept1.doctor_surgical_id = dt.Rows[0][orreq.doctor_surgical_id].ToString(); dept1.or_date = dt.Rows[0][orreq.or_date].ToString(); dept1.or_time = dt.Rows[0][orreq.or_time].ToString(); dept1.status_or = dt.Rows[0][orreq.status_or].ToString(); dept1.b_service_point_id = dt.Rows[0][orreq.b_service_point_id].ToString(); dept1.or_id = dt.Rows[0][orreq.or_id].ToString(); dept1.opera_id = dt.Rows[0][orreq.opera_id].ToString(); dept1.t_patient_id = dt.Rows[0][orreq.t_patient_id].ToString(); dept1.status_urgent = dt.Rows[0][orreq.status_urgent].ToString(); dept1.anesthesia_id = dt.Rows[0][orreq.anesthesia_id].ToString(); dept1.operation_name = dt.Rows[0]["opera_name"].ToString(); dept1.operation_group_name = dt.Rows[0]["opera_group_name"].ToString(); dept1.anesthesia_name = dt.Rows[0]["anesthesia_name"].ToString(); dept1.surgeon = dt.Rows[0]["surgeon"].ToString(); } else { dept1.or_req_id = ""; dept1.or_req_code = ""; dept1.or_req_date = ""; dept1.patient_hn = ""; dept1.remark = ""; dept1.date_create = ""; dept1.date_modi = ""; dept1.date_cancel = ""; dept1.user_create = ""; dept1.user_modi = ""; dept1.user_cancel = ""; dept1.active = ""; dept1.doctor_anesthesia_id = ""; dept1.patient_name = ""; dept1.doctor_surgical_id = ""; dept1.or_date = ""; dept1.or_time = ""; dept1.status_or = ""; dept1.b_service_point_id = ""; dept1.or_id = ""; dept1.opera_id = ""; dept1.t_patient_id = ""; dept1.status_urgent = ""; dept1.anesthesia_id = ""; dept1.operation_name = ""; dept1.operation_group_name = ""; dept1.anesthesia_name = ""; dept1.surgeon = ""; } return(dept1); }