public depositdetails fdpageload() { depositdetails dd = new depositdetails(); SqlConnection con = new SqlConnection(); try { con.ConnectionString = ConfigurationManager.ConnectionStrings["Bankingsysconn"].ConnectionString; con.Open(); string acctno = Constant.accountno; string selcetAccount = Query.selectfd + acctno; SqlCommand cmd = new SqlCommand(selcetAccount, con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { dd.DepositAmount = dr.GetValue(0).ToString(); } dr.Close(); } finally { con.Close(); } return(dd); }
public void ApplyFd(depositdetails dd) { SqlConnection con = new SqlConnection(); try { string accuntno = Constant.accountno, fd = ""; con.ConnectionString = ConfigurationManager.ConnectionStrings["Bankingsysconn"].ConnectionString; con.Open(); string selcetAccount = Query.selectFD + dd.AccountNo + "'"; SqlCommand cmd = new SqlCommand(selcetAccount, con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { fd = dr.GetValue(0).ToString(); } if (fd != "no" || fd != "yes") { dr.Close(); SqlCommand cmd1 = new SqlCommand("applydeposit", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@AccountNo", dd.AccountNo); cmd1.Parameters.AddWithValue("@fixedDeposit", dd.DepositAmount); cmd1.ExecuteNonQuery(); } } finally { con.Close(); } }
public void fdApprove(depositdetails dd) { SqlConnection con = new SqlConnection(); try { con.ConnectionString = ConfigurationManager.ConnectionStrings["Bankingsysconn"].ConnectionString; con.Open(); SqlCommand cmd1 = new SqlCommand("approvefd", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@AccountNo", Constant.accountno); cmd1.Parameters.AddWithValue("@FixedDeposit", dd.DepositAmount); cmd1.ExecuteNonQuery(); } finally { con.Close(); } }
protected void Page_Load(object sender, EventArgs e) { dd = ad.fdpageload(); AccountNoText.Text = Constant.accountno; DepositeAmountText.Text = dd.DepositAmount; }