protected void txt_fdbookamt_TextChanged(object sender, EventArgs e)
{
DataSet ds2 = obj.returndataset("select rd_min_book_amount,rd_multiple_of,rd_total_book_amount,rd_credit_value,term_type,increment,rd_total_entry,fd_min_book_amount,fd_multiple_of,fd_total_book_amount,fd_credit_value,fd_total_entry,mi_return_amount,mi_return_mode,total_dividends from term_master where scheme = '" + drp_plan.SelectedValue.ToString().Trim() + "' AND term='" + drp_term.SelectedItem.Text.ToString() + "' AND nplan = '" + DropDownList1.SelectedItem.Text.Trim() + "' AND status='0'");
int rd_rbook_amt, mi_value, rd_rcredit_value, fd_rbookamt, rd_credit_value, fd_credit_value, fd_rcredit_value, rd_book_amt, fd_book_amt, rd_min_book_amount, rd_multiple_of, rd_total_book_amount, fd_min_book_amount, fd_total_book_amount, mi_return_amount;
mi_value = fd_rcredit_value = rd_rbook_amt = rd_rcredit_value = rd_credit_value = fd_credit_value = fd_rbookamt = rd_book_amt = fd_book_amt = rd_min_book_amount = rd_multiple_of = rd_total_book_amount = fd_min_book_amount = fd_total_book_amount = mi_return_amount = 0;
int fd_multiple_of, rd_total_entry, fd_total_entry, total_dividends;
rd_multiple_of = fd_multiple_of = rd_total_entry = fd_total_entry = total_dividends = 0;
string mi_returnmode;
mi_returnmode = ds2.Tables[0].Rows[0]["mi_return_mode"].ToString();
total_dividends = Convert.ToInt32(ds2.Tables[0].Rows[0]["total_dividends"].ToString());
rd_min_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_min_book_amount"].ToString());
rd_multiple_of = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_multiple_of"].ToString());
double rd_total_book_amount12 = Convert.ToDouble(ds2.Tables[0].Rows[0]["rd_total_book_amount"].ToString());
rd_total_book_amount = Convert.ToInt32(rd_total_book_amount12);
double rd_credit_value12 = Convert.ToDouble(ds2.Tables[0].Rows[0]["rd_credit_value"].ToString());
rd_credit_value = Convert.ToInt32(rd_credit_value12);
fd_credit_value = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_credit_value"].ToString());
string term_type = ds2.Tables[0].Rows[0]["term_type"].ToString();
rd_book_amt = Convert.ToInt32(txt_rdbookamt.Text.Trim());
fd_book_amt = Convert.ToInt32(txt_fdbookamt.Text.Trim());
fd_min_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_min_book_amount"].ToString());
int increment = Convert.ToInt32(ds2.Tables[0].Rows[0]["increment"].ToString());
rd_total_entry = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_total_entry"].ToString());
fd_total_entry = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_total_entry"].ToString());
fd_multiple_of = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_multiple_of"].ToString());
fd_total_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_total_book_amount"].ToString());
mi_return_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["mi_return_amount"].ToString());
double ard, afd;
int brd, bfd;
if (fd_book_amt < fd_min_book_amount)
{
lbl_err.Text = "FD Booking Amount is very little";
}
else
{
ard = 0;
afd = System.Math.DivRem(fd_book_amt, fd_multiple_of, out bfd);
if (bfd == 0)
{
lbl_err.Text = "";
fd_rbookamt = Convert.ToInt32(afd) * fd_total_book_amount;
fd_rcredit_value = Convert.ToInt32(afd) * fd_credit_value;
mi_value = Convert.ToInt32(afd) * mi_return_amount;
TextBox6.Text = fd_rbookamt.ToString().Trim();
TextBox7.Text = fd_rcredit_value.ToString().Trim();
if (Label2.Text == "MIS")
{
Label3.Text = "MIS Return Amount is : " + mi_value.ToString().Trim();
}
else
{
Label3.Text = "";
}
}
else
{
lbl_err.Text = "Enter a correct Booking Amount !";
}
}
TextBox8.Focus();
}
protected void txt_rdbookamt_TextChanged(object sender, EventArgs e)
{
DataSet ds2 = obj.returndataset("select rd_min_book_amount,rd_multiple_of,rd_total_book_amount,rd_credit_value,term_type,increment,rd_total_entry,fd_min_book_amount,fd_multiple_of,fd_total_book_amount,fd_credit_value,fd_total_entry,mi_return_amount,mi_return_mode,total_dividends from term_master where scheme = '" + drp_plan.SelectedValue.ToString().Trim() + "' AND term='" + drp_term.SelectedItem.Text.ToString() + "' AND nplan = '" + DropDownList1.SelectedItem.Text.Trim() + "' AND status='0'");
int rd_rbook_amt, mi_value, rd_rcredit_value, fd_rbookamt, rd_credit_value, fd_credit_value, fd_rcredit_value, rd_book_amt, fd_book_amt, rd_min_book_amount, rd_multiple_of, rd_total_book_amount, fd_min_book_amount, fd_total_book_amount, mi_return_amount;
mi_value = fd_rcredit_value = rd_rbook_amt = rd_rcredit_value = rd_credit_value = fd_credit_value = fd_rbookamt = rd_book_amt = fd_book_amt = rd_min_book_amount = rd_multiple_of = rd_total_book_amount = fd_min_book_amount = fd_total_book_amount = mi_return_amount = 0;
int fd_multiple_of, rd_total_entry, fd_total_entry, total_dividends;
rd_multiple_of = fd_multiple_of = rd_total_entry = fd_total_entry = total_dividends = 0;
string mi_returnmode;
mi_returnmode = ds2.Tables[0].Rows[0]["mi_return_mode"].ToString();
total_dividends = Convert.ToInt32(ds2.Tables[0].Rows[0]["total_dividends"].ToString());
rd_min_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_min_book_amount"].ToString());
rd_multiple_of = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_multiple_of"].ToString());
double rd_total_book_amount12 = Convert.ToDouble(ds2.Tables[0].Rows[0]["rd_total_book_amount"].ToString());
rd_total_book_amount = Convert.ToInt32(rd_total_book_amount12);
double rd_credit_value12 = Convert.ToDouble(ds2.Tables[0].Rows[0]["rd_credit_value"].ToString());
rd_credit_value = Convert.ToInt32(rd_credit_value12);
fd_credit_value = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_credit_value"].ToString());
string term_type = ds2.Tables[0].Rows[0]["term_type"].ToString();
rd_book_amt = Convert.ToInt32(txt_rdbookamt.Text.Trim());
fd_book_amt = Convert.ToInt32(txt_fdbookamt.Text.Trim());
fd_min_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_min_book_amount"].ToString());
int increment = Convert.ToInt32(ds2.Tables[0].Rows[0]["increment"].ToString());
rd_total_entry = Convert.ToInt32(ds2.Tables[0].Rows[0]["rd_total_entry"].ToString());
fd_total_entry = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_total_entry"].ToString());
fd_multiple_of = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_multiple_of"].ToString());
fd_total_book_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["fd_total_book_amount"].ToString());
mi_return_amount = Convert.ToInt32(ds2.Tables[0].Rows[0]["mi_return_amount"].ToString());
double ard, afd;
int brd, bfd;
if (rd_min_book_amount > 0)
{
if (rd_book_amt < rd_min_book_amount)
{
lbl_err.Text = "RD Booking Amount is very little";
}
else
{
ard = System.Math.DivRem(rd_book_amt, rd_multiple_of, out brd);
afd = 0;
if (brd == 0)
{
lbl_err.Text = "";
rd_rbook_amt = Convert.ToInt32(ard) * rd_total_book_amount;
rd_rcredit_value = Convert.ToInt32(ard) * rd_credit_value;
TextBox6.Text = rd_rbook_amt.ToString().Trim();
TextBox7.Text = rd_rcredit_value.ToString().Trim();
}
else
{
lbl_err.Text = "Enter a correct Booking Amount !";
}
}
}
else
{
}
TextBox8.Focus();
}
}