public static ClaimListItem GetClaim(long ClaimNumber) { ClaimListItem _resultClaim = new ClaimListItem(); //string connectionStr = "Data Source = hp9887\\sql5422; Initial Catalog = test_entity; Integrated Security = True; MultipleActiveResultSets = True; Application Name = EntityFramework"; ConnectionStringSettings connectionSetting = getConnectionSettings("sql01"); string connectionStr = "Data Source = " + connectionSetting.ConnectionString; SqlConnection myConnection = new SqlConnection(connectionStr); myConnection.Open(); DataTable t = new DataTable(); using (SqlDataAdapter a = new SqlDataAdapter( "Select TOP 100 claim_number,first_name,last_name,facility_name, date_claim FROM Claims INNER JOIN Users ON Users.user_id= Claims.user_id Inner JOIN Facilities ON Facilities.facility_id = Claims.facility_id WHERE Claims.claim_number=" + ClaimNumber + " ORDER BY Claims.date_claim DESC", myConnection)) { a.Fill(t); }; //It should be one row only DataRow _dataRow = t.Rows[0]; _resultClaim = convertDatarowToClaimListItem_ListClaims(_dataRow, myConnection); myConnection.Close(); return _resultClaim; }
protected void Page_Load(object sender, EventArgs e) { string _queryString = Request.QueryString["c"]; if (_queryString != null) { string _userName = HttpContext.Current.User.Identity.Name; //============================================================== //hardcoded for demo only: _userName = "******"; //============================================================== claim = ClaimsData.GetClaimsDetail(_queryString, _userName); calculateTotal(); } else { throw new Exception("There was a problem with a system. There was no Claim number."); } }
public static ClaimListItem ConvertClaimToClaimListItem(Claim claim) { ClaimListItem _claimListItem = new ClaimListItem(); _claimListItem.ClaimNumber = claim.ClaimNumber; _claimListItem.DateClaim = claim.DateClaim; _claimListItem.FacilityName = claim.FacilityName; _claimListItem.PatientFirstName = claim.PatientFirstName; _claimListItem.PatientLastName = claim.PatientLastName; _claimListItem.ServicesClaimList = claim.ServicesClaimList; _claimListItem.StatusesClaimList = claim.StatusesClaimList; _claimListItem.User_Id = claim.User_Id; return _claimListItem; }
private static ClaimListItem convertDatarowToClaimListItem_ListClaims(DataRow _dataRowClaims, SqlConnection _dbConnection) { ClaimListItem itemClaim = new ClaimListItem(); //select TOP 100 claim_number,first_name,last_name,facility_name, date_claim FROM Claims itemClaim.ClaimNumber = _dataRowClaims.Field<long>("claim_number"); itemClaim.PatientFirstName = _dataRowClaims.Field<string>("first_name"); itemClaim.PatientLastName = _dataRowClaims.Field<string>("last_name"); itemClaim.FacilityName = _dataRowClaims.Field<string>("facility_name"); itemClaim.DateClaim = _dataRowClaims.Field<DateTime>("date_claim"); itemClaim.StatusesClaimList = getStatusClaimList(itemClaim.ClaimNumber, _dbConnection); itemClaim.ServicesClaimList = getServicesClaimList(itemClaim.ClaimNumber, _dbConnection); return itemClaim; }
private static ClaimListItem convertDatarowToClaimListItem_ClaimDetails(DataRow _dataRowClaims, String _userName, SqlConnection _dbConnection) { try { ClaimListItem itemClaim = new ClaimListItem(); itemClaim.ClaimNumber = _dataRowClaims.Field<long>("claim_number"); itemClaim.PatientFirstName = _dataRowClaims.Field<string>("first_name"); itemClaim.PatientLastName = _dataRowClaims.Field<string>("last_name"); itemClaim.FacilityName = _dataRowClaims.Field<string>("facility_name"); itemClaim.DateClaim = _dataRowClaims.Field<DateTime>("date_claim"); itemClaim.AmountBilledSum = _dataRowClaims.Field<decimal?>("amount"); itemClaim.PatientResponsibilitySum = _dataRowClaims.Field<decimal?>("patient_responibility"); return itemClaim; } catch (Exception ex) { throw new Exception("Sorry, there was an application problem. Technical description:" + ex.Message); } }