public int InsertAccountsRevivals(AccountsRevival theAccountsRevival) { int ReturnValue = 0; using (SqlCommand InsertCommand = new SqlCommand()) { InsertCommand.CommandType = CommandType.StoredProcedure; InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; InsertCommand.Parameters.Add(GetParameter("@RevivalDate", SqlDbType.VarChar, theAccountsRevival.RevivalDate)); InsertCommand.Parameters.Add(GetParameter("@CustomerAccountID", SqlDbType.Int, theAccountsRevival.CustomerAccountID)); InsertCommand.Parameters.Add(GetParameter("@RevivedFromInstallmentNumber", SqlDbType.Int, theAccountsRevival.RevivedFromInstallmentNumber)); InsertCommand.Parameters.Add(GetParameter("@TotalInstallmentsRevived", SqlDbType.Int, theAccountsRevival.TotalInstallmentsRevived)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfLastPayment", SqlDbType.VarChar, theAccountsRevival.DueDateOfLastPayment)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfMaturity", SqlDbType.VarChar, theAccountsRevival.DueDateOfMaturity)); InsertCommand.Parameters.Add(GetParameter("@PayToCompany", SqlDbType.Decimal, theAccountsRevival.PayToCompany)); InsertCommand.Parameters.Add(GetParameter("@GuaranteedDividend", SqlDbType.Decimal, theAccountsRevival.GuaranteedDividend)); InsertCommand.Parameters.Add(GetParameter("@BonusAmount", SqlDbType.Decimal, theAccountsRevival.BonusAmount)); InsertCommand.Parameters.Add(GetParameter("@PayByCompany", SqlDbType.Decimal, theAccountsRevival.PayByCompany)); InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); InsertCommand.CommandText = "pCRM_Revivals_Insert"; ExecuteStoredProcedure(InsertCommand); ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public static List <AccountsRevival> GetAccountsRevivalList(bool allOffices = false, bool showDeleted = false) { List <AccountsRevival> AccountsRevivalList = new List <AccountsRevival>(); DataTable AccountsRevivalTable = AccountsRevivalDataAccess.GetInstance.GetAccountsRevivalList(allOffices, showDeleted); foreach (DataRow dr in AccountsRevivalTable.Rows) { AccountsRevival TheAccountRevival = DataRowToObject(dr); AccountsRevivalList.Add(TheAccountRevival); } return(AccountsRevivalList); }
public static AccountsRevival DataRowToObject(DataRow dr) { AccountsRevival TheAccountsRevival = new AccountsRevival { RevivalID = int.Parse(dr["RevivalID"].ToString()), RevivalDate = DateTime.Parse(dr["RevivalDate"].ToString()).ToString(MicroConstants.DateFormat), CustomerAccountID = int.Parse(dr["CustomerAccountID"].ToString()), CustomerAccountCode = dr["CustomerAccountCode"].ToString(), CustomerName = dr["CustomerName"].ToString(), RevivedFromInstallmentNumber = int.Parse(dr["RevivedFromInstallmentNumber"].ToString()), TotalInstallmentsRevived = int.Parse(dr["TotalInstallmentsRevived"].ToString()), DueDateOfLastPayment = DateTime.Parse(dr["DueDateOfLastPayment"].ToString()).ToString(MicroConstants.DateFormat), DueDateOfMaturity = DateTime.Parse(dr["DueDateOfMaturity"].ToString()).ToString(MicroConstants.DateFormat), PayToCompany = decimal.Parse(dr["PayToCompany"].ToString()), GuaranteedDividend = decimal.Parse(dr["GuaranteedDividend"].ToString()), BonusAmount = decimal.Parse(dr["BonusAmount"].ToString()), PayByCompany = decimal.Parse(dr["PayByCompany"].ToString()) }; return(TheAccountsRevival); }
public int InsertAccountsRevivals(AccountsRevival theAccountsRevival) { return(AccountsRevivalIntegration.InsertAccountsRevivals(theAccountsRevival)); }
public static int InsertAccountsRevivals(AccountsRevival theAccountsRevival) { return(AccountsRevivalDataAccess.GetInstance.InsertAccountsRevivals(theAccountsRevival)); }