Advertisement
eddywhitaker

report.aspx.cs

Feb 22nd, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 34.86 KB | None | 0 0
  1.                 private void loanDetails()
  2.                 {
  3.                     Table table = new Table();
  4.                     table.Width = Unit.Percentage(100);
  5.                     table.CellPadding = 5;
  6.  
  7.                     foreach (DataRow dr in ds.Tables[2].Rows)
  8.                     {
  9.                         TableRow tr = new TableRow();
  10.                         if (dr["risk_rating"] != DBNull.Value && Convert.ToInt32(dr["risk_rating"]) == 3)
  11.                             tr.ID = "badLoan";
  12.                         else if (dr["risk_rating"] != DBNull.Value && Convert.ToInt32(dr["risk_rating"]) == 4)
  13.                             tr.ID = "badLoan4";
  14.  
  15.                         TableCell tc = new TableCell();
  16.                         tc.Style["padding-top"] = "50px";
  17.                         tc.Text = "Loan Count";
  18.                         tc.CssClass = "description";
  19.                         tr.Cells.Add(tc);
  20.  
  21.                         tc = new TableCell();
  22.                         tc.Text = dr["#"].ToString();
  23.                         tc.Style["padding-top"] = "50px";
  24.                         tc.ColumnSpan = 3;
  25.                         tr.Cells.Add(tc);
  26.                         table.Rows.Add(tr);
  27.  
  28.                         tr = new TableRow();
  29.                         tr.ID = dr["id"].ToString();
  30.                         tc = new TableCell();
  31.                         tc.Text = "Borrower(s)";
  32.                         tc.CssClass = "description";
  33.                         tr.Cells.Add(tc);
  34.  
  35.                         tc = new TableCell();
  36.                         tc.Text = dr["last_name"].ToString().ToUpper() + ", " + dr["first_name"].ToString().ToUpper();
  37.                         tc.ColumnSpan = 3;
  38.                         tr.Cells.Add(tc);
  39.                         table.Rows.Add(tr);
  40.  
  41.                         //this information should not display if the file is denied
  42.                         if (!Convert.ToBoolean(dr["loan_denied"]))
  43.                         {
  44.                             tr = new TableRow();
  45.                             tc = new TableCell();
  46.                             tc.CssClass = "description";
  47.                             tc.Text = "Property Address";
  48.                             tr.Cells.Add(tc);
  49.  
  50.                             tc = new TableCell();
  51.                             tc.ColumnSpan = 3;
  52.                             tc.Text = dr["property_address"].ToString().ToUpper() + "<br />" + dr["property_city"].ToString().ToUpper() +
  53.                                 ", " + dr["property_state"].ToString().ToUpper() + " " + dr["property_zip"].ToString().ToUpper();
  54.                             tr.Cells.Add(tc);
  55.                             table.Rows.Add(tr);
  56.  
  57.                             tr = new TableRow();
  58.                             tc = new TableCell();
  59.                             tc.CssClass = "description";
  60.                             tc.Text = "Branch/TPO";
  61.                             tr.Cells.Add(tc);
  62.  
  63.                             tc = new TableCell();
  64.                             tc.ColumnSpan = 3;
  65.                             tc.Text = dr["branch_tpo"].ToString().ToUpper();
  66.                             tr.Cells.Add(tc);
  67.                             table.Rows.Add(tr);
  68.  
  69.                             tr = new TableRow();
  70.                             tc = new TableCell();
  71.                             tc.CssClass = "description";
  72.                             tc.Text = "Loan/Case #";
  73.                             tr.Cells.Add(tc);
  74.  
  75.                             tc = new TableCell();
  76.                             tc.Text = dr["loan_number"].ToString() + " / " + dr["fha_va_conv_case_nbr"].ToString();
  77.                             tr.Cells.Add(tc);
  78.  
  79.                             tc = new TableCell();
  80.                             tc.CssClass = "description";
  81.                             tc.Text = "LTV/CLTV";
  82.                             tr.Cells.Add(tc);
  83.  
  84.                             tc = new TableCell();
  85.                             tc.Text = dr["appraised_value_ltv_perc"].ToString().ToUpper() + " / " +
  86.                                 dr["cltv_perc"].ToString().ToUpper() + "%";
  87.                             tr.Cells.Add(tc);
  88.                             table.Rows.Add(tr);
  89.  
  90.                             tr = new TableRow();
  91.                             tc = new TableCell();
  92.                             tc.CssClass = "description";
  93.                             tc.Text = "Loan Type/Amount";
  94.                             tr.Cells.Add(tc);
  95.  
  96.                             tc = new TableCell();
  97.                             tc.Text = dr["loan_type"].ToString() +
  98.                                 (dr["loan_amount"] != DBNull.Value ? "/" + Convert.ToDecimal(dr["loan_amount"]).ToString("c") : string.Empty);
  99.                             tr.Cells.Add(tc);
  100.  
  101.                             tc = new TableCell();
  102.                             tc.CssClass = "description";
  103.                             tc.Text = "Pur/Refi";
  104.                             tr.Cells.Add(tc);
  105.  
  106.                             tc = new TableCell();
  107.                             tc.Text = dr["loan_purpose"].ToString().ToUpper();
  108.                             tr.Cells.Add(tc);
  109.                             table.Rows.Add(tr);
  110.  
  111.                             tr = new TableRow();
  112.                             tc = new TableCell();
  113.                             tc.CssClass = "description";
  114.                             tc.Text = "First Time H/O (Y/N)";
  115.                             tr.Cells.Add(tc);
  116.  
  117.                             tc = new TableCell();
  118.                             tc.Text = dr["first_time_homebuyer_yn"].ToString().ToUpper();
  119.                             tr.Cells.Add(tc);
  120.  
  121.                             tc = new TableCell();
  122.                             tc.CssClass = "description";
  123.                             tc.Text = "Rate";
  124.                             tr.Cells.Add(tc);
  125.  
  126.                             tc = new TableCell();
  127.                             tc.Text = dr["ir_perc"].ToString();
  128.                             tr.Cells.Add(tc);
  129.                             table.Rows.Add(tr);
  130.  
  131.                             tr = new TableRow();
  132.                             tc = new TableCell();
  133.                             tc.CssClass = "description";
  134.                             tc.Text = "Loan Originator";
  135.                             tr.Cells.Add(tc);
  136.  
  137.                             tc = new TableCell();
  138.                             tc.Text = dr["loan_originator"].ToString().ToUpper();
  139.                             tr.Cells.Add(tc);
  140.  
  141.                             tc = new TableCell();
  142.                             tc.CssClass = "description";
  143.                             tc.Text = "Loan Processor";
  144.                             tr.Cells.Add(tc);
  145.  
  146.                             tc = new TableCell();
  147.                             tc.Text = dr["loan_processor"].ToString().ToUpper();
  148.                             tr.Cells.Add(tc);
  149.                             table.Rows.Add(tr);
  150.  
  151.                             tr = new TableRow();
  152.                             tc = new TableCell();
  153.                             tc.CssClass = "description";
  154.                             tc.Text = "Credit Rating";
  155.                             tr.Cells.Add(tc);
  156.  
  157.                             tc = new TableCell();
  158.                             tc.Text = dr["credit_scores_file"].ToString();
  159.                             tr.Cells.Add(tc);
  160.  
  161.                             tc = new TableCell();
  162.                             tc.CssClass = "description";
  163.                             tc.Text = "QC";
  164.                             tr.Cells.Add(tc);
  165.  
  166.                             tc = new TableCell();
  167.                             tc.Text = dr["credit_scores_qc"].ToString().ToUpper();
  168.                             tr.Cells.Add(tc);
  169.                             table.Rows.Add(tr);
  170.  
  171.                             tr = new TableRow();
  172.                             tc = new TableCell();
  173.                             tc.CssClass = "description";
  174.                             tc.Text = "Ratios";
  175.                             tr.Cells.Add(tc);
  176.  
  177.                             tc = new TableCell();
  178.                             tc.Text = dr["credit_analysis_ratios_file"].ToString().ToUpper() + "% / " +
  179.                                 dr["credit_analysis_ratios_file_perc"].ToString().ToUpper() + "%";
  180.                             tr.Cells.Add(tc);
  181.  
  182.                             tc = new TableCell();
  183.                             tc.CssClass = "description";
  184.                             tc.Text = "QC";
  185.                             tr.Cells.Add(tc);
  186.  
  187.                             tc = new TableCell();
  188.                             tc.Text = dr["Credit_Analysis_Ratios_QC"].ToString().ToUpper() + "% / " +
  189.                                 dr["Credit_Analysis_Ratios_QC_Perc"].ToString().ToUpper() + "%";
  190.                             tr.Cells.Add(tc);
  191.                             table.Rows.Add(tr);
  192.  
  193.                             tr = new TableRow();
  194.                             tc = new TableCell();
  195.                             tc.CssClass = "description";
  196.                             tc.Text = "Underwriter Type";
  197.                             tr.Cells.Add(tc);
  198.  
  199.                             tc = new TableCell();
  200.                             tc.Text = dr["underwriter_type"].ToString().ToUpper();
  201.                             tr.Cells.Add(tc);
  202.  
  203.                             tc = new TableCell();
  204.                             tc.CssClass = "description";
  205.                             tc.Text = "Stated Income";
  206.                             tr.Cells.Add(tc);
  207.  
  208.                             tc = new TableCell();
  209.                             tc.Text = dr["stated"].ToString().ToUpper();
  210.                             tr.Cells.Add(tc);
  211.                             table.Rows.Add(tr);
  212.  
  213.                             tr = new TableRow();
  214.                             tc = new TableCell();
  215.                             tc.CssClass = "description";
  216.                             tc.Text = "Income/Assets";
  217.                             tr.Cells.Add(tc);
  218.  
  219.                             tc = new TableCell();
  220.                             tc.Text = dr["income_assets"].ToString().ToUpper();
  221.                             tr.Cells.Add(tc);
  222.  
  223.                             tc = new TableCell();
  224.                             tc.CssClass = "description";
  225.                             tc.Text = "Underwriter";
  226.                             tr.Cells.Add(tc);
  227.  
  228.                             tc = new TableCell();
  229.                             tc.Text = dr["underwriter_name"].ToString().ToUpper();
  230.                             tr.Cells.Add(tc);
  231.                             table.Rows.Add(tr);
  232.  
  233.                             tr = new TableRow();
  234.                             tc = new TableCell();
  235.                             tc.CssClass = "description";
  236.                             tc.Text = "APR Calculation File";
  237.                             tr.Cells.Add(tc);
  238.  
  239.                             tc = new TableCell();
  240.                             tc.Text = dr["apr_file"].ToString();
  241.                             tr.Cells.Add(tc);
  242.  
  243.                             tc = new TableCell();
  244.                             tc.CssClass = "description";
  245.                             tc.Text = "QC";
  246.                             tr.Cells.Add(tc);
  247.  
  248.                             tc = new TableCell();
  249.                             tc.Text = dr["apr_qc"].ToString();
  250.                             tr.Cells.Add(tc);
  251.                             table.Rows.Add(tr);
  252.  
  253.                             tr = new TableRow();
  254.                             tc = new TableCell();
  255.                             tc.CssClass = "description";
  256.                             tc.Text = "Appraiser";
  257.                             tr.Cells.Add(tc);
  258.  
  259.                             tc = new TableCell();
  260.                             tc.Text = dr["appraiser"].ToString().ToUpper();
  261.                             tr.Cells.Add(tc);
  262.  
  263.                             tc = new TableCell();
  264.                             tc.CssClass = "description";
  265.                             tc.Text = "Value";
  266.                             tr.Cells.Add(tc);
  267.  
  268.                             tc = new TableCell();
  269.                             tc.Text = dr["appraised_value"].ToString().ToUpper();
  270.                             tr.Cells.Add(tc);
  271.                             table.Rows.Add(tr);
  272.  
  273.                             tr = new TableRow();
  274.                             tc = new TableCell();
  275.                             tc.CssClass = "description";
  276.                             tc.Text = "Appraiser Company";
  277.                             tr.Cells.Add(tc);
  278.  
  279.                             tc = new TableCell();
  280.                             tc.Text = dr["company_name"].ToString();
  281.                             tr.Cells.Add(tc);
  282.                             table.Rows.Add(tr);
  283.  
  284.                             tr = new TableRow();
  285.                             tc = new TableCell();
  286.                             tc.CssClass = "description";
  287.                             tc.Text = "Appraisal Review Type";
  288.                             tr.Cells.Add(tc);
  289.  
  290.                             tc = new TableCell();
  291.                             tc.Text = Convert.ToBoolean(dr["Field_Review"]) ? "FRA" : "Desk Review";
  292.                             tr.Cells.Add(tc);
  293.  
  294.                             tc = new TableCell();
  295.                             tc.CssClass = "description";
  296.                             tc.Text = "Appraisal Rating";
  297.                             if (Request.QueryString["edit"] == null)
  298.                                 tc.Text = "Appraisal Rating";
  299.                             else
  300.                                 tc.Text = "<a href=\"tabbed/auditing.aspx?id=" + dr["id"].ToString() + "&oid=" + Request.QueryString["id"] + "&tab=6\">Appraisal Rating</a>";
  301.                             tr.Cells.Add(tc);
  302.  
  303.                             tc = new TableCell();
  304.                             //if (dr["avg"] != DBNull.Value && Convert.ToDouble(dr["avg"]) <= 2.5)
  305.                             //{
  306.                             //    tc.Text = Convert.ToDouble(dr["avg"]).ToString("f");
  307.                             //    tc.Font.Bold = true;
  308.                             //    tc.ForeColor = Color.Red;
  309.                             //}
  310.                             //else if (dr["avg"] != DBNull.Value)
  311.                             //    tc.Text = Convert.ToDouble(dr["avg"]).ToString("f");
  312.                             //else
  313.                             tc.Text = dr["Appraisal_rating"].ToString();
  314.  
  315.                             tr.Cells.Add(tc);
  316.                             table.Rows.Add(tr);
  317.  
  318.                             tr = new TableRow();
  319.                             tc = new TableCell();
  320.                             tc.CssClass = "description";
  321.                             tc.Text = "Real Estate Company";
  322.                             tr.Cells.Add(tc);
  323.  
  324.                             tc = new TableCell();
  325.                             tc.Text = dr["re_co"].ToString().ToUpper();
  326.                             tr.Cells.Add(tc);
  327.  
  328.                             tc = new TableCell();
  329.                             tc.CssClass = "description";
  330.                             tc.Text = "Real Estate Agent";
  331.                             tr.Cells.Add(tc);
  332.  
  333.                             tc = new TableCell();
  334.                             tc.Text = dr["re_agent"].ToString().ToUpper();
  335.                             tr.Cells.Add(tc);
  336.                             table.Rows.Add(tr);
  337.  
  338.                             tr = new TableRow();
  339.                             tc = new TableCell();
  340.                             tc.CssClass = "description";
  341.                             tc.Text = "Closing Agent/Escrow Company";
  342.                             tr.Cells.Add(tc);
  343.  
  344.                             tc = new TableCell();
  345.                             tc.ColumnSpan = 3;
  346.                             tc.Text = dr["closing_agent"].ToString().ToUpper();
  347.                             tr.Cells.Add(tc);
  348.                             table.Rows.Add(tr);
  349.  
  350.                             tr = new TableRow();
  351.                             tc = new TableCell();
  352.                             tc.CssClass = "description";
  353.                             tc.Text = "Date Closed/Funded";
  354.                             tr.Cells.Add(tc);
  355.  
  356.                             tc = new TableCell();
  357.                             if (dr["HUD1_Closing_Date"] != DBNull.Value)
  358.                                 tc.Text = Convert.ToDateTime(dr["HUD1_Closing_Date"]).ToString("MM/dd/yyyy");
  359.                             tr.Cells.Add(tc);
  360.  
  361.                             tc = new TableCell();
  362.                             tc.CssClass = "description";
  363.                             tc.Text = "Disbursement Date";
  364.                             tr.Cells.Add(tc);
  365.  
  366.                             tc = new TableCell();
  367.                             if (dr["disb_dte"] != DBNull.Value)
  368.                                 tc.Text = Convert.ToDateTime(dr["disb_dte"]).ToString("MM/dd/yyyy");
  369.                             tr.Cells.Add(tc);
  370.                             table.Rows.Add(tr);
  371.  
  372.                             tr = new TableRow();
  373.                             tc = new TableCell();
  374.                             tc.CssClass = "description";
  375.                             if (Request.QueryString["edit"] == null)
  376.                                 tc.Text = "Risk/Satisfactory Rating";
  377.                             else
  378.                                 tc.Text = "<a href=\"tabbed/auditing.aspx?id=" + dr["id"].ToString() + "&oid=" + Request.QueryString["id"] + "&tab=7\">Risk/Satisfactory Rating</a>";
  379.                             tr.Cells.Add(tc);
  380.  
  381.                             tc = new TableCell();
  382.                             tc.Text = dr["risk_rating"].ToString() + " / " + dr["satisfactory_risk"].ToString().ToUpper();
  383.                             tr.Cells.Add(tc);
  384.  
  385.                             tc = new TableCell();
  386.                             tc.CssClass = "description";
  387.                             tc.Text = "Investor";
  388.                             tr.Cells.Add(tc);
  389.  
  390.                             tc = new TableCell();
  391.                             tc.Text = dr["investor_name"].ToString().ToUpper();
  392.                             tr.Cells.Add(tc);
  393.                             table.Rows.Add(tr);
  394.                         }
  395.  
  396.                         string rowFilter = "prnt_id = " + dr["id"].ToString();
  397.                         DataView dv = new DataView(ds.Tables[5], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  398.  
  399.                         //makes sure there are findings available
  400.                         if (dv.Count > 0)
  401.                         {
  402.                             tr = new TableRow();
  403.                             tc = new TableCell();
  404.                             tc.ColumnSpan = 4;
  405.                             tc.CssClass = "title";
  406.                             tc.Text = "Findings";
  407.                             tr.Cells.Add(tc);
  408.                             table.Rows.Add(tr);
  409.  
  410.                             for (int i = 0; i < dv.Count; i++)
  411.                             {
  412.                                 tr = new TableRow();
  413.                                 tc = new TableCell();
  414.                                 tc.CssClass = "description";
  415.                                 tc.VerticalAlign = VerticalAlign.Top;
  416.                                 if (Request.QueryString["edit"] == null)
  417.                                     tc.Text = dv[i]["description"].ToString();
  418.                                 else
  419.                                 {
  420.                                     tc.Text = "<a href=\"editFinding.aspx?id=" + dv[i]["findID"].ToString() + "&oid=" + Request.QueryString["id"]
  421.                                         + "&aid=" + dr["id"].ToString() + "&edit=1\">" + dv[i]["description"].ToString() + "</a>";
  422.                                 }
  423.                                 tr.Cells.Add(tc);
  424.  
  425.                                 tc = new TableCell();
  426.                                 tc.ColumnSpan = 3;
  427.                                 tc.Text = dv[i]["FullDescription"].ToString().Replace("\n", "<br />");
  428.                                 tr.Cells.Add(tc);
  429.                                 table.Rows.Add(tr);
  430.  
  431.                                 //only available if displaying the response management report
  432.                                 if (Request.QueryString["mgm"] != null)
  433.                                 {
  434.                                     tr = new TableRow();
  435.                                     tc = new TableCell();
  436.                                     tc.CssClass = "description";
  437.                                     tc.Text = "Management Response";
  438.                                     tr.Cells.Add(tc);
  439.  
  440.                                     tc = new TableCell();
  441.                                     tc.Text = dv[i]["ManagementResponse"].ToString();
  442.                                     tr.Cells.Add(tc);
  443.                                     table.Rows.Add(tr);
  444.  
  445.                                     tr = new TableRow();
  446.                                     tc = new TableCell();
  447.                                     tc.CssClass = "description";
  448.                                     tc.Text = "Responding Manager";
  449.                                     tr.Cells.Add(tc);
  450.  
  451.                                     tc = new TableCell();
  452.                                     tc.Text = dv[i]["RespondingManager"].ToString();
  453.                                     tr.Cells.Add(tc);
  454.                                     table.Rows.Add(tr);
  455.  
  456.                                     tr = new TableRow();
  457.                                     tc = new TableCell();
  458.                                     tc.CssClass = "description";
  459.                                     tc.Text = "Action Taken";
  460.                                     tr.Cells.Add(tc);
  461.  
  462.                                     tc = new TableCell();
  463.                                     tc.Text = dv[i]["ActionTaken"].ToString();
  464.                                     tr.Cells.Add(tc);
  465.                                     table.Rows.Add(tr);
  466.                                 }
  467.                             }
  468.                         }
  469.  
  470.                         //auditor is being reviewed by auditor
  471.                         if (Request.QueryString["reviewed"] != null)
  472.                         {
  473.                             rowFilter = "audit_id = " + dr["id"].ToString();
  474.                             dv = new DataView(ds.Tables[12], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  475.  
  476.                             //makes sure there are deleted findings available
  477.                             if (dv.Count > 0)
  478.                             {
  479.                                 tr = new TableRow();
  480.                                 tc = new TableCell();
  481.                                 tc.ColumnSpan = 4;
  482.                                 tc.CssClass = "title";
  483.                                 tc.Text = "Deleted Findings";
  484.                                 tr.Cells.Add(tc);
  485.                                 table.Rows.Add(tr);
  486.  
  487.                                 for (int i = 0; i < dv.Count; i++)
  488.                                 {
  489.                                     tr = new TableRow();
  490.                                     tc = new TableCell();
  491.                                     tc.CssClass = "description";
  492.                                     tc.VerticalAlign = VerticalAlign.Top;
  493.                                     tc.Text = dv[i]["description"].ToString();
  494.                                     tr.Cells.Add(tc);
  495.  
  496.                                     tc = new TableCell();
  497.                                     tc.ColumnSpan = 3;
  498.                                     tc.Text = dv[i]["FullDescription"].ToString().Replace("\n", "<br />");
  499.                                     tr.Cells.Add(tc);
  500.                                     table.Rows.Add(tr);
  501.                                 }
  502.                             }
  503.                         }
  504.  
  505.  
  506.                         rowFilter = "prnt_id = " + dr["id"].ToString();
  507.                         dv = new DataView(ds.Tables[6], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  508.  
  509.                         //makes sure there are red flags available
  510.                         if (dv.Count > 0)
  511.                         {
  512.                             tr = new TableRow();
  513.                             tc = new TableCell();
  514.                             tc.ColumnSpan = 4;
  515.                             tc.CssClass = "title";
  516.                             tc.Text = "Red Flags";
  517.                             tr.Cells.Add(tc);
  518.                             table.Rows.Add(tr);
  519.  
  520.                             for (int i = 0; i < dv.Count; i++)
  521.                             {
  522.                                 tr = new TableRow();
  523.                                 tc = new TableCell();
  524.                                 tc.ColumnSpan = 4;
  525.                                 tc.Text = dv[i]["Flag_Description"].ToString();
  526.                                 tr.Cells.Add(tc);
  527.                                 table.Rows.Add(tr);
  528.                             }
  529.                         }
  530.  
  531.                         rowFilter = "prnt_id = " + dr["id"].ToString();
  532.                         dv = new DataView(ds.Tables[7], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  533.  
  534.                         //makes sure there are comments available
  535.                         if (dv.Count > 0)
  536.                         {
  537.                             tr = new TableRow();
  538.                             tc = new TableCell();
  539.                             tc.ColumnSpan = 4;
  540.                             tc.CssClass = "title";
  541.                             tc.Text = "Comments";
  542.                             tr.Cells.Add(tc);
  543.                             table.Rows.Add(tr);
  544.  
  545.                             for (int i = 0; i < dv.Count; i++)
  546.                             {
  547.                                 tr = new TableRow();
  548.                                 tc = new TableCell();
  549.                                 tc.ColumnSpan = 4;
  550.                                 if (Request.QueryString["edit"] == null)
  551.                                     tc.Text = dv[i]["fulldescription"].ToString();
  552.                                 else
  553.                                 {
  554.                                     tc.Text = "<a href=\"editComment.aspx?id=" + dv[i]["id"].ToString() + "&oid=" + Request.QueryString["id"]
  555.                                         + "&aid=" + dr["id"].ToString() + "&edit=1\">" + dv[i]["fulldescription"].ToString() + "</a>";
  556.                                 }
  557.                                 tr.Cells.Add(tc);
  558.                                 table.Rows.Add(tr);
  559.                             }
  560.                         }
  561.  
  562.                         rowFilter = "audit_id = " + dr["id"].ToString();
  563.                         dv = new DataView(ds.Tables[8], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  564.  
  565.                         //makes sure there are adverse appraisal questions available
  566.                         if (dv.Count > 0)
  567.                         {
  568.                             tr = new TableRow();
  569.                             tc = new TableCell();
  570.                             tc.ColumnSpan = 4;
  571.                             tc.CssClass = "title";
  572.                             tc.Text = "Federal Regulatory Audit";
  573.                             tr.Cells.Add(tc);
  574.                             table.Rows.Add(tr);
  575.                             string category = string.Empty;
  576.  
  577.                             for (int i = 0; i < dv.Count; i++)
  578.                             {
  579.                                 if (category == string.Empty || category != dv[i]["category"].ToString())
  580.                                 {
  581.                                     category = dv[i]["category"].ToString();
  582.                                     tr = new TableRow();
  583.                                     tc = new TableCell();
  584.                                     tc.Text = category;
  585.                                     tc.CssClass = "description";
  586.                                     tc.ColumnSpan = 4;
  587.                                     tr.Cells.Add(tc);
  588.                                     table.Rows.Add(tr);
  589.                                 }
  590.  
  591.                                 tr = new TableRow();
  592.                                 tc = new TableCell();
  593.                                 tc.ColumnSpan = 4;
  594.                                 tc.Text = dv[i]["statement"].ToString() + "<br /> Answer: " + dv[i]["answer"].ToString() + "<br /> Rating: " +
  595.                                     (Convert.ToDouble(dv[i]["risk_rating"]) <= 2.5 ? "<span class=\"adverse\">" + dv[i]["risk_rating"].ToString() + "</span>"
  596.                                     : dv[i]["risk_rating"].ToString());
  597.                                 tr.Cells.Add(tc);
  598.                                 table.Rows.Add(tr);
  599.                             }
  600.                         }
  601.  
  602.                         rowFilter = "audit_id = " + dr["id"].ToString();
  603.                         dv = new DataView(ds.Tables[9], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  604.  
  605.                         //makes sure there are adverse appraisal questions available
  606.                         if (dv.Count > 0)
  607.                         {
  608.                             tr = new TableRow();
  609.                             tc = new TableCell();
  610.                             tc.ColumnSpan = 4;
  611.                             tc.CssClass = "title";
  612.                             tc.Text = "Desk Review";
  613.                             tr.Cells.Add(tc);
  614.                             table.Rows.Add(tr);
  615.                             string category = string.Empty;
  616.  
  617.                             for (int i = 0; i < dv.Count; i++)
  618.                             {
  619.                                 if (category == string.Empty || category != dv[i]["category"].ToString())
  620.                                 {
  621.                                     category = dv[i]["category"].ToString();
  622.                                     tr = new TableRow();
  623.                                     tc = new TableCell();
  624.                                     tc.Text = category;
  625.                                     tc.CssClass = "description";
  626.                                     tc.ColumnSpan = 4;
  627.                                     tr.Cells.Add(tc);
  628.                                     table.Rows.Add(tr);
  629.                                 }
  630.  
  631.                                 tr = new TableRow();
  632.                                 tc = new TableCell();
  633.                                 tc.ColumnSpan = 4;
  634.                                 tc.Text = dv[i]["statement"].ToString() + "<br /> Answer: " + dv[i]["answer"].ToString() + "<br /> Rating: " +
  635.                                     (Convert.ToDouble(dv[i]["risk_rating"]) <= 2.5 ? "<span class=\"adverse\">" + dv[i]["risk_rating"].ToString() + "</span>"
  636.                                     : dv[i]["risk_rating"].ToString());
  637.                                 tr.Cells.Add(tc);
  638.                                 table.Rows.Add(tr);
  639.                             }
  640.                         }
  641.  
  642.                         rowFilter = "audit_r_id = " + dr["id"].ToString();
  643.                         dv = new DataView(ds.Tables[13], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  644.  
  645.                         //denial audit
  646.                         if (dv.Count > 0)
  647.                         {
  648.                             tr = new TableRow();
  649.                             tc = new TableCell();
  650.                             tc.ColumnSpan = 4;
  651.                             tc.CssClass = "title";
  652.                             tc.Text = "Denial Audit";
  653.                             tr.Cells.Add(tc);
  654.                             table.Rows.Add(tr);
  655.                             string category = string.Empty;
  656.  
  657.                             for (int i = 0; i < dv.Count; i++)
  658.                             {
  659.                                 if (category == string.Empty || category != dv[i]["category"].ToString())
  660.                                 {
  661.                                     category = dv[i]["category"].ToString();
  662.                                     tr = new TableRow();
  663.                                     tc = new TableCell();
  664.                                     tc.Text = category;
  665.                                     tc.CssClass = "description";
  666.                                     tc.ColumnSpan = 4;
  667.                                     tr.Cells.Add(tc);
  668.                                     table.Rows.Add(tr);
  669.                                 }
  670.  
  671.                                 tr = new TableRow();
  672.                                 tc = new TableCell();
  673.                                 tc.ColumnSpan = 4;
  674.                                 tc.Text = dv[i]["statement"].ToString() + "<br />" + dv[i]["answer"].ToString();
  675.                                 tr.Cells.Add(tc);
  676.                                 table.Rows.Add(tr);
  677.                             }
  678.                         }
  679.  
  680.                         rowFilter = "first_name = '" + dr["first_name"].ToSpecialString() + "' and last_name = '" + dr["last_name"].ToSpecialString() + "'";
  681.                         dv = new DataView(ds.Tables[11], rowFilter, string.Empty, DataViewRowState.OriginalRows);
  682.  
  683.                         //comments from AMS for field review appraisals
  684.                         if (dv.Count > 0 && dv[0]["IAGCompliance"].ToString() != string.Empty)
  685.                         {
  686.                             tr = new TableRow();
  687.                             tc = new TableCell();
  688.                             tc.ColumnSpan = 4;
  689.                             tc.CssClass = "title";
  690.                             tc.Text = "Inner Agency Guidance Compliance";
  691.                             tr.Cells.Add(tc);
  692.                             table.Rows.Add(tr);
  693.  
  694.                             tr = new TableRow();
  695.                             tc = new TableCell();
  696.                             tc.ColumnSpan = 1;
  697.                             tc.VerticalAlign = VerticalAlign.Top;
  698.                             tc.CssClass = "description";
  699.                             if (Request.QueryString["edit"] == null)
  700.                                 tc.Text = "Field Review Appraisal";
  701.                             else
  702.                                 tc.Text = "<a href=\"IAGCompliance.aspx?id=" + dv[0]["id"].ToString() + "&oid=" + Request.QueryString["id"]
  703.                                         + "&aid=" + dr["id"].ToString() + "&edit=1\">Field Review Appraisal</a>";
  704.  
  705.                             tr.Cells.Add(tc);
  706.  
  707.                             tc = new TableCell();
  708.                             tc.ColumnSpan = 4;
  709.                             tc.Text = dv[0]["IAGCompliance"].ToString();
  710.                             tr.Cells.Add(tc);
  711.                             table.Rows.Add(tr);
  712.                         }
  713.  
  714.  
  715.                         //add a page preak after each loan file
  716.                         table.Rows[table.Rows.Count - 1].CssClass = "breakAfter";
  717.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement