public String selectByMaxPIDOD() { PatientOld cop1 = new PatientOld(); DataTable dt = new DataTable(); int chk = 0; int year = DateTime.Now.Year * 100000; String re = ""; String sql = "select max(PID) as MAXPID from Patient "; dt = conn.selectData(conn.conn, sql); if (dt.Rows.Count > 0) { re = dt.Rows[0]["MAXPID"].ToString(); if (int.TryParse(re, out chk)) { } else { chk = 0; } //chk = int.Parse(re); } if (year < chk) { chk = chk + 1; } else { chk = year + 1; } //IDS = "HN-".substr($PID, -5). "/".substr(date("Y", time()) + 543, -2);// return(chk.ToString()); }
private PatientOld setPatient1(PatientOld stf1) { stf1.Address = ""; stf1.Age = ""; stf1.AgentID = ""; stf1.Allergy = ""; stf1.BuildingVillage = ""; stf1.CompanyName = ""; stf1.CompanyPhoneNo = ""; stf1.ContractName = ""; stf1.DateOfBirth = ""; stf1.District = ""; stf1.Email = ""; stf1.EmergencyPersonAddress = ""; stf1.EmergencyPersonalContact = ""; stf1.EPAddress = ""; stf1.EPDistrict = ""; stf1.EPEmail = ""; stf1.EPHomePhoneNo = ""; stf1.EPMobilePhoneNo = ""; stf1.EPProvince = ""; stf1.EPRoad = ""; stf1.EPSubDistrict = ""; stf1.EPZipcode = ""; stf1.HomePhoneNo = ""; stf1.IDNumber = ""; stf1.IDType = ""; stf1.InsuranceName = ""; stf1.MaritalID = ""; stf1.MobilePhoneNo = ""; stf1.Moo = ""; stf1.Nationality = ""; stf1.Occupation = ""; stf1.OName = ""; stf1.OSurname = ""; stf1.PatientTypeID = ""; stf1.PaymentID = ""; stf1.PID = ""; stf1.PIDS = ""; stf1.PName = ""; stf1.Province = ""; stf1.PSurname = ""; stf1.Race = ""; stf1.RelationshipID = ""; stf1.RelationshipOther = ""; stf1.Religion = ""; stf1.Road = ""; stf1.SexID = ""; stf1.Soi = ""; stf1.SubDistrict = ""; stf1.SurfixID = ""; stf1.ZipCode = ""; stf1.FullName = ""; return(stf1); }
public String insertPatientOld(PatientOld p, String userId) { String re = ""; if (p.PID.Equals("")) { re = insert(p, ""); } else { re = update(p, ""); } return(re); }
public PatientOld selectByPk1(String pttId) { PatientOld cop1 = new PatientOld(); DataTable dt = new DataTable(); String sql = "select pttO.* " + ",CONCAT(IFNULL(sfn.SurfixName,''),' ', pttO." + pttO.PName + ",' ',pttO." + pttO.PSurname + ") as namee " + "From " + pttO.table + " pttO " + "Left Join SurfixName sfn on sfn.SurfixID = pttO.SurfixID " + "Where pttO." + pttO.pkField + " ='" + pttId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setPatient(dt); return(cop1); }
public PatientOld selectByHnLike1(String pttId) { PatientOld cop1 = new PatientOld(); DataTable dt = new DataTable(); String sql = "select pttO.*,sfn.SurfixName " + ",CONCAT(IFNULL(sfn.SurfixName,''),' ', pttO." + pttO.PName + ",' ',pttO." + pttO.PSurname + ") as namee " + ",CONCAT(IFNULL(sfn.SurfixName,''),' ', pttO." + pttO.OName + ",' ',pttO." + pttO.OSurname + ") as namet " + "From " + pttO.table + " pttO " + "Left Join SurfixName sfn on sfn.SurfixID = pttO.SurfixID " + "Where pttO." + pttO.PIDS + " like '%" + pttId + "%' " + "limit 0,1"; dt = conn.selectData(conn.conn, sql); cop1 = setPatient(dt); return(cop1); }
public String insertPatientOld(Patient p, String userId) { String re = ""; PatientOld pttO1 = setPatientToOLD(p); if (pttO1.PID.Equals("")) { pttO1.PID = selectByMaxPID(); pttO1.PIDS = genHN(pttO1.PID); re = insert(pttO1, ""); re = pttO1.PID; } else { re = update(pttO1, ""); } return(re); }
private void initConfig() { fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold); //C1ThemeController.ApplicationTheme = ic.iniC.themeApplication; theme1.Theme = ic.iniC.themeApplication; theme1.SetTheme(sB, "BeigeOne"); //theme1.SetTheme(tabOrder, "MacSilver"); ic.ivfDB.dtrOldDB.setCboDoctor(cboDoctor, ""); ic.ivfDB.eggsDB.setCboAddLab(cboAmh); ic.ivfDB.eggsDB.setCboTypingOther(cboOther); ic.ivfDB.eggsDB.setCboBhcgTest(cboBhcg); sB1.Text = ""; bg = txtHn.BackColor; fc = txtHn.ForeColor; ff = txtHn.Font; vsOld = new VisitOld(); vs = new Visit(); ptt = new Patient(); pttOld = new PatientOld(); eggs = new EggSti(); stt = new C1SuperTooltip(); sep = new C1SuperErrorProvider(); color = ColorTranslator.FromHtml(ic.iniC.grfRowColor); initGrfEggSti(); btnGenEggSti.Click += BtnGenEggSti_Click; btnSave.Click += BtnSave_Click; chkAbnormal.CheckedChanged += ChkAbnormal_CheckedChanged; ChkAbnormal_CheckedChanged(null, null); chkOther.CheckedChanged += ChkOther_CheckedChanged; chkAmh.CheckedChanged += ChkAmh_CheckedChanged; ChkOther_CheckedChanged(null, null); ChkAmh_CheckedChanged(null, null); btnPrint.Click += BtnPrint_Click; setControl(); }
private void setControl() { eggs = ic.ivfDB.eggsDB.selectByPk1(eggstiid); txtId.Value = eggs.egg_sti_id; vsOld = ic.ivfDB.ovsDB.selectByPk1(vsid); pttOld = ic.ivfDB.pttOldDB.selectByPk1(vsOld.PID); vs = ic.ivfDB.vsDB.selectByVn(vsid); ptt = ic.ivfDB.pttDB.selectByHn(vsOld.PIDS); txtPttId.Value = ptt.t_patient_id; if (eggs.egg_sti_id.Equals("")) { eggs = ic.ivfDB.eggsDB.selectByVsId(vsid); if (eggs.egg_sti_id.Equals("")) { eggs = ic.ivfDB.eggsDB.selectByPttId(txtPttId.Text); if (!eggs.egg_sti_id.Equals("")) { txtId.Value = eggs.egg_sti_id; eggstiid = txtId.Text; } } } if (eggs.egg_sti_id.Equals("")) { setControl1(); btnGenEggSti.Enabled = true; btnSave.Enabled = false; setControl1(); } else { btnGenEggSti.Enabled = false; btnSave.Enabled = true; setControl1(); } setControlEggSti(); }
private void chkNull(PatientOld p) { int chk = 0; p.Address = p.Address == null ? "" : p.Address; p.Age = p.Age == null ? "" : p.Age; p.Allergy = p.Allergy == null ? "" : p.Allergy; p.BuildingVillage = p.BuildingVillage == null ? "" : p.BuildingVillage; p.CompanyName = p.CompanyName == null ? "" : p.CompanyName; p.CompanyPhoneNo = p.CompanyPhoneNo == null ? "" : p.CompanyPhoneNo; p.ContractName = p.ContractName == null ? "" : p.ContractName; p.DateOfBirth = p.DateOfBirth == null ? "" : p.DateOfBirth; p.District = p.District == null ? "" : p.District; p.Email = p.Email == null ? "" : p.Email; p.EmergencyPersonAddress = p.EmergencyPersonAddress == null ? "" : p.EmergencyPersonAddress; p.EmergencyPersonalContact = p.EmergencyPersonalContact == null ? "" : p.EmergencyPersonalContact; p.EPAddress = p.EPAddress == null ? "" : p.EPAddress; p.EPDistrict = p.EPDistrict == null ? "" : p.EPDistrict; p.EPEmail = p.EPEmail == null ? "" : p.EPEmail; p.EPHomePhoneNo = p.EPHomePhoneNo == null ? "" : p.EPHomePhoneNo; p.EPMobilePhoneNo = p.EPMobilePhoneNo == null ? "" : p.EPMobilePhoneNo; p.EPProvince = p.EPProvince == null ? "" : p.EPProvince; p.EPRoad = p.EPRoad == null ? "" : p.EPRoad; p.EPSubDistrict = p.EPSubDistrict == null ? "" : p.EPSubDistrict; p.EPZipcode = p.EPZipcode == null ? "" : p.EPZipcode; p.HomePhoneNo = p.HomePhoneNo == null ? "" : p.HomePhoneNo; p.IDNumber = p.IDNumber == null ? "" : p.IDNumber; p.IDType = p.IDType == null ? "" : p.IDType; p.InsuranceName = p.InsuranceName == null ? "" : p.InsuranceName; p.MobilePhoneNo = p.MobilePhoneNo == null ? "" : p.MobilePhoneNo; p.Moo = p.Moo == null ? "" : p.Moo; p.Nationality = p.Nationality == null ? "" : p.Nationality; p.Occupation = p.Occupation == null ? "" : p.Occupation; p.OName = p.OName == null ? "" : p.OName; p.OSurname = p.OSurname == null ? "" : p.OSurname; p.PIDS = p.PIDS == null ? "" : p.PIDS; p.PName = p.PName == null ? "" : p.PName; p.Province = p.Province == null ? "" : p.Province; p.PSurname = p.PSurname == null ? "" : p.PSurname; p.Race = p.Race == null ? "" : p.Race; p.RelationshipOther = p.RelationshipOther == null ? "" : p.RelationshipOther; p.Religion = p.Religion == null ? "" : p.Religion; p.Road = p.Road == null ? "" : p.Road; p.Soi = p.Soi == null ? "" : p.Soi; p.SubDistrict = p.SubDistrict == null ? "" : p.SubDistrict; p.ZipCode = p.ZipCode == null ? "" : p.ZipCode; //p.remark = p.remark == null ? "" : p.remark; //p.PID = int.TryParse(p.PID, out chk) ? chk.ToString() : "0"; p.SurfixID = int.TryParse(p.SurfixID, out chk) ? chk.ToString() : "0"; p.SexID = int.TryParse(p.SexID, out chk) ? chk.ToString() : "0"; p.MaritalID = int.TryParse(p.MaritalID, out chk) ? chk.ToString() : "0"; p.RelationshipID = int.TryParse(p.RelationshipID, out chk) ? chk.ToString() : "0"; p.EmergencyPersonAddress = int.TryParse(p.EmergencyPersonAddress, out chk) ? chk.ToString() : "0"; p.PaymentID = int.TryParse(p.PaymentID, out chk) ? chk.ToString() : "0"; p.AgentID = int.TryParse(p.AgentID, out chk) ? chk.ToString() : "0"; p.PatientTypeID = int.TryParse(p.PatientTypeID, out chk) ? chk.ToString() : "0"; p.IDType = int.TryParse(p.IDType, out chk) ? chk.ToString() : "0"; //p.DateOfBirth = p.DateOfBirth.Equals("") ? null : p.DateOfBirth; //p.IDType = p.IDType.Equals("") ? null : p.IDType; }
public PatientOld setPatient(DataTable dt) { PatientOld ptt1 = new PatientOld(); if (dt.Rows.Count > 0) { ptt1.Address = dt.Rows[0][pttO.Address].ToString(); ptt1.Age = dt.Rows[0][pttO.Age].ToString(); ptt1.AgentID = dt.Rows[0][pttO.AgentID].ToString(); ptt1.Allergy = dt.Rows[0][pttO.Allergy].ToString(); ptt1.BuildingVillage = dt.Rows[0][pttO.BuildingVillage].ToString(); ptt1.CompanyName = dt.Rows[0][pttO.CompanyName].ToString(); ptt1.CompanyPhoneNo = dt.Rows[0][pttO.CompanyPhoneNo].ToString(); ptt1.ContractName = dt.Rows[0][pttO.ContractName].ToString(); ptt1.DateOfBirth = dt.Rows[0][pttO.DateOfBirth].ToString(); ptt1.District = dt.Rows[0][pttO.District].ToString(); ptt1.Email = dt.Rows[0][pttO.Email].ToString(); ptt1.EmergencyPersonAddress = dt.Rows[0][pttO.EmergencyPersonAddress].ToString(); ptt1.EmergencyPersonalContact = dt.Rows[0][pttO.EmergencyPersonalContact].ToString(); ptt1.EPAddress = dt.Rows[0][pttO.EPAddress].ToString(); ptt1.EPDistrict = dt.Rows[0][pttO.EPDistrict].ToString(); ptt1.EPEmail = dt.Rows[0][pttO.EPEmail].ToString(); ptt1.EPHomePhoneNo = dt.Rows[0][pttO.EPHomePhoneNo].ToString(); ptt1.EPMobilePhoneNo = dt.Rows[0][pttO.EPMobilePhoneNo].ToString(); ptt1.EPProvince = dt.Rows[0][pttO.EPProvince].ToString(); ptt1.EPRoad = dt.Rows[0][pttO.EPRoad].ToString(); ptt1.EPSubDistrict = dt.Rows[0][pttO.EPSubDistrict].ToString(); ptt1.EPZipcode = dt.Rows[0][pttO.EPZipcode].ToString(); ptt1.HomePhoneNo = dt.Rows[0][pttO.HomePhoneNo].ToString(); ptt1.IDNumber = dt.Rows[0][pttO.IDNumber].ToString(); ptt1.IDType = dt.Rows[0][pttO.IDType].ToString(); ptt1.InsuranceName = dt.Rows[0][pttO.InsuranceName].ToString(); ptt1.MaritalID = dt.Rows[0][pttO.MaritalID].ToString(); ptt1.MobilePhoneNo = dt.Rows[0][pttO.MobilePhoneNo].ToString(); ptt1.Moo = dt.Rows[0][pttO.Moo].ToString(); ptt1.Nationality = dt.Rows[0][pttO.Nationality].ToString(); ptt1.Occupation = dt.Rows[0][pttO.Occupation].ToString(); ptt1.OName = dt.Rows[0][pttO.OName].ToString(); ptt1.OSurname = dt.Rows[0][pttO.OSurname].ToString(); ptt1.PatientTypeID = dt.Rows[0][pttO.PatientTypeID].ToString(); ptt1.PaymentID = dt.Rows[0][pttO.PaymentID].ToString(); ptt1.PID = dt.Rows[0][pttO.PID].ToString(); ptt1.PIDS = dt.Rows[0][pttO.PIDS].ToString(); ptt1.PName = dt.Rows[0][pttO.PName].ToString(); ptt1.Province = dt.Rows[0][pttO.Province].ToString(); ptt1.PSurname = dt.Rows[0][pttO.PSurname].ToString(); ptt1.Race = dt.Rows[0][pttO.Race].ToString(); ptt1.RelationshipID = dt.Rows[0][pttO.RelationshipID].ToString(); ptt1.RelationshipOther = dt.Rows[0][pttO.RelationshipOther].ToString(); ptt1.Religion = dt.Rows[0][pttO.Religion].ToString(); ptt1.Road = dt.Rows[0][pttO.Road].ToString(); ptt1.SexID = dt.Rows[0][pttO.SexID].ToString(); ptt1.Soi = dt.Rows[0][pttO.Soi].ToString(); ptt1.SubDistrict = dt.Rows[0][pttO.SubDistrict].ToString(); ptt1.SurfixID = dt.Rows[0][pttO.SurfixID].ToString(); ptt1.ZipCode = dt.Rows[0][pttO.ZipCode].ToString(); ptt1.FullName = dt.Rows[0]["namee"].ToString(); } else { setPatient1(ptt1); } return(ptt1); }
public PatientOld setPatientToOLD(Patient ptt) { PatientOld pttO1 = new PatientOld(); pttO1.Address = ptt.patient_house; //pttO1.PIDS = ptt.patient_hn; pttO1.Age = ptt.AgeStringShort().Replace("Y", ".").Replace("M", ".").Replace("D", "."); pttO1.AgentID = ptt.agent; pttO1.Allergy = ptt.patient_drugallergy; pttO1.BuildingVillage = ""; pttO1.CompanyName = ""; pttO1.CompanyPhoneNo = ""; pttO1.ContractName = ptt.contract; pttO1.DateOfBirth = ptt.patient_birthday; pttO1.District = ""; pttO1.Email = ptt.email; pttO1.EmergencyPersonAddress = ""; //pttO1.EmergencyPersonalContact = ptt.patient_contact_firstname+" "+ptt.patient_contact_lastname; String prefix = ""; prefix = fpfDB.getList(ptt.patient_contact_f_patient_prefix_id); //prefix = prefix.Equals("Mrs.") ? "1" : prefix.Equals("Miss") ? "2" : prefix.Equals("Mr.") ? "3" : prefix.Equals("Girl") ? "4" : prefix.Equals("Boy") ? "5" : ""; pttO1.EmergencyPersonalContact = prefix + " " + ptt.patient_contact_firstname + " " + ptt.patient_contact_lastname; pttO1.EPAddress = ""; pttO1.EPDistrict = ""; pttO1.EPEmail = ""; pttO1.EPHomePhoneNo = ""; pttO1.EPMobilePhoneNo = ""; pttO1.EPProvince = ""; pttO1.EPRoad = ""; pttO1.EPSubDistrict = ""; pttO1.EPZipcode = ""; pttO1.HomePhoneNo = ptt.mobile2; pttO1.IDNumber = ptt.passport; pttO1.IDType = ""; pttO1.InsuranceName = ptt.insurance; String mat = ""; mat = fmsDB.getList(ptt.f_patient_marriage_status_id); pttO1.MaritalID = mat.Equals("หย่า") ? "3" : mat.Equals("หม้าย") ? "4" : mat.Equals("โสด") ? "1" : mat.Equals("คู่") ? "2" : ""; pttO1.MobilePhoneNo = ptt.mobile1; pttO1.Moo = ptt.patient_moo; pttO1.Nationality = fpnDB.getList(ptt.f_patient_nation_id); pttO1.Occupation = ""; pttO1.OName = ""; pttO1.OSurname = ""; pttO1.PatientTypeID = ptt.patient_type; //pttO1.PaymentID = ptt.b_contract_plans_id; pttO1.PaymentID = "1"; pttO1.PID = ptt.t_patient_id_old.Equals("-1") ? "" : ptt.t_patient_id_old.Equals("0") ? "" : ptt.t_patient_id_old; pttO1.PIDS = ptt.patient_hn; pttO1.PName = ptt.patient_firstname_e; pttO1.Province = ""; pttO1.PSurname = ptt.patient_lastname_e; pttO1.Race = fracDB.getList(ptt.f_patient_race_id); pttO1.RelationshipID = ""; pttO1.RelationshipOther = ""; pttO1.Religion = frgDB.getList(ptt.f_patient_religion_id); pttO1.Road = ptt.patient_road; pttO1.SexID = sexDB.getList(ptt.f_sex_id).Equals("ชาย") ? "1" : "2"; pttO1.Soi = ""; String pre = ""; pre = fpfDB.getList(ptt.f_patient_prefix_id); pttO1.SubDistrict = ""; pttO1.SurfixID = pre.Equals("Mrs.") ? "1" : pre.Equals("Miss") ? "2" : pre.Equals("Mr.") ? "3" : pre.Equals("Girl") ? "4" : pre.Equals("Boy") ? "5" : ""; pttO1.ZipCode = ""; return(pttO1); }
private void initConfig() { pttO = new PatientOld(); pttO.Address = "Address"; pttO.Age = "Age"; pttO.AgentID = "AgentID"; pttO.Allergy = "Allergy"; pttO.BuildingVillage = "BuildingVillage"; pttO.CompanyName = "CompanyName"; pttO.CompanyPhoneNo = "CompanyPhoneNo"; pttO.ContractName = "ContractName"; pttO.DateOfBirth = "DateOfBirth"; pttO.District = "District"; pttO.Email = "Email"; pttO.EmergencyPersonAddress = "EmergencyPersonAddress"; pttO.EmergencyPersonalContact = "EmergencyPersonalContact"; pttO.EPAddress = "EPAddress"; pttO.EPDistrict = "EPDistrict"; pttO.EPEmail = "EPEmail"; pttO.EPHomePhoneNo = "EPHomePhoneNo"; pttO.EPMobilePhoneNo = "EPMobilePhoneNo"; pttO.EPProvince = "EPProvince"; pttO.EPRoad = "EPRoad"; pttO.EPSubDistrict = "EPSubDistrict"; pttO.EPZipcode = "EPZipcode"; pttO.HomePhoneNo = "HomePhoneNo"; pttO.IDNumber = "IDNumber"; pttO.IDType = "IDType"; pttO.InsuranceName = "InsuranceName"; pttO.MaritalID = "MaritalID"; pttO.MobilePhoneNo = "MobilePhoneNo"; pttO.Moo = "Moo"; pttO.Nationality = "Nationality"; pttO.Occupation = "Occupation"; pttO.OName = "OName"; pttO.OSurname = "OSurname"; pttO.PatientTypeID = "PatientTypeID"; pttO.PaymentID = "PaymentID"; pttO.PID = "PID"; pttO.PIDS = "PIDS"; pttO.PName = "PName"; pttO.Province = "Province"; pttO.PSurname = "PSurname"; pttO.Race = "Race"; pttO.RelationshipID = "RelationshipID"; pttO.RelationshipOther = "RelationshipOther"; pttO.Religion = "Religion"; pttO.Road = "Road"; pttO.SexID = "SexID"; pttO.Soi = "Soi"; pttO.SubDistrict = "SubDistrict"; pttO.SurfixID = "SurfixID"; pttO.ZipCode = "ZipCode"; pttO.table = "Patient"; pttO.pkField = "PID"; sexDB = new FSexDB(conn); fpfDB = new FPrefixDB(conn); fmsDB = new FMarriageStatusDB(conn); fpnDB = new FNationDB(conn); frlDB = new FRelationDB(conn); fracDB = new FRaceDB(conn); frgDB = new FReligionDB(conn); }
public String update(PatientOld p, String userId) { String re = ""; String sql = ""; chkNull(p); sql = "Update " + pttO.table + " " + " Set " + pttO.Address + "='" + p.Address + "' " + "," + pttO.Age + "='" + p.Age + "' " + "," + pttO.AgentID + "='" + p.AgentID + "' " + "," + pttO.Allergy + "='" + p.Allergy + "' " + "," + pttO.BuildingVillage + "='" + p.BuildingVillage + "' " + "," + pttO.CompanyName + "='" + p.CompanyName + "' " + "," + pttO.CompanyPhoneNo + "='" + p.CompanyPhoneNo + "' " + "," + pttO.ContractName + "='" + p.ContractName + "' " + "," + pttO.DateOfBirth + "='" + p.DateOfBirth + "' " + "," + pttO.District + "='" + p.District + "' " + "," + pttO.Email + "='" + p.Email + "' " + "," + pttO.EmergencyPersonAddress + "='" + p.EmergencyPersonAddress + "' " + "," + pttO.EmergencyPersonalContact + "='" + p.EmergencyPersonalContact + "' " + "," + pttO.EPAddress + "='" + p.EPAddress + "' " + "," + pttO.EPDistrict + "='" + p.EPDistrict + "' " + "," + pttO.EPEmail + "='" + p.EPEmail + "' " + "," + pttO.EPHomePhoneNo + "='" + p.EPHomePhoneNo + "' " + "," + pttO.EPMobilePhoneNo + "='" + p.EPMobilePhoneNo + "' " + "," + pttO.EPProvince + "='" + p.EPProvince + "' " + "," + pttO.EPRoad + "='" + p.EPRoad + "' " + "," + pttO.EPSubDistrict + "='" + p.EPSubDistrict + "' " + "," + pttO.EPZipcode + "='" + p.EPZipcode + "' " + "," + pttO.HomePhoneNo + "='" + p.HomePhoneNo + "' " + "," + pttO.IDNumber + "='" + p.IDNumber + "' " + "," + pttO.IDType + "='" + p.IDType + "' " + "," + pttO.InsuranceName + "='" + p.InsuranceName + "' " + "," + pttO.MaritalID + "='" + p.MaritalID + "' " + "," + pttO.MobilePhoneNo + "='" + p.MobilePhoneNo + "' " + "," + pttO.Moo + "='" + p.Moo + "' " + "," + pttO.Nationality + "='" + p.Nationality + "' " + "," + pttO.Occupation + "='" + p.Occupation + "' " + "," + pttO.OName + "='" + p.OName + "' " + "," + pttO.OSurname + "='" + p.OSurname + "' " + "," + pttO.PatientTypeID + "='" + p.PatientTypeID + "' " + "," + pttO.PaymentID + "='" + p.PaymentID + "' " + //"," + pttO.PIDS + "='" + p.PIDS + "' " + "," + pttO.PName + "='" + p.PName + "' " + "," + pttO.Province + "='" + p.Province + "' " + "," + pttO.PSurname + "='" + p.PSurname + "' " + "," + pttO.Race + "='" + p.Race + "' " + "," + pttO.RelationshipID + "='" + p.RelationshipID + "' " + "," + pttO.RelationshipOther + "='" + p.RelationshipOther + "' " + "," + pttO.Religion + "='" + p.Religion + "' " + "," + pttO.Road + "='" + p.Road + "' " + "," + pttO.SexID + "='" + p.SexID + "' " + "," + pttO.Soi + "='" + p.Soi + "' " + "," + pttO.SubDistrict + "='" + p.SubDistrict + "' " + "," + pttO.SurfixID + "='" + p.SurfixID + "' " + "," + pttO.ZipCode + "='" + p.ZipCode + "' " + " Where " + pttO.pkField + " = '" + p.PID + "' " ; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; new LogWriter("e", "insert err Message " + ex.Message + " InnerException " + ex.InnerException); } return(re); }
public String insert(PatientOld p, String userId) { String re = ""; String sql = ""; chkNull(p); try { if (p.DateOfBirth.Equals("")) { sql = "Insert Into " + pttO.table + "(" + pttO.Address + "," + pttO.Age + "," + pttO.AgentID + "," + pttO.Allergy + "," + pttO.BuildingVillage + "," + pttO.CompanyName + "," + pttO.CompanyPhoneNo + "," + pttO.ContractName + "," + pttO.DateOfBirth + "," + pttO.District + "," + pttO.Email + "," + pttO.EmergencyPersonAddress + "," + pttO.EmergencyPersonalContact + "," + pttO.EPAddress + "," + pttO.EPDistrict + "," + pttO.EPEmail + "," + pttO.EPHomePhoneNo + "," + pttO.EPMobilePhoneNo + "," + pttO.EPProvince + "," + pttO.EPRoad + "," + pttO.EPSubDistrict + "," + pttO.EPZipcode + "," + pttO.HomePhoneNo + "," + pttO.IDNumber + "," + pttO.IDType + "," + pttO.InsuranceName + "," + pttO.MaritalID + "," + pttO.MobilePhoneNo + "," + pttO.Moo + "," + pttO.Nationality + "," + pttO.Occupation + "," + pttO.OName + "," + pttO.OSurname + "," + pttO.PatientTypeID + "," + pttO.PaymentID + "," + pttO.PIDS + "," + pttO.PName + "," + pttO.Province + "," + pttO.PSurname + "," + pttO.Race + "," + pttO.RelationshipID + "," + pttO.RelationshipOther + "," + pttO.Religion + "," + pttO.Road + "," + pttO.SexID + "," + pttO.Soi + "," + pttO.SubDistrict + "," + pttO.SurfixID + "," + pttO.ZipCode + "," + pttO.PID + " " + ") " + "Values ('" + p.Address + "','" + p.Age.Replace("'", "''") + "','" + p.AgentID.Replace("'", "''") + "'," + "'" + p.Allergy.Replace("'", "''") + "','" + p.BuildingVillage.Replace("'", "''") + "','" + p.CompanyName.Replace("'", "''") + "'," + "'" + p.CompanyPhoneNo + "','" + p.ContractName.Replace("'", "''") + "',null," + "'" + p.District.Replace("'", "''") + "','" + p.Email + "','" + p.EmergencyPersonAddress + "'," + "'" + p.EmergencyPersonalContact + "','" + p.EPAddress.Replace("'", "''") + "','" + p.EPDistrict.Replace("'", "''") + "'," + "'" + p.EPEmail.Replace("'", "''") + "','" + p.EPHomePhoneNo + "','" + p.EPMobilePhoneNo + "'," + "'" + p.EPProvince + "','" + p.EPRoad + "','" + p.EPSubDistrict + "'," + "'" + p.EPZipcode + "','" + p.HomePhoneNo + "','" + p.IDNumber + "'," + "'" + p.IDType.Replace("'", "''") + "','" + p.InsuranceName.Replace("'", "''") + "','" + p.MaritalID.Replace("'", "''") + "'," + "'" + p.MobilePhoneNo + "','" + p.Moo + "','" + p.Nationality + "'," + "'" + p.Occupation.Replace("'", "''") + "','" + p.OName + "','" + p.OSurname + "'," + "'" + p.PatientTypeID.Replace("'", "''") + "','" + p.PaymentID.Replace("'", "''") + "','" + p.PIDS.Replace("'", "''") + "'," + "'" + p.PName.Replace("'", "''") + "','" + p.Province + "','" + p.PSurname + "'," + "'" + p.Race + "','" + p.RelationshipID + "','" + p.RelationshipOther + "'," + "'" + p.Religion + "','" + p.Road + "','" + p.SexID + "'," + "'" + p.Soi + "','" + p.SubDistrict + "','" + p.SurfixID.Replace("'", "''") + "'," + "'" + p.ZipCode + "'," + p.PID + " " + ")"; } else { sql = "Insert Into " + pttO.table + "(" + pttO.Address + "," + pttO.Age + "," + pttO.AgentID + "," + pttO.Allergy + "," + pttO.BuildingVillage + "," + pttO.CompanyName + "," + pttO.CompanyPhoneNo + "," + pttO.ContractName + "," + pttO.DateOfBirth + "," + pttO.District + "," + pttO.Email + "," + pttO.EmergencyPersonAddress + "," + pttO.EmergencyPersonalContact + "," + pttO.EPAddress + "," + pttO.EPDistrict + "," + pttO.EPEmail + "," + pttO.EPHomePhoneNo + "," + pttO.EPMobilePhoneNo + "," + pttO.EPProvince + "," + pttO.EPRoad + "," + pttO.EPSubDistrict + "," + pttO.EPZipcode + "," + pttO.HomePhoneNo + "," + pttO.IDNumber + "," + pttO.IDType + "," + pttO.InsuranceName + "," + pttO.MaritalID + "," + pttO.MobilePhoneNo + "," + pttO.Moo + "," + pttO.Nationality + "," + pttO.Occupation + "," + pttO.OName + "," + pttO.OSurname + "," + pttO.PatientTypeID + "," + pttO.PaymentID + "," + pttO.PIDS + "," + pttO.PName + "," + pttO.Province + "," + pttO.PSurname + "," + pttO.Race + "," + pttO.RelationshipID + "," + pttO.RelationshipOther + "," + pttO.Religion + "," + pttO.Road + "," + pttO.SexID + "," + pttO.Soi + "," + pttO.SubDistrict + "," + pttO.SurfixID + "," + pttO.ZipCode + "," + pttO.PID + " " + ") " + "Values ('" + p.Address + "','" + p.Age.Replace("'", "''") + "','" + p.AgentID.Replace("'", "''") + "'," + "'" + p.Allergy.Replace("'", "''") + "','" + p.BuildingVillage.Replace("'", "''") + "','" + p.CompanyName.Replace("'", "''") + "'," + "'" + p.CompanyPhoneNo + "','" + p.ContractName.Replace("'", "''") + "','" + p.DateOfBirth.Replace("'", "''") + "'," + "'" + p.District.Replace("'", "''") + "','" + p.Email + "','" + p.EmergencyPersonAddress + "'," + "'" + p.EmergencyPersonalContact + "','" + p.EPAddress.Replace("'", "''") + "','" + p.EPDistrict.Replace("'", "''") + "'," + "'" + p.EPEmail.Replace("'", "''") + "','" + p.EPHomePhoneNo + "','" + p.EPMobilePhoneNo + "'," + "'" + p.EPProvince + "','" + p.EPRoad + "','" + p.EPSubDistrict + "'," + "'" + p.EPZipcode + "','" + p.HomePhoneNo + "','" + p.IDNumber + "'," + "'" + p.IDType.Replace("'", "''") + "','" + p.InsuranceName.Replace("'", "''") + "','" + p.MaritalID.Replace("'", "''") + "'," + "'" + p.MobilePhoneNo + "','" + p.Moo + "','" + p.Nationality + "'," + "'" + p.Occupation.Replace("'", "''") + "','" + p.OName + "','" + p.OSurname + "'," + "'" + p.PatientTypeID.Replace("'", "''") + "','" + p.PaymentID.Replace("'", "''") + "','" + p.PIDS.Replace("'", "''") + "'," + "'" + p.PName.Replace("'", "''") + "','" + p.Province + "','" + p.PSurname + "'," + "'" + p.Race + "','" + p.RelationshipID + "','" + p.RelationshipOther + "'," + "'" + p.Religion + "','" + p.Road + "','" + p.SexID + "'," + "'" + p.Soi + "','" + p.SubDistrict + "','" + p.SurfixID.Replace("'", "''") + "'," + "'" + p.ZipCode + "'," + p.PID + " " + ")"; } re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; new LogWriter("e", "insert err Message " + ex.Message + " InnerException " + ex.InnerException); } return(re); }
private void initConfig() { //Set up the form. this.MaximizeBox = false; this.MinimizeBox = false; this.BackColor = Color.White; this.ForeColor = Color.Black; pttOld = new PatientOld(); pttImg = new PatientImage(); pttOld = ic.ivfDB.pttOldDB.selectByPk1(pttOldId); pttImg = ic.ivfDB.pttImgDB.selectByPk1(pttImgId); this.Size = new System.Drawing.Size(1224, 768); fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); //this.Location = pp; this.Text = "Run-time Controls"; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.StartPosition = FormStartPosition.CenterParent; //this.StartPosition = FormStartPosition.CenterParent; panel1 = new Panel(); panel1.Dock = DockStyle.Fill; pnR = new Panel(); pnR.Dock = DockStyle.Right; pnR.Width = newWidth; pnL = new Panel(); pnL.Dock = DockStyle.Fill; lb2 = new Label(); lb2.Font = fEdit; lb2.Text = "Description"; lb2.AutoSize = true; pnR.Controls.Add(lb2); lb2.Location = new System.Drawing.Point(grd1, gapLine); txtId = new TextBox(); txtDesc = new TextBox(); txtDesc.Font = fEdit; txtDesc.Text = ""; txtDesc.Size = new System.Drawing.Size(200, ControlHeight); pnR.Controls.Add(txtDesc); txtDesc.Location = new System.Drawing.Point(grd1, lb2.Height + gapLine + gapLine); btnSend = new Button(); btnSend.Font = fEdit; btnSend.Text = "Save"; btnSend.Size = new System.Drawing.Size(120, ControlHeight); pnR.Controls.Add(btnSend); btnSend.Location = new System.Drawing.Point(grd1, line3); btnSend.Click += BtnSend_Click; btnPrn = new Button(); btnPrn.Font = fEdit; btnPrn.Text = "Print"; btnPrn.Size = new System.Drawing.Size(120, ControlHeight); pnR.Controls.Add(btnPrn); btnPrn.Location = new System.Drawing.Point(grd1, line4); btnPrn.Click += BtnPrn_Click; pic = new C1PictureBox(); pic.Dock = DockStyle.Fill; panel1.Controls.Add(pnR); panel1.Controls.Add(pnL); pnL.Controls.Add(pic); pnR.Controls.Add(btnSend); Controls.Add(panel1); String ext = Path.GetExtension(filename); //String[] sur = filename.Split('.'); //String ex = ""; //if (sur.Length == 2) //{ // ex = sur[1]; //} stream = new MemoryStream(); if (ext.IndexOf("pdf") < 0) { try { //loadedImage = Image.FromFile(filename); stream = ic.ftpC.download(filename); Bitmap bitmap = new Bitmap(stream); loadedImage = bitmap; int originalWidth = loadedImage.Width; int newWidth = 1000; if (originalWidth > newWidth) { resizedImage = loadedImage.GetThumbnailImage(newWidth, (newWidth * loadedImage.Height) / originalWidth, null, IntPtr.Zero); } else { resizedImage = loadedImage; } } catch (Exception ex1) { } } else { resizedImage = Resources.pdf_symbol_300; } //loadedImage = Image.FromFile(filename); //int originalWidth = loadedImage.Width; //resizedImage = loadedImage.GetThumbnailImage(newWidth, (newWidth * loadedImage.Height) / originalWidth, null, IntPtr.Zero); //pic.Image = resizedImage; if (stream.Length > 0) { pic.Image = Image.FromStream(stream); pic.SizeMode = PictureBoxSizeMode.StretchImage; } }
private void setControl(String pttid, String pttOid, String vsid) { if (ic.iniC.statusAppDonor.Equals("1")) { ptt = ic.ivfDB.pttDB.selectByPk1(pttid); if (ptt.t_patient_id.Equals("")) { if (!pttOid.Equals("")) { ptt = ic.ivfDB.pttDB.selectByIDold(pttOid); } else { vs = ic.ivfDB.vsDB.selectByPk1(vsid); ptt = ic.ivfDB.pttDB.selectByPk1(vs.t_patient_id); } } setControlPtt(ptt); } else { label7.Text = "HN donor :"; ptt = ic.ivfDB.pttDB.selectByPk1(pttid); pttO = ic.ivfDB.pttOldDB.selectByPk1(pttOid); txtPttO.Value = pttO.PID; if (ptt.t_patient_id.Equals("")) { txtHn.Value = pttO.PIDS; txtPttId.Value = ptt.t_patient_id; txtPttNameE.Value = pttO.PName; txtPttLNameE.Value = pttO.PSurname; //txtIdOld.Value = pttO.PID; txtPttName.Value = pttO.OName; txtPttLName.Value = pttO.OSurname; //txtContFname1.Value = pttO.EmergencyPersonalContact; txtDob.Value = pttO.DateOfBirth; ic.setC1Combo(cboAgent, pttO.AgentID); ic.setC1Combo(cboPttType, pttO.PatientTypeID); //ic.setC1Combo(cboCrl, pttO.PaymentID); ic.setC1Combo(cboSex, pttO.SexID); ic.setC1Combo(cboMarital, pttO.MaritalID); ic.setC1Combo(cboRg, pttO.Religion); ic.setC1Combo(cboPrefix, pttO.SurfixID); if (pttO.IDNumber.Length == 10) { } //txtPid.Value = pttO.IDNumber.Length == 10 ? pttO.IDNumber : ""; //txtPaasport.Value = pttO.IDNumber.Length != 10 ? pttO.IDNumber : ""; txtPaasport.Value = pttO.IDNumber; //cboName1Rl.Text = pttO.RelationshipID; //ic.setC1Combo(cboName1Rl, pttO.RelationshipID); //barcode.Text = txtHn.Text; txtEmail.Value = pttO.Email; filenamepic = txtHn.Text; ic.setC1Combo(cboAgent, pttO.AgentID); } else { setControlPtt(ptt); } } //Thread threadA = new Thread(new ParameterizedThreadStart(ExecuteA)); //threadA.Start(); }