Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void FillPayableFeeGrid()
- {
- if (this._adm_no == 0)
- return;
- using (SqlConnection conn = new SqlConnection(this.connectionString))
- {
- 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);
- this.gridPayableFee.Rows.Clear();
- this._temp_fee_id.Clear();
- int index1 = 0;
- if (dataTable.Rows.Count > 0)
- {
- foreach (DataRow row in (InternalDataCollectionBase)dataTable.Rows)
- {
- if (Convert.ToDouble(row[4]) != 0.0)
- {
- this.gridPayableFee.Rows.Add();
- this.gridPayableFee[1, index1].Value = (object)Convert.ToString(row[0].ToString());
- this.gridPayableFee[2, index1].Value = (object)Convert.ToString(row[1].ToString());
- this.gridPayableFee[3, index1].Value = (object)Convert.ToString(row[4].ToString());
- this.gridPayableFee[4, index1].Value = (object)Convert.ToString(row[2].ToString());
- this.gridPayableFee[5, index1].Value = (object)Convert.ToString(row[3].ToString());
- this.gridPayableFee[6, index1].Value = (object)Convert.ToString(row[5].ToString());
- this.gridPayableFee[7, index1].Value = (object)Convert.ToString(row[6].ToString());
- this.gridPayableFee[8, index1].Value = (object)Convert.ToString(row[4].ToString());
- this.gridPayableFee[9, index1].Value = (object)Convert.ToString(row[10].ToString());
- DateTime dateTime;
- if (this._calculate_fine_monthly)
- {
- int graceDays = this.GetGraceDays(Convert.ToInt32(row[2]));
- if (this.GetDays(this.RcptDate.Text, Convert.ToString(row[6])) > graceDays)
- {
- DateTimePicker pbleDate = this.PbleDate;
- dateTime = Convert.ToDateTime(DateTime.ParseExact(Convert.ToString(row[6]), "dd/MM/yyyy", (IFormatProvider)null));
- dateTime = dateTime.AddDays(Convert.ToDouble(graceDays));
- string str1 = dateTime.ToString();
- pbleDate.Text = str1;
- dateTime = this.PbleDate.Value;
- string str2 = dateTime.Day.ToString();
- dateTime = this.PbleDate.Value;
- string str3 = dateTime.Month.ToString();
- if (str2.Length == 1)
- {
- string str4 = "0";
- dateTime = this.PbleDate.Value;
- // ISSUE: variable of a boxed type
- _Boxed<int> day = (System.ValueType)dateTime.Day;
- str2 = str4 + (object)day;
- }
- if (str3.Length == 1)
- {
- string str4 = "0";
- dateTime = this.PbleDate.Value;
- //ISSUE: variable of a boxed type
- __Boxed<int> month = (System.ValueType)dateTime.Month;
- str3 = str4 + (object)month;
- }
- DataGridViewCell dataGridViewCell = this.gridPayableFee[10, index1];
- string[] strArray1 = new string[5]
- {
- str2, "/", str3, "/",null
- };
- string[] strArray2 = strArray1;
- int index2 = 4;
- dateTime = this.PbleDate.Value;
- string str5 = dateTime.Year.ToString();
- strArray2[index2] = str5;
- string str6 = string.Concat(strArray1);
- dataGridViewCell.Value = (object)str6;
- string finePer = this.GetFinePer(Convert.ToInt32(row[2]));
- int nos = this.GetNos(this.RcptDate.Text, Convert.ToString(this.gridPayableFee[10, index1].Value), finePer);
- this.gridPayableFee[11, index1].Value = (object)Convert.ToString(nos);
- this.gridPayableFee[12, index1].Value = (object)Convert.ToString(finePer);
- double num = this.GetFineAmt(Convert.ToInt32(row[2])) * (double)Convert.ToInt32(this.gridPayableFee[11, index1].Value);
- this.gridPayableFee[13, index1].Value = (object)string.Format("{0:0.00}", (object)Math.Round(num, 0));
- }
- }
- else if (!this.IsDuplicateFeeID(Convert.ToInt32(row[2])))
- {
- int graceDays = this.GetGraceDays(Convert.ToInt32(row[2]));
- if (this.GetDays(this.RcptDate.Text, Convert.ToString(row[6])) > graceDays)
- {
- DateTimePicker pbleDate = this.PbleDate;
- dateTime = Convert.ToDateTime(DateTime.ParseExact(Convert.ToString(row[6]), "dd/MM/yyyy", (IFormatProvider)null));
- dateTime = dateTime.AddDays(Convert.ToDouble(graceDays));
- string str1 = dateTime.ToString();
- pbleDate.Text = str1;
- dateTime = this.PbleDate.Value;
- string str2 = dateTime.Day.ToString();
- dateTime = this.PbleDate.Value;
- string str3 = dateTime.Month.ToString();
- if (str2.Length == 1)
- {
- string str4 = "0";
- dateTime = this.PbleDate.Value;
- // ISSUE: variable of a boxed type
- // __Boxed<int> day = (System.ValueType)dateTime.Day;
- // str2 = str4 + (object)day;
- }
- if (str3.Length == 1)
- {
- string str4 = "0";
- dateTime = this.PbleDate.Value;
- // ISSUE: variable of a boxed type
- //__Boxed<int> month = (System.ValueType)dateTime.Month;
- //str3 = str4 + (object)month;
- }
- DataGridViewCell dataGridViewCell = this.gridPayableFee[10, index1];
- string[] strArray1 = new string[5]
- {
- str2,
- "/",
- str3,
- "/",
- null
- };
- string[] strArray2 = strArray1;
- int index2 = 4;
- dateTime = this.PbleDate.Value;
- string str5 = dateTime.Year.ToString();
- strArray2[index2] = str5;
- string str6 = string.Concat(strArray1);
- dataGridViewCell.Value = (object)str6;
- string finePer = this.GetFinePer(Convert.ToInt32(row[2]));
- int nos = this.GetNos(this.RcptDate.Text, Convert.ToString(this.gridPayableFee[10, index1].Value), finePer);
- this.gridPayableFee[11, index1].Value = (object)Convert.ToString(nos);
- this.gridPayableFee[12, index1].Value = (object)Convert.ToString(finePer);
- double num = this.GetFineAmt(Convert.ToInt32(row[2])) * (double)Convert.ToInt32(this.gridPayableFee[11, index1].Value);
- this.gridPayableFee[13, index1].Value = (object)string.Format("{0:0.00}", (object)Math.Round(num, 0));
- }
- }
- this._temp_fee_id.Add(Convert.ToInt32(row[2]));
- ++index1;
- }
- }
- this.ckBox.Checked = false;
- this.ckBox.Checked = true;
- }
- else
- {
- this.ckBox.Checked = false;
- this.gridFeeSummary.Rows.Clear();
- }
- }
- this.CalculateBalanceAmt();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement