private IList <DdvHistory> readQuery(string query) { IList <DdvHistory> list = new List <DdvHistory>(); using (dynamic connection = connectionFactory.GetConnection()) { Logger.Debug(CultureInfo.CurrentCulture, "SQL: {0}", query); Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(query, connection); using (DbDataReader reader = command.ExecuteReader()) { while (reader.Read()) { DdvHistory obj = new DdvHistory(); if (!reader.IsDBNull(0)) { obj.HospitalitySession = reader.IsDBNull(0) ? null : reader.GetString(0); obj.OperationId = reader.IsDBNull(1) ? null : reader.GetString(1); obj.OperationDate = reader.IsDBNull(2) ? DateTime.MinValue : reader.GetDateTime(2); obj.Description = reader.IsDBNull(3) ? null : reader.GetString(3); obj.DoctorName = reader.IsDBNull(4) ? null : reader.GetString(4); obj.DoctorShortName = reader.IsDBNull(5) ? null : reader.GetString(5); obj.OperationType = reader.IsDBNull(6) ? null : reader.GetString(6); obj.OperationName = reader.IsDBNull(7) ? null : reader.GetString(7); obj.ModifyDate = reader.IsDBNull(8) ? DateTime.MinValue : reader.GetDateTime(8); list.Add(obj); } } } } return(list); }
private void LoadPatientsHistoryGrid() { patientHistoryGrid.Rows.Clear(); IList <DdvHistory> allHspitalPatients = service.GetDdvHistoryService().GetHistoryByHospitalSession(hospitalitySession.ObjectId); for (int i = 0; i < allHspitalPatients.Count(); i++) { DdvHistory h = allHspitalPatients[i]; patientHistoryGrid.Rows.Add(false, h.HospitalitySession, h.OperationType, h.OperationId, h.OperationName, h.OperationDate, h.DoctorShortName, h.ModifyDate); } }
private void chooseAnalysisBtn_Click(object sender, EventArgs e) { string queryCnd = "dsid_hospitality_session='" + hospitalitySession.ObjectId + "' AND dss_operation_type IN ('ddt_ekg', 'ddt_urine_analysis'," + " 'ddt_egds', 'ddt_xray', 'ddt_uzi', 'ddt_blood_analysis')"; List <string> allAddedAnalysis = getAddedAnalysisIds(); AnalysisSelector.getInstance().ShowDialog("ddv_history", queryCnd, "dss_operation_name", "dsid_operation_id", allAddedAnalysis); if (AnalysisSelector.getInstance().isSuccess()) { List <string> diagnosies = AnalysisSelector.getInstance().returnValues(); foreach (string v in diagnosies) { DdvHistory history = service.GetDdvHistoryService().GetHistoryByOperationId(v); analysisGrid.Rows.Add(history.OperationId, history.OperationType, history.OperationName, "Дата проведения:" + history.OperationDate.ToLongDateString(), null); } } }
private void selectAnalysis_Click(object sender, EventArgs e) { if (hospitalSession == null || validTypes == null || validTypes.Count == 0) { return; } IList <string> existedAnalysisIds = new List <string>(); string queryCnd = "dsid_hospitality_session='" + hospitalSession.ObjectId + "' AND dss_operation_type IN ('" + String.Join("','", validTypes) + "')"; AnalysisSelector.getInstance().ShowDialog("ddv_history", queryCnd, "dss_operation_name", "dsid_operation_id", getConnectedAnalysisIds()); if (AnalysisSelector.getInstance().isSuccess()) { List <string> result = AnalysisSelector.getInstance().returnValues(); foreach (string id in result) { DdvHistory history = DbDataService.GetInstance().GetDdvHistoryService().GetHistoryByOperationId(id); addAnalisis(history.OperationType, history.OperationName, id); } } }