public int InsertBillingDetails(BillingDetails billingDetailsObject)
 {
     return (billingDetailsDALObject.InsertBillingDetails(billingDetailsObject));
 }
        public int InsertBillingDetails(BillingDetails billingDetailsObject)
        {
            int queryStatus = 0;

            databaseObject.CommandToExecute = new SqlCommand();

            databaseObject.CommandToExecute.CommandText = @"uspInsertBillingDetails";
            databaseObject.CommandToExecute.CommandType = CommandType.StoredProcedure;
            databaseObject.DBDataTable = new DataTable();
            databaseObject.DBDataTable.Columns.Add("BillId", typeof(int));
            databaseObject.DBDataTable.Columns.Add("BillAmount", typeof(int));
            databaseObject.DBDataTable.Columns.Add("CardNumber", typeof(string));
            databaseObject.DBDataTable.Columns.Add("ModeOfPayment", typeof(string));

            databaseObject.DBDataTable.Rows.Add(billingDetailsObject.BillId,billingDetailsObject.BillAmount,
                                                billingDetailsObject.CardNumber,billingDetailsObject.ModeOfPayment);
            param1 = new SqlParameter();
            param1.ParameterName = "@userBillingData";
            param1.Value = databaseObject.DBDataTable;

            param1.SqlDbType = SqlDbType.Structured;

            try
            {
                databaseObject.CommandToExecute.Connection = databaseObject.DatabaseConnection;

                databaseObject.DatabaseConnection.Open();

                databaseObject.CommandToExecute.Parameters.Add(param1);

                queryStatus = databaseObject.CommandToExecute.ExecuteNonQuery();

            }
            catch (SqlException sqlEx)
            {
                return sqlEx.ErrorCode;
            }
            finally
            {
                databaseObject.DatabaseConnection.Close();
            }
            return queryStatus;
        }