protected void LoadDailyRate() { BusinessLayer.PotatoRate ObjRate = new BusinessLayer.PotatoRate(); string Date = ddlMonth.SelectedValue.Trim() + "/" + ddlDay.SelectedValue.Trim() + "/" + ddlYear.SelectedValue.Trim() + " 00:00:00.000"; DataTable dt = ObjRate.GetRateByDate(Date); if (dt != null) { dgvBlock.DataSource = dt; dgvBlock.DataBind(); } }
protected void LoadMsg() { BusinessLayer.PotatoRate ObjRate = new BusinessLayer.PotatoRate(); string Date = ddlDay.SelectedValue.Trim() + "/" + ddlMonth.SelectedValue.Trim() + "/" + ddlYear.SelectedValue.Trim() + " 00:00:00"; DataTable dt = ObjRate.GetRateByDate(Date); string day = ddlDay.SelectedValue.Trim(); day = (day.Length == 1) ? "0" + day : day; string month = ddlMonth.SelectedValue.Trim(); month = (month.Length == 1) ? "0" + month : month; string year = ddlYear.SelectedValue.Trim(); //year = year.Substring(2); StringBuilder sb = new StringBuilder(); sb.Append("Date "); sb.Append(day + "/" + month + "/" + year + " : Low/High\n"); for (int i = 0; i < dt.Rows.Count; i++) { sb.Append(dt.Rows[i][1].ToString().Trim() + " "); sb.Append(FitRate(dt.Rows[i][2].ToString().Trim()) + "/"); sb.Append(FitRate(dt.Rows[i][3].ToString().Trim())); //sb.Append(FitRate(dt.Rows[i][4].ToString().Trim()) + ","); if (i != dt.Rows.Count - 1) { sb.Append("\n"); } } txtMsg.Text = sb.ToString(); txtMsgPreview.Text = txtMsg.Text; }