Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.62 KB | None | 0 0
  1. public void FillPayableFeeGrid()
  2. {
  3. if (this._adm_no == 0)
  4. return;
  5. using (SqlConnection conn = new SqlConnection(this.connectionString))
  6. {
  7. DataTable dataTable = new _AllocateFee().ShowPayableFee(conn, this.txtAdminNo.Text.Trim(), this._adm_no, this._academic_id, this.FeeUpToDate.Text, this.txtMedium.Text.Trim(), this._campus_id);
  8. this.gridPayableFee.Rows.Clear();
  9. this._temp_fee_id.Clear();
  10. int index1 = 0;
  11. if (dataTable.Rows.Count > 0)
  12. {
  13. foreach (DataRow row in (InternalDataCollectionBase)dataTable.Rows)
  14. {
  15. if (Convert.ToDouble(row[4]) != 0.0)
  16. {
  17. this.gridPayableFee.Rows.Add();
  18. this.gridPayableFee[1, index1].Value = (object)Convert.ToString(row[0].ToString());
  19. this.gridPayableFee[2, index1].Value = (object)Convert.ToString(row[1].ToString());
  20. this.gridPayableFee[3, index1].Value = (object)Convert.ToString(row[4].ToString());
  21. this.gridPayableFee[4, index1].Value = (object)Convert.ToString(row[2].ToString());
  22. this.gridPayableFee[5, index1].Value = (object)Convert.ToString(row[3].ToString());
  23. this.gridPayableFee[6, index1].Value = (object)Convert.ToString(row[5].ToString());
  24. this.gridPayableFee[7, index1].Value = (object)Convert.ToString(row[6].ToString());
  25. this.gridPayableFee[8, index1].Value = (object)Convert.ToString(row[4].ToString());
  26. this.gridPayableFee[9, index1].Value = (object)Convert.ToString(row[10].ToString());
  27. DateTime dateTime;
  28. if (this._calculate_fine_monthly)
  29. {
  30. int graceDays = this.GetGraceDays(Convert.ToInt32(row[2]));
  31. if (this.GetDays(this.RcptDate.Text, Convert.ToString(row[6])) > graceDays)
  32. {
  33. DateTimePicker pbleDate = this.PbleDate;
  34. dateTime = Convert.ToDateTime(DateTime.ParseExact(Convert.ToString(row[6]), "dd/MM/yyyy", (IFormatProvider)null));
  35. dateTime = dateTime.AddDays(Convert.ToDouble(graceDays));
  36. string str1 = dateTime.ToString();
  37. pbleDate.Text = str1;
  38. dateTime = this.PbleDate.Value;
  39. string str2 = dateTime.Day.ToString();
  40. dateTime = this.PbleDate.Value;
  41. string str3 = dateTime.Month.ToString();
  42. if (str2.Length == 1)
  43. {
  44. string str4 = "0";
  45. dateTime = this.PbleDate.Value;
  46. // ISSUE: variable of a boxed type
  47. _Boxed<int> day = (System.ValueType)dateTime.Day;
  48. str2 = str4 + (object)day;
  49. }
  50. if (str3.Length == 1)
  51. {
  52. string str4 = "0";
  53. dateTime = this.PbleDate.Value;
  54. //ISSUE: variable of a boxed type
  55. __Boxed<int> month = (System.ValueType)dateTime.Month;
  56. str3 = str4 + (object)month;
  57. }
  58. DataGridViewCell dataGridViewCell = this.gridPayableFee[10, index1];
  59. string[] strArray1 = new string[5]
  60. {
  61. str2, "/", str3, "/",null
  62. };
  63. string[] strArray2 = strArray1;
  64. int index2 = 4;
  65. dateTime = this.PbleDate.Value;
  66. string str5 = dateTime.Year.ToString();
  67. strArray2[index2] = str5;
  68. string str6 = string.Concat(strArray1);
  69. dataGridViewCell.Value = (object)str6;
  70. string finePer = this.GetFinePer(Convert.ToInt32(row[2]));
  71. int nos = this.GetNos(this.RcptDate.Text, Convert.ToString(this.gridPayableFee[10, index1].Value), finePer);
  72. this.gridPayableFee[11, index1].Value = (object)Convert.ToString(nos);
  73. this.gridPayableFee[12, index1].Value = (object)Convert.ToString(finePer);
  74. double num = this.GetFineAmt(Convert.ToInt32(row[2])) * (double)Convert.ToInt32(this.gridPayableFee[11, index1].Value);
  75. this.gridPayableFee[13, index1].Value = (object)string.Format("{0:0.00}", (object)Math.Round(num, 0));
  76. }
  77. }
  78. else if (!this.IsDuplicateFeeID(Convert.ToInt32(row[2])))
  79. {
  80. int graceDays = this.GetGraceDays(Convert.ToInt32(row[2]));
  81. if (this.GetDays(this.RcptDate.Text, Convert.ToString(row[6])) > graceDays)
  82. {
  83. DateTimePicker pbleDate = this.PbleDate;
  84. dateTime = Convert.ToDateTime(DateTime.ParseExact(Convert.ToString(row[6]), "dd/MM/yyyy", (IFormatProvider)null));
  85. dateTime = dateTime.AddDays(Convert.ToDouble(graceDays));
  86. string str1 = dateTime.ToString();
  87. pbleDate.Text = str1;
  88. dateTime = this.PbleDate.Value;
  89. string str2 = dateTime.Day.ToString();
  90. dateTime = this.PbleDate.Value;
  91. string str3 = dateTime.Month.ToString();
  92. if (str2.Length == 1)
  93. {
  94. string str4 = "0";
  95. dateTime = this.PbleDate.Value;
  96. // ISSUE: variable of a boxed type
  97. // __Boxed<int> day = (System.ValueType)dateTime.Day;
  98. // str2 = str4 + (object)day;
  99. }
  100. if (str3.Length == 1)
  101. {
  102. string str4 = "0";
  103. dateTime = this.PbleDate.Value;
  104. // ISSUE: variable of a boxed type
  105. //__Boxed<int> month = (System.ValueType)dateTime.Month;
  106. //str3 = str4 + (object)month;
  107. }
  108. DataGridViewCell dataGridViewCell = this.gridPayableFee[10, index1];
  109. string[] strArray1 = new string[5]
  110. {
  111. str2,
  112. "/",
  113. str3,
  114. "/",
  115. null
  116. };
  117. string[] strArray2 = strArray1;
  118. int index2 = 4;
  119. dateTime = this.PbleDate.Value;
  120. string str5 = dateTime.Year.ToString();
  121. strArray2[index2] = str5;
  122. string str6 = string.Concat(strArray1);
  123. dataGridViewCell.Value = (object)str6;
  124. string finePer = this.GetFinePer(Convert.ToInt32(row[2]));
  125. int nos = this.GetNos(this.RcptDate.Text, Convert.ToString(this.gridPayableFee[10, index1].Value), finePer);
  126. this.gridPayableFee[11, index1].Value = (object)Convert.ToString(nos);
  127. this.gridPayableFee[12, index1].Value = (object)Convert.ToString(finePer);
  128. double num = this.GetFineAmt(Convert.ToInt32(row[2])) * (double)Convert.ToInt32(this.gridPayableFee[11, index1].Value);
  129. this.gridPayableFee[13, index1].Value = (object)string.Format("{0:0.00}", (object)Math.Round(num, 0));
  130. }
  131. }
  132. this._temp_fee_id.Add(Convert.ToInt32(row[2]));
  133. ++index1;
  134. }
  135. }
  136. this.ckBox.Checked = false;
  137. this.ckBox.Checked = true;
  138. }
  139. else
  140. {
  141. this.ckBox.Checked = false;
  142. this.gridFeeSummary.Rows.Clear();
  143. }
  144. }
  145. this.CalculateBalanceAmt();
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement