Tier architecture in CSharp


Tier architecture in CSharp

3 tier

Image credit: upload.wikimedia.org

People often remain calm and quite when they are asked about Tier architecture in CSharp in programming.
Lets see what a tier architecture in CSharp.

1.Presentation layer
2.Data access Layer
3.Business Logic Layer

What are the benefits of tier architecture in CSharp project?

The tier architecture has the following qualities:

Presentation layer interacts directly with the user as we opens the project. The screen with some data and input forms is our presentation layer.

Business Access Layer actually does the real business work, it doesn’t directly interact with the databases but target those functions that performs the desired action from Business Logic Layer. It is hidden from user as well as Business Logic Layer. The business layer is simply a class container methods property etc. that directs towards the data tier to perform operation such as

Data Access Layer is also a class containing methods that directly interact with the data source and perform the required operations

Basically:

Data Access Layer stores information. Business Access Layer decides what information to retrieve, makes decisions based on it, passes on the results. Presentation Layer gets information from and gives information to the user.

I am sharing some my own project’s code that will clarify the problems in understanding the Tiered architecture in real life

this is my Data access class named DAL

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
///

/// Summary description for budgetDAL
///

public class budgetDAL
{
string connString = ConfigurationManager.ConnectionStrings[“myConnection”].ToString();
public budgetDAL()
{
//
// TODO: Add constructor logic here
//
}

public void InsertInto(string userID, string userName, string budgetPlan, float amountInhand, float amountConsumed, string startDay,
string endDay, float currentAmount)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertIntoBudgetManagement”, conn);
cmdInsert.CommandType = System.Data.CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@userName”, userName);
cmdInsert.Parameters.AddWithValue(“@budgetPlan”, budgetPlan);
cmdInsert.Parameters.AddWithValue(“@amountInhand”, amountInhand);
cmdInsert.Parameters.AddWithValue(“@amountConsumed”, amountConsumed);
cmdInsert.Parameters.AddWithValue(“@startDay”, startDay);
cmdInsert.Parameters.AddWithValue(“@endDay”, endDay);
cmdInsert.Parameters.AddWithValue(“@currentAmount”, currentAmount);
cmdInsert.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void UpdateInfo(string userID, string userName, string budgetPlan, float amountInhand, float amountConsumed, DateTime startDay,
DateTime endDay, float currentAmount, float amountDeficit, bool reqLoan, float loantoReturn, float interest)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_Edit”, conn);
cmdUpdate.CommandType = System.Data.CommandType.StoredProcedure;
cmdUpdate.Connection = conn;
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@userName”, userName);
cmdUpdate.Parameters.AddWithValue(“@budgetPlan”, budgetPlan);
cmdUpdate.Parameters.AddWithValue(“@amountInhand”, amountInhand);
cmdUpdate.Parameters.AddWithValue(“@amountConsumed”, amountConsumed);
cmdUpdate.Parameters.AddWithValue(“@startDay”, startDay);
cmdUpdate.Parameters.AddWithValue(“@endDay”, endDay);
cmdUpdate.Parameters.AddWithValue(“@currentAmount”, currentAmount);
cmdUpdate.Parameters.AddWithValue(“@amountDeficit”, amountDeficit);
cmdUpdate.Parameters.AddWithValue(“@reqLoan”, reqLoan);
cmdUpdate.Parameters.AddWithValue(“@loantoReturn”, loantoReturn);
cmdUpdate.Parameters.AddWithValue(“@interest”, interest);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void InsertIntoBank(string userID, string userName, string bankID, string creditCard, string desc, float loanAmnt, float negotiateAmount, string startDay, string endDay, string negotiateDate, bool loanInt, float intAmnt, int loanDur, float penalty)
{
try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertIntoBank”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@userName”, userName);
cmdInsert.Parameters.AddWithValue(“@bankID”, bankID);
cmdInsert.Parameters.AddWithValue(“@creditCard”, creditCard);
cmdInsert.Parameters.AddWithValue(“@description”, desc);
cmdInsert.Parameters.AddWithValue(“@loanAmount”, loanAmnt);
cmdInsert.Parameters.AddWithValue(“@negotiateAmount”, negotiateAmount);
cmdInsert.Parameters.AddWithValue(“@startDay”, startDay);
cmdInsert.Parameters.AddWithValue(“@endDay”, endDay);
cmdInsert.Parameters.AddWithValue(“@negotiateDate”, negotiateDate);
cmdInsert.Parameters.AddWithValue(“@loanwithInterest”, loanInt);
cmdInsert.Parameters.AddWithValue(“@interestAmount”, intAmnt);
cmdInsert.Parameters.AddWithValue(“@loanDuration”, loanDur);
cmdInsert.Parameters.AddWithValue(“@loanPenaltyperDay”, penalty);
cmdInsert.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void InsertIntoThirdParty(string userID, string userName, string partyID, string desc, float loanAmnt, string startDay, string endDay, bool loanInt, float intAmnt, int loanDur, float penalty)
{
try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertInto3rdParty”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@userName”, userName);
cmdInsert.Parameters.AddWithValue(“@partyID”, partyID);
cmdInsert.Parameters.AddWithValue(“@description”, desc);
cmdInsert.Parameters.AddWithValue(“@loanAmount”, loanAmnt);
cmdInsert.Parameters.AddWithValue(“@startDay”, startDay);
cmdInsert.Parameters.AddWithValue(“@endDay”, endDay);
cmdInsert.Parameters.AddWithValue(“@loanwithInterest”, loanInt);
cmdInsert.Parameters.AddWithValue(“@interestAmount”, intAmnt);
cmdInsert.Parameters.AddWithValue(“@loanDuration”, loanDur);
cmdInsert.Parameters.AddWithValue(“@loanPenalty”, penalty);
cmdInsert.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void InsertIntoUsers(string userID, string userName, string userPassword)
{

SqlConnection conn = new SqlConnection(connString);
try
{

SqlCommand cmdInsert = new SqlCommand();
cmdInsert.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
cmdInsert.Parameters.Add(“@userID”, SqlDbType.NVarChar).Value = userID;
cmdInsert.Parameters.Add(“@userName”, SqlDbType.NVarChar).Value = userName;
cmdInsert.Parameters.Add(“@userPassword”, SqlDbType.NVarChar).Value = userPassword;
cmdInsert.CommandText = “dbo.proc_InsertUsers”;
cmdInsert.Connection = conn;
cmdInsert.ExecuteNonQuery();
conn.Close();

}

catch (Exception ex)
{

}

finally
{
conn.Close();

}

}

public void Remove(string userID)
{

SqlConnection conn = new SqlConnection(connString);
try
{

SqlCommand cmdRemove = new SqlCommand();
cmdRemove.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
cmdRemove.Parameters.Add(“@userID”, SqlDbType.NVarChar).Value = userID;
cmdRemove.ExecuteNonQuery();
cmdRemove.CommandText = “dbo.proc_Edit”;
cmdRemove.Connection = conn;
conn.Close();

}

catch (Exception ex)
{

}

finally
{
conn.Close();

}

}

public DataTable FillRecords(string userID)
{

SqlConnection conn = new SqlConnection(this.connString);
SqlDataAdapter da = new SqlDataAdapter(“SELECT [ID],[userID], [userName], [budgetPlan], [amountInhand], [amountConsumed], [currentAmount], [startDay], [endDay] FROM [tbl_BudgetManagement] WHERE [userID] ='” + userID + “‘ ORDER BY ID DESC”, conn);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable SelectFromBudget(string userID)
{

SqlConnection conn = new SqlConnection(this.connString);
SqlDataAdapter da = new SqlDataAdapter(“SELECT [ID],[userID], [userName], [budgetPlan], [amountInhand], [amountConsumed], [currentAmount], [startDay], [endDay] FROM [tbl_BudgetManagement] WHERE [userID]='” + userID + “‘ Order By ID”, conn);
DataTable dt = new DataTable();
da.Fill(dt);

return dt;

}

public int CountUsers(string userID)
{
SqlConnection conn = new SqlConnection(this.connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectUsers”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(“@userID”, SqlDbType.NVarChar);
cmd.Parameters[“@userID”].Direction = ParameterDirection.Input;
cmd.Parameters[“@userID”].Value = userID;
object count = 0;

count = (object)cmd.ExecuteScalar();

conn.Close();

if ((int)count != 0)
{

return (int)count;

}

else
{

return 0;

}

}

public int RowCount(string userID)
{
SqlConnection conn = new SqlConnection(this.connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT COUNT(*) AS count_returned FROM dbo.tbl_BudgetManagement WHERE userID = ‘” + userID + “‘”, conn);
object i = 0;

i = (object)cmd.ExecuteScalar();

conn.Close();

if (i != null)
{

return (int)i;

}

else
{

return 0;

}

}

public bool GetUsersByPasswordAndID(string userPassword, string userID)
{
SqlConnection conn = new SqlConnection(connString);
SqlDataReader reader = null;
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_Users Where [email protected] AND [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userPassword”, userPassword);
cmd.Parameters.AddWithValue(“@userID”, userID);
reader = cmd.ExecuteReader();
if (reader.FieldCount > 0)
{
conn.Close();
return true;

}

else
{
conn.Close();
return false;

}

}

public bool GetUsersByIDs(string userID)
{
SqlConnection conn = new SqlConnection(connString);
SqlDataReader reader = null;
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_Users Where [email protected]”, conn);
cmd.Parameters.AddWithValue(“@userID”, userID);
reader = cmd.ExecuteReader();
if (reader != null && reader.HasRows)
{
conn.Close();
return true;

}

else
{
conn.Close();
return false;

}

}

public DataTable GetUsersByID(string userID)
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_Users Where @[email protected]”, conn);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public void InsertIntoAssets(string userID, string userName, string assetType, float assetPrice, float assetusedAmount, float amountInhand)
{
try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertIntoAssets”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@userName”, userName);
cmdInsert.Parameters.AddWithValue(“@assetType”, assetType);
cmdInsert.Parameters.AddWithValue(“@assetPrice”, assetPrice);
cmdInsert.Parameters.AddWithValue(“@assetamountUsed”, assetusedAmount);
cmdInsert.Parameters.AddWithValue(“@amountInhand”, amountInhand);

cmdInsert.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void UpdateBudgetPlan(string userID, string userName, string budgetPlan, float amountInhand, float amountConsumed, string startDay,
string endDay, float currentAmount, float amountDeficit, bool reqLoan, float loantoReturn, float interest

)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_InsertIntoAssets”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@userName”, userName);
cmdUpdate.Parameters.AddWithValue(“@budgetPlan”, budgetPlan);
cmdUpdate.Parameters.AddWithValue(“@amountInhand”, amountInhand);
cmdUpdate.Parameters.AddWithValue(“@amountConsumed”, amountConsumed);
cmdUpdate.Parameters.AddWithValue(“@startDay”, startDay);
cmdUpdate.Parameters.AddWithValue(“@endDay”, endDay);
cmdUpdate.Parameters.AddWithValue(“@currentAmount”, currentAmount);
cmdUpdate.Parameters.AddWithValue(“@amountDeficit”, amountDeficit);
cmdUpdate.Parameters.AddWithValue(“@reqLoan”, reqLoan);
cmdUpdate.Parameters.AddWithValue(“@loantoReturn”, loantoReturn);
cmdUpdate.Parameters.AddWithValue(“@interest”, interest);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public DataTable OrderByDateAsc(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT [userID],[userName],[budgetPlan],[amountInhand],[amountConsumed],Convert(DateTime,startDay,101) AS StartDate,Convert(DateTime,endDay,101)AS EndDate,[currentAmount],[amountDeficit],[reqLoan],[loantoReturn],[interest] FROM [Budget].[dbo].[tbl_BudgetManagement] Where userID='” + userID + “‘ Order By StartDate ASC”, conn);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable OrderByDateDesc(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT [userID],[userName],[budgetPlan],[amountInhand],[amountConsumed],Convert(DateTime,startDay,101) AS StartDate,Convert(DateTime,endDay,101)AS EndDate,[currentAmount],[amountDeficit],[reqLoan],[loantoReturn],[interest] FROM [Budget].[dbo].[tbl_BudgetManagement] Where userID='” + userID + “‘ Order By StartDate DESC”, conn);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public void InsertIntoUsersRegistration(string userID, string userName, string userPassword, string secQ, string secA)
{
try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertIntoUsersRegistration”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@userName”, userName);
cmdInsert.Parameters.AddWithValue(“@userPassword”, userPassword);
cmdInsert.Parameters.AddWithValue(“@secQ”, secQ);
cmdInsert.Parameters.AddWithValue(“@secA”, secA);

cmdInsert.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public void UpdatePasswords(string userID, string userPassword, string secAns)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_ChangePassword”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@userPassword”, userPassword);
cmdUpdate.Parameters.AddWithValue(“@secAns”, secAns);

cmdUpdate.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public string GetQuestion(string userID)
{
SqlConnection conn = new SqlConnection(this.connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT * From tbl_Registration WHERE userID = ‘” + userID + “‘”, conn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
conn.Close();
if (dt.Rows.Count > 0)
{
return (string)(dt.Rows[0][“secQ”]);

}

else
{

return “No Records”;

}

}

public bool CheckAnswer(string userID, string secA)
{

SqlConnection conn = new SqlConnection(connString);
SqlDataReader reader = null;
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_Registration Where [email protected] AND [email protected]”, conn);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.Parameters.AddWithValue(“@secA”, secA);
reader = cmd.ExecuteReader();
if (reader != null && reader.HasRows)
{
conn.Close();
return true;

}

else
{
conn.Close();
return false;

}

}

public DataTable GetLoanInfo(string userID)
{
SqlConnection conn = new SqlConnection(this.connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT ID,Sum(loanAmount) AS TotalLoan,Sum(interestAmount) As TotalInterest,Sum(loanReturned) As LoanReturned From tbl_Loan WHERE userID='” + userID + “‘ Group By ID Order By ID DESC”, conn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
conn.Close();
if (dt.Rows.Count > 0)
{
return dt;

}

else
{

dt.Clear();

dt.Rows.Add(0, 0, 0);
return dt;

}

}

public void InsertIntoLoan(string lenderID, string userID, string startDay, string endDay, float loanAmount, bool loanwithInterest, int loanDuration, float loanPenaltyperday)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_InsertIntoLoan”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@lenderID”, lenderID);
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@startDay”, startDay);
cmdInsert.Parameters.AddWithValue(“@endDay”, endDay);
cmdInsert.Parameters.AddWithValue(“@loanAmount”, loanAmount);
cmdInsert.Parameters.AddWithValue(“@loanwithInterest”, loanwithInterest);
cmdInsert.Parameters.AddWithValue(“@loanDuration”, loanDuration);
cmdInsert.Parameters.AddWithValue(“@loanPenaltyperday”, loanPenaltyperday);
cmdInsert.ExecuteNonQuery();
conn.Close();

}

catch (Exception ex)
{

}

}

public DataTable SetlectFromBank(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT [ID],[userID],[userName],[bankID],[creditCard],[description],[loanAmount],[negotiateAmount],[startDay],[endDay],[negotiateDay],[loanwithInterest],[interestAmount],[loanDuration],[loanPenaltyperday],[consumedAmount] FROM tbl_Bank Where [userID][email protected] AND [loanAmount]>0 Order By [ID] DESC “, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SetlectFromThirdParty(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT [ID],[userID],[userName],[thirdpartyID],[description],[loanAmount],[startDay],[endDay],[loanwithInterest],[interestAmount],[loanDuration],[loanPenalty] FROM tbl_ThirdParty Where [userID][email protected] AND [loanAmount]>0 Order By [ID] DESC “, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public void BalanceBudget(int ID, string userID, float consumedAmount)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdInsert = new SqlCommand(“proc_BalanceBudget”, conn);
cmdInsert.CommandType = CommandType.StoredProcedure;
cmdInsert.Parameters.AddWithValue(“@ID”, ID);
cmdInsert.Parameters.AddWithValue(“@userID”, userID);
cmdInsert.Parameters.AddWithValue(“@consumedAmount”, consumedAmount);
cmdInsert.ExecuteNonQuery();
conn.Close();

}

catch (Exception ex)
{

}

}

public DataTable SelectFromBankForEdit(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdSelect = new SqlCommand(“proc_SelectFromBankForEdit”, conn);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.AddWithValue(“@ID”, ID);
cmdSelect.Parameters.AddWithValue(“@userID”, userID);
cmdSelect.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmdSelect);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable SelectFromThirdPartyForEdit(int ID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdSelect = new SqlCommand(“proc_SelectFromThirdPartyForEdit”, conn);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.AddWithValue(“@ID”, ID);
cmdSelect.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmdSelect);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable GetBankLoan(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdSelect = new SqlCommand(“proc_GetBankLoanByIDs”, conn);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.AddWithValue(“@ID”, ID);
cmdSelect.Parameters.AddWithValue(“@userID”, userID);
cmdSelect.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmdSelect);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable GetThirdPartyLoanByIDs(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdSelect = new SqlCommand(“proc_GetThirdPartyLoanByIDs”, conn);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.AddWithValue(“@ID”, ID);
cmdSelect.Parameters.AddWithValue(“@userID”, userID);
cmdSelect.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmdSelect);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public DataTable GetThirdPartyLoan(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdSelect = new SqlCommand(“proc_GetThirdPartyLoansByIDs”, conn);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.AddWithValue(“@ID”, ID);
cmdSelect.Parameters.AddWithValue(“@userID”, userID);
cmdSelect.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmdSelect);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;

}

public void EditBankLoans(int ID, string userID, string bankID, float loanRet, float interestRet, float penaltyRet)
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdEdit = new SqlCommand(“proc_EditBankLoans”, conn);
cmdEdit.CommandType = CommandType.StoredProcedure;
cmdEdit.Parameters.AddWithValue(“@ID”, ID);
cmdEdit.Parameters.AddWithValue(“@userID”, userID);
cmdEdit.Parameters.AddWithValue(“@bankID”, bankID);
cmdEdit.Parameters.AddWithValue(“@loanRet”, loanRet);
cmdEdit.Parameters.AddWithValue(“@interestRet”, interestRet);
cmdEdit.Parameters.AddWithValue(“@penaltyRet”, penaltyRet);
cmdEdit.ExecuteNonQuery();

}

public void ComplexUpdateThirdPartyQuery(int ID, float loanPenalty, float consumedAmount, float interestAmount)
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdEdit = new SqlCommand(“proc_ComplexUpdateThirdPartyLoan”, conn);
cmdEdit.CommandType = CommandType.StoredProcedure;
cmdEdit.Parameters.AddWithValue(“@ID”, ID);
cmdEdit.Parameters.AddWithValue(“@loanPenaltyperday”, loanPenalty);
cmdEdit.Parameters.AddWithValue(“@consumedAmount”, consumedAmount);
cmdEdit.Parameters.AddWithValue(“@interestAmount”, interestAmount);
cmdEdit.ExecuteNonQuery();

}

public void ComplexUpdateBankQuery(int ID, string userID, string bankID, float loanPenalty, float consumedAmount, float interestAmount)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdEdit = new SqlCommand(“proc_ComplexUpdateBank”, conn);
cmdEdit.CommandType = CommandType.StoredProcedure;
cmdEdit.Parameters.AddWithValue(“@ID”, ID);
cmdEdit.Parameters.AddWithValue(“@userID”, userID);
cmdEdit.Parameters.AddWithValue(“@bankID”, bankID);
cmdEdit.Parameters.AddWithValue(“@loanPenaltyperday”, loanPenalty);
cmdEdit.Parameters.AddWithValue(“@consumedAmount”, consumedAmount);
cmdEdit.Parameters.AddWithValue(“@interestAmount”, interestAmount);
cmdEdit.ExecuteNonQuery();
conn.Close();

}

public void ComplexUpdateThirdPartyQuery(int ID, string userID, string lenderID, float loanPenalty, float consumedAmount, float interestAmount)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdEdit = new SqlCommand(“proc_ComplexUpdateThirdPartyLoan”, conn);
cmdEdit.CommandType = CommandType.StoredProcedure;
cmdEdit.Parameters.AddWithValue(“@ID”, ID);
cmdEdit.Parameters.AddWithValue(“@userID”, userID);
cmdEdit.Parameters.AddWithValue(“@loanPenaltyperday”, loanPenalty);
cmdEdit.Parameters.AddWithValue(“@consumedAmount”, consumedAmount);
cmdEdit.Parameters.AddWithValue(“@interestAmount”, interestAmount);
cmdEdit.ExecuteNonQuery();
conn.Close();

}

public void BalanceBudgetDeficitwithBankAmount(int ID, string userID, float consumedAmount)
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdEdit = new SqlCommand(“proc_BalanceBudgetDeficitwithBankAmount”, conn);
cmdEdit.CommandType = CommandType.StoredProcedure;
cmdEdit.Parameters.AddWithValue(“@ID”, ID);
cmdEdit.Parameters.AddWithValue(“@userID”, userID);
cmdEdit.Parameters.AddWithValue(“@consumedAmount”, consumedAmount);
cmdEdit.ExecuteNonQuery();
conn.Close();

}

public void UseBankLoanForBudgetAdjustment(int ID, string userID, string bankID, float amountTaken)
{

try
{
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_BankLoanForBudgetAdjustment”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@bankID”, bankID);
cmdUpdate.Parameters.AddWithValue(“@amountTaken”, amountTaken);

cmdUpdate.ExecuteNonQuery();

conn.Close();

}

catch (Exception ex)
{

}

}

public DataTable SelectLatestFromBank(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SelectLatestFromBank”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectLatestFromAsset(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“SelectLatestFromAsset”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public void UpdateThirdPartyLoan(int ID, string userID, string partyID, float loanRet, float interestRet, float penaltyRet)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_EditThirdPartyLoans”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@partyID”, partyID);
cmdUpdate.Parameters.AddWithValue(“@loanRet”, loanRet);
cmdUpdate.Parameters.AddWithValue(“@interestRet”, interestRet);
cmdUpdate.Parameters.AddWithValue(“@penaltyRet”, penaltyRet);

cmdUpdate.ExecuteNonQuery();

conn.Close();

}

public void UpdateAssetForBudgetAdjustment(int ID, string userID, float amountTaken)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_AssetForBudgetAdjustment”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@amountTaken”, amountTaken);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

public DataTable SelectFromBankLoanForBudgetAdjust(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromBankLoanForBudgetAdjustment”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFrom3rdPartyForBudgetAdjust(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFrom3rdPartyForBudgetAdjustment”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromAssetForBudgetAdjust(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromAssetForBudgetAdjustment”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public void AdjustBudgetwithBank(int ID, int queryID, string userID, string bankID, float amountUse)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_AdjustBudgetwithBankLoan”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@queryID”, queryID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@bankID”, bankID);
cmdUpdate.Parameters.AddWithValue(“@amountUse”, amountUse);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

public void AdjustBudgetwithThirdParty(int ID, int queryID, string userID, string thirdpartyID, float amountUse)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_AdjustBudgetwith3rdPartyLoan”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@queryID”, queryID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@3rdpartyID”, thirdpartyID);
cmdUpdate.Parameters.AddWithValue(“@amountUse”, amountUse);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

public void AdjustBudgetwithAsset(int ID, int queryID, string userID, float amountUse)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_AdjustBudgetwithAsset”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@queryID”, queryID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@assetamountUsed”, amountUse);
cmdUpdate.ExecuteNonQuery();

conn.Close();

}

public DataTable SelectFromMoneyMovement(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromMoneyMovement”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromMoneyMovementByuserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromMoneyMovementByuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromMoneyMovementInwardByuserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromMoneyMovementInwardByuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromMoneyMovementByIDANDuserID(int ID, int uniqueID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromMoneyMovementByIDANDuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@uniqueID”, uniqueID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromMoneyMovementInwardByIDANDuserID(int ID, int uniqueID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromMoneyMovementInwardByIDANDuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@uniqueID”, uniqueID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromColumnNamesMoneyMovement()
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectColumnNamesFromMoneyMovement”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromColumnNamesMoneyMovementInward()
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectColumnNamesFromMoneyMovementInward”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SumCurrentAmountTotalFromBudgetManagement(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SumCurrentAmountTotalFromBudgetManagement”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromBudgetManagementByIDanduserID(int ID, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_BudgetManagement Where [email protected] AND [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectFromPlanTypeByID(int ID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_planType Where [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@ID”,ID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetYear()
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_GetYear”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetMonth()
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_GetMonth”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetDay(int i)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_Getday”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@i”, i);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetDates(string strtDt, int ts)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_GetDates”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@dt”, strtDt);
cmd.Parameters.AddWithValue(“@ts”, ts);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public void InsertIntoMoneyMovement(int ID, string dates, string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“proc_InsertIntoMoneyMovement”, conn);
cmdUpdate.CommandType = CommandType.StoredProcedure;
cmdUpdate.Parameters.AddWithValue(“@dates”, dates);
cmdUpdate.Parameters.AddWithValue(“@ID”, ID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.ExecuteNonQuery();
conn.Close();

}

public DataTable SelectFromBudgetManagementByuserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectFromBudgetManagementbyuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectTotalRowsFromBudgetManagementByuserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_SelectTotalRowsFromBudgetManagementbyuserID”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectTotalRowsFromMoneyMovementuserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“Select Count(*) As totalRows From tbl_MoneyMovement Where [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectTotalRowsFromMoneyMovementInwarduserID(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“Select Count(*) As totalRows From tbl_MoneyMovementInward Where [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable ParsedDate(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT CONVERT(char(10), GetDate(),126) As startDate from tbl_BudgetManagement Where [email protected] Order By ID”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable SelectAmountConsumedFromBudgetManagement(int ID,string userID)
{
SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT ID,amountInhand,amountConsumed From tbl_BudgetManagement Where [email protected] AND [email protected]”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@ID”,ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;
}

public void UpdateBudgetConsumedAmount(int ID, string userID, float enteredAmount)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmdUpdate = new SqlCommand(“Update tbl_BudgetManagement Set amountConsumed=amountConsumed + @enteredAmount Where [email protected] AND [email protected]”, conn);
cmdUpdate.CommandType = CommandType.Text;
cmdUpdate.Parameters.AddWithValue(“@ID”,ID);
cmdUpdate.Parameters.AddWithValue(“@userID”, userID);
cmdUpdate.Parameters.AddWithValue(“@enteredAmount”, enteredAmount);
cmdUpdate.ExecuteNonQuery();
conn.Close();

}

public DataTable MatchDates(string userID, string Dt)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“Select ID From tbl_BudgetManagement Where [email protected] AND ” + Dt + “=@” + Dt , conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@startDay”,Dt);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable InsertIntoandSelectFromTempstrtdt(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_InsertintoandSelectFromTempstrtdtCursor”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataTable dt=new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable InsertIntoandSelectFromTempstrtdt2(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_InsertintoandSelectFromTempstrtdtCursor2”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable InsertIntoandSelectFromTempstrtdt3(string userID)
{

SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand(“proc_InsertintoandSelectFromTempstrtdtCursor3”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetPlanType()
{
SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“Select * From tbl_Plan”,conn) ;
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetAllDates()
{
SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT convert(varchar, DateRanges, 101) As Date_Ranges From [Budget].[dbo].[tbl_TmpNegotiateDates]”, conn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;
}

public void InsertIntoAllDates(DateTime startDate,int days)

{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_InsertAllDates”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@startDate”,startDate);
cmd.Parameters.AddWithValue(“@days”,days );

cmd.ExecuteNonQuery();

}

public DataTable GetLastRecordBudgetManagement(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_GetLastRecordBudgetManagement”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public DataTable GetLastRecordBankLoan(string userID)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_GetLastRecordBankLoan”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
return dt;

}

public void UpdateLoanAmountConsumed(int ID,string userID,float consumedAmount)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_UpdateLoanAmountConsumed”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”,ID);
cmd.Parameters.AddWithValue(“@userID”,userID);
cmd.Parameters.AddWithValue(“@consumedAmount”,consumedAmount);
cmd.ExecuteNonQuery();
conn.Close();

}

public void UpdatePenaltyThirdParty(int ID, string userID, float penalty)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_UpdatePenaltyThirdParty”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.Parameters.AddWithValue(“@penalty”,penalty);
cmd.ExecuteNonQuery();
conn.Close();

}

public void UpdateEnddateBankLoan(int ID, string userID,string endDate)
{

SqlConnection conn = new SqlConnection(connString);

conn.Open();
SqlCommand cmd = new SqlCommand(“proc_UpdateEnddateBankLoan”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@ID”, ID);
cmd.Parameters.AddWithValue(“@userID”, userID);
cmd.Parameters.AddWithValue(“@endDate”, endDate);
cmd.ExecuteNonQuery();

}

}

This is my Business Access Class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

///

/// Summary description for budgetBAL
///

public class budgetBAL
{
public budgetBAL()
{
//
// TODO: Add constructor logic here
//
}

public void AddFunction(string _userID, string _userName, string _budgetPlan, float _amountInhand, float _amountConsumed,string _startDay,
string _endDay, float _currentAmount)
{
budgetDAL obj = new budgetDAL();
obj.InsertInto(_userID, _userName, _budgetPlan, _amountInhand, _amountConsumed, _startDay,
_endDay, _currentAmount);

}

public void EditFunction(string _userID, string _userName, string _budgetPlan, float _amountInhand, float _amountConsumed, DateTime _startDay,
DateTime _endDay, float _currentAmount, float _amountDeficit, bool _reqLoan, float _loantoReturn, float _interest)
{
budgetDAL obj = new budgetDAL();
obj.UpdateInfo(_userID, _userName, _budgetPlan, _amountInhand, _amountConsumed, _startDay,
_endDay, _currentAmount, _amountDeficit, _reqLoan, _loantoReturn, _interest);

}

public void DeleteFunction(string _userID)
{
budgetDAL obj = new budgetDAL();
obj.Remove(_userID);

}

public DataTable RecordsFetched(string _userID)
{

return new budgetDAL().FillRecords(_userID);

}

public DataTable SelectFromBudgetPlan(string _userID)
{

return new budgetDAL().SelectFromBudget(_userID);

}

public int GetUsersCount(string _userID)
{
budgetDAL obj = new budgetDAL();
int count = obj.CountUsers(_userID);
return count;

}

public void InsertUsers(string _userID, string _userName, string _userPassword)
{
budgetDAL obj = new budgetDAL();
obj.InsertIntoUsers(_userID, _userName, _userPassword);

}

public int CountRow(string _userID)
{

budgetDAL obj = new budgetDAL();

int i = obj.RowCount(_userID);
return i;

}

public bool UsersByIDPwd(string _userPassword,string _userID)
{

budgetDAL obj = new budgetDAL();
Boolean truefalse = obj.GetUsersByPasswordAndID(_userPassword,_userID);
return truefalse;

}

public bool UsersByID(string _userID)
{

budgetDAL obj = new budgetDAL();
Boolean truefalse = obj.GetUsersByIDs(_userID);
return truefalse;

}

public DataTable GetUsersByUserID(string _userID)
{
budgetDAL obj = new budgetDAL();
DataTable dt = new DataTable();
dt =(DataTable)obj.GetUsersByID(_userID);
return dt;

}

public void InsertToBank(string _userID, string _userName, string _bankID,string _creditCard ,string _desc, float _loanAmnt,float _negotiateAmount,string _startDay,string _endDay,string _negotiateDate,bool _loanInt, float _intAmnt, int _loanDur,float _penalty)
{

budgetDAL obj = new budgetDAL();

obj.InsertIntoBank(_userID,_userName,_bankID,_creditCard,_desc,_loanAmnt,_negotiateAmount,_startDay,_endDay,_negotiateDate,_loanInt,_intAmnt,_loanDur,_penalty);

}

public void AddIntoThirdParty(string _userID, string _userName, string _partyID, string _desc, float _loanAmnt,string _startDay,string _endDay,bool _loanInt, float _intAmnt, int _loanDur, float _penalty)
{

budgetDAL obj = new budgetDAL();
obj.InsertIntoThirdParty(_userID,_userName,_partyID,_desc,_loanAmnt,_startDay,_endDay ,_loanInt,_intAmnt,_loanDur,_penalty);

}

public void AddIntoAssets(string _userID, string _userName, string _assetType, float _assetPrice, float _assetamountUsed, float _amountInhand)
{

budgetDAL obj = new budgetDAL();
obj.InsertIntoAssets(_userID, _userName, _assetType,_assetPrice,_assetamountUsed,_amountInhand);

}

public void EditBudgetPlan(string _userID, string _userName, string _budgetPlan, float _amountInhand, float _amountConsumed, string _startDay,
string _endDay, float _currentAmount, float _amountDeficit, bool _reqLoan, float _loantoReturn, float _interest

)
{
budgetDAL obj = new budgetDAL();

obj.UpdateBudgetPlan(_userID, _userName, _budgetPlan, _amountInhand, _amountConsumed, _startDay,
_endDay, _currentAmount, _amountDeficit, _reqLoan, _loantoReturn, _interest);

}

public DataTable OrderByDatesASC(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.OrderByDateAsc(_userID);

}

public DataTable OrderByDatesDESC(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.OrderByDateDesc(_userID);

}

public void InsertUsersRegistration(string _userID, string _userName, string _userPassword, string _secQ, string _secA)
{

budgetDAL obj = new budgetDAL();
obj.InsertIntoUsersRegistration(_userID, _userName, _userPassword, _secQ, _secA);

}

public void ChangePasswords(string _userID, string _userPassword, string _secAns)
{
budgetDAL obj = new budgetDAL();

obj.UpdatePasswords(_userID, _userPassword, _secAns);

}

public string GetQuestions(string _userID)
{

string secQ = “”;
budgetDAL obj = new budgetDAL();
secQ = obj.GetQuestion(_userID);

return secQ;

}

public bool CheckAnswers(string _userID, string _secA)
{
budgetDAL obj = new budgetDAL();

Boolean truefalse = obj.CheckAnswer(_userID, _secA);
return truefalse;

}

public DataTable GetLoansInfo(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.GetLoanInfo(_userID);

}

public void InsertToLoan(string _lenderID, string _userID, string _startDay, string _endDay, float _loanAmount, bool _loanwithInterest, int _loanDuration, float _loanPenaltyperday)
{

budgetDAL obj = new budgetDAL();
obj.InsertIntoLoan(_lenderID,_userID,_startDay,_endDay,_loanAmount,_loanwithInterest,_loanDuration,_loanPenaltyperday);

}

public DataTable SetlectAllFromBank(string _userID)
{

budgetDAL obj = new budgetDAL();
DataTable dt = new DataTable();
dt = obj.SetlectFromBank(_userID);
return dt;

}

public DataTable SelectFromBankForUpdate(int _ID,string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromBankForEdit(_ID,_userID);

}

public DataTable SelectFromThirdPartyForUpdate(int _ID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromThirdPartyForEdit(_ID);

}

public DataTable SetlectAllFromThirdParty(string _userID)
{

budgetDAL obj = new budgetDAL();
DataTable dt = new DataTable();
dt = obj.SetlectFromThirdParty(_userID);
return dt;

}

public void BalanceBudgetAmount(int _ID, string _userID, float _consumedAmount)
{

budgetDAL obj = new budgetDAL();
obj.BalanceBudget(_ID, _userID, _consumedAmount);

}

public DataTable GetBankLoanByIDs(int _ID, string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.GetBankLoan(_ID, _userID);

}

public DataTable GetThirdPartyLoanByIDs_(int _ID, string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.GetThirdPartyLoanByIDs(_ID, _userID);

}

public void UpdateBankLoan(int _ID, string _userID,string _bankID,float _loanRet, float _interestRet, float _penaltyRet)
{

budgetDAL obj = new budgetDAL();
obj.EditBankLoans(_ID, _userID,_bankID ,_loanRet, _interestRet, _penaltyRet);

}

public void UpdateThirdPartyLoans(int _ID, string _userID,string _partyID,float _loanRet, float _interestRet, float _penaltyRet)
{

budgetDAL obj = new budgetDAL();
obj.UpdateThirdPartyLoan(_ID, _userID,_partyID,_loanRet, _interestRet, _penaltyRet);

}

public void ComplexBankEditQuery(int _ID, string _userID,string _bankID ,float _loanPenalty, float _consumedAmount, float _interestAmount)
{

budgetDAL obj = new budgetDAL();

obj.ComplexUpdateBankQuery(_ID, _userID,_bankID ,_loanPenalty, _consumedAmount, _interestAmount);

}

public void ComplexThirdPartyEditQuery(int _ID, string _userID,string _partyID,float _loanPenalty, float _consumedAmount, float _interestAmount)
{

budgetDAL obj = new budgetDAL();
obj.ComplexUpdateThirdPartyQuery(_ID,_userID,_partyID,_loanPenalty,_consumedAmount,_interestAmount);

}

public void ConsumeBankLoanForBudgetAdjustment(int _ID, string _userID, string _bankID, float _amountTaken)
{

budgetDAL obj = new budgetDAL();
obj.UseBankLoanForBudgetAdjustment(_ID, _userID, _bankID, _amountTaken);

}

public DataTable SelectLatestFromBankLoan(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectLatestFromBank(_userID);

}

public DataTable SelectLatestFromAssets(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectLatestFromAsset(_userID);

}
public void UpdateAssetsForBudgetAdjustment(int _ID, string _userID,float _amountTaken)
{

budgetDAL obj = new budgetDAL();
obj.UpdateAssetForBudgetAdjustment(_ID, _userID,_amountTaken);

}

public DataTable SelectFromBankLoanForBudgetAdjustment(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromBankLoanForBudgetAdjust(_userID);

}

public DataTable SelectFrom3rdPartyForBudgetAdjustment(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFrom3rdPartyForBudgetAdjust(_userID);

}

public DataTable SelectFromAssetForBudgetAdjustment(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromAssetForBudgetAdjust(_userID);

}

public void AdjustBudgetwithBankLoan(int _ID,int _queryID,string _userID, string _bankID, float _amountUse)
{

budgetDAL obj = new budgetDAL();
obj.AdjustBudgetwithBank(_ID,_queryID ,_userID,_bankID, _amountUse);

}

public void AdjustBudgetwithThirdParty(int _ID, int _queryID, string _userID, string _thirdpartyID, float _amountUse)
{
budgetDAL obj = new budgetDAL();
obj.AdjustBudgetwithThirdParty(_ID, _queryID, _userID, _thirdpartyID, _amountUse);

}

public void AdjustBudgetwithAssetAmount(int _ID, int _queryID, string _userID, float _amountUse)
{

budgetDAL obj = new budgetDAL();
obj.AdjustBudgetwithAsset(_ID, _queryID, _userID, _amountUse);

}

public DataTable SelectFromMoneyMovements(int _ID,string _userID)

{
budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovement(_ID,_userID);

}

public DataTable SelectFromMoneyMovementByuserIDs(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementByuserID(_userID);
}

public DataTable SelectFromMoneyMovementInwardByuserIDs(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementInwardByuserID(_userID);
}

public DataTable SelectFromMoneyMovementByIDANDuserIDs(int _ID,int _uniqueID,string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementByIDANDuserID(_ID,_uniqueID,_userID);
}

public DataTable SelectFromMoneyMovementInwardByIDANDuserIDs(int _ID, int _uniqueID, string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementInwardByIDANDuserID(_ID, _uniqueID, _userID);
}

public DataTable SelectFromMoneyMovementinwardByIDANDuserIDs(int _ID, int _uniqueID, string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementInwardByIDANDuserID(_ID, _uniqueID, _userID);
}

public DataTable SelectFromColumnNameMoneyMovement()
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromColumnNamesMoneyMovement();

}

public DataTable SelectFromColumnNameMoneyMovementInward()
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromColumnNamesMoneyMovementInward();

}

public DataTable SumCurrentAmountsTotalFromBudgetManagement(int _ID,string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SumCurrentAmountTotalFromBudgetManagement(_ID, _userID);

}

public DataTable SelectFromBudgetManagementByIDsanduserIDs(int _ID, string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromBudgetManagementByIDanduserID(_ID, _userID);

}

public DataTable InsertIntoandSelectFromTempstrtdtTable(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.InsertIntoandSelectFromTempstrtdt(_userID);

}

public DataTable InsertIntoandSelectFromTempstrtdtTable2(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.InsertIntoandSelectFromTempstrtdt2(_userID);

}

public DataTable InsertIntoandSelectFromTempstrtdt3_(string _userID)

{

budgetDAL obj = new budgetDAL();
return obj.InsertIntoandSelectFromTempstrtdt3(_userID);

}

public DataTable SelectFromPlanTypesByID(int _ID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromPlanTypeByID(_ID);

}

public DataTable Get_Year()
{
budgetDAL obj = new budgetDAL();
return obj.GetYear();

}

public DataTable Get_Month()
{
budgetDAL obj = new budgetDAL();
return obj.GetMonth();

}

public DataTable Get_Day(int i)
{
budgetDAL obj = new budgetDAL();
return obj.GetDay(i);

}

public DataTable Get_Dates(string _strtDt, int _ts)
{

budgetDAL obj = new budgetDAL();
return obj.GetDates(_strtDt, _ts);

}

public void InsertIntoMoneyMovements(int _ID, string _dates, string _userID)
{
budgetDAL obj = new budgetDAL();
obj.InsertIntoMoneyMovement(_ID, _dates, _userID);

}

public DataTable SelectFromBudgetManagementByuserIDs(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.SelectFromBudgetManagementByuserID(_userID);
}

public DataTable SelectTotalRowsFromBudgetManagementByuserIDs(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectTotalRowsFromBudgetManagementByuserID(_userID);

}

public DataTable SelectTotalRowsFromMoneyMovementuserIDs(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementByuserID(_userID);

}

public DataTable SelectTotalRowsFromMoneyMovementInwarduserIDs(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectFromMoneyMovementInwardByuserID(_userID);

}

public DataTable ParsedDates(string _userID)
{
budgetDAL obj = new budgetDAL();
return obj.ParsedDate(_userID);

}

public DataTable SelectAmountConsumedFromBudgetManagementByIDs(int _ID,string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.SelectAmountConsumedFromBudgetManagement(_ID, _userID);

}

public void UpdateBudgetConsumedAmount(int _ID, string _userID,float _enteredAmount)
{
budgetDAL obj = new budgetDAL();
obj.UpdateBudgetConsumedAmount(_ID, _userID, _enteredAmount);

}

public DataTable MatchDate(string _userID, string _strtDt)
{

budgetDAL obj = new budgetDAL();
return obj.MatchDates(_userID, _strtDt);

}

public DataTable GetPlanTypes()
{

budgetDAL obj = new budgetDAL();
return obj.GetPlanType();

}

public DataTable GetAllDates_()
{
budgetDAL obj = new budgetDAL();
return obj.GetAllDates();

}

public void InsertIntoAllDates_(DateTime _startDate, int _days)
{
budgetDAL obj = new budgetDAL();
obj.InsertIntoAllDates(_startDate, _days);

}

public DataTable GetLastRecordBudgetManagement_(string _userID)
{

budgetDAL obj = new budgetDAL();
return obj.GetLastRecordBudgetManagement(_userID);

}

public DataTable GetLastRecordBankLoan_(string _userID)

{
budgetDAL obj = new budgetDAL();

return obj.GetLastRecordBankLoan(_userID);

}

public void UpdateLoanAmountConsumed_(int _ID, string _userID,float _amountConsumed)
{

budgetDAL obj = new budgetDAL();
obj.UpdateLoanAmountConsumed(_ID,_userID,_amountConsumed);

}

public void UpdatePenaltyThirdParty_(int _ID, string _userID, float _penalty)
{
budgetDAL obj = new budgetDAL();
obj.UpdatePenaltyThirdParty(_ID, _userID, _penalty);

}

public void UpdateEnddateBankLoan_(int _ID, string _userID, string _endDate)
{

budgetDAL obj = new budgetDAL();
obj.UpdateEnddateBankLoan(_ID, _userID, _endDate);

}

}

Syed Adeel Ahmed
Syed Adeel Ahmed
Analyst, Programmer, Educationist and Blogger at Technofranchise
Computer Systems Engineer from Sir Syed University Of Engineering & Technology.I am passionate about all types of programming.

Published by

Syed Adeel Ahmed

Computer Systems Engineer from Sir Syed University Of Engineering & Technology.I am passionate about all types of programming.