Beispiel #1
0
        protected void Save()
        {
            BusinessLayer.AIndiaMarketRate ObjRate = new BusinessLayer.AIndiaMarketRate();
            string    Date = ddlMonth.SelectedValue.Trim() + "/" + ddlDay.SelectedValue.Trim() + "/" + ddlYear.SelectedValue.Trim() + " 00:00:00.000";
            DataTable dt   = new DataTable();

            dt.Columns.Add("BlockWithStateId");
            dt.Columns.Add("Bond");
            dt.Columns.Add("Avg");
            dt.Columns.Add("Dala");
            DataRow dr;

            foreach (GridViewRow row in dgvBlock.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    string BlockWithStateId = dgvBlock.DataKeys[row.RowIndex].Value.ToString();
                    string Bond             = FitRate(((TextBox)row.FindControl("txtBond")).Text.Trim());
                    string Avg  = FitRate(((TextBox)row.FindControl("txtAvg")).Text.Trim());
                    string Dala = FitRate(((TextBox)row.FindControl("txtDala")).Text.Trim());

                    dr = dt.NewRow();
                    dr["BlockWithStateId"] = BlockWithStateId;
                    dr["Bond"]             = Bond;
                    dr["Avg"]  = Avg;
                    dr["Dala"] = Dala;
                    dt.Rows.Add(dr);
                    dt.AcceptChanges();
                }
            }

            ObjRate.Save(Date, dt);
            trMsg.Visible = true;
        }
Beispiel #2
0
        protected void LoadDailyRate()
        {
            BusinessLayer.AIndiaMarketRate ObjRate = new BusinessLayer.AIndiaMarketRate();
            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();
            }
        }
Beispiel #3
0
        protected void LoadMsg()
        {
            BusinessLayer.AIndiaMarketRate ObjRate = new BusinessLayer.AIndiaMarketRate();
            string    Date = ddlMonth.SelectedValue.Trim() + "/" + ddlDay.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;
        }