I made two class libraries called DAL and BLL. The DAL seems to be working fine. The BLL has a problem. I added a JournalBLL.cs and it work fine. It shows up in the object data source. I added another class called JournalEntryBLL.cs and it's not showing
up in the object data source. it compiles fine but just doesn't show up in the ODS. Any ideas?
I should have told you the DAL houses a strongly typed dataset .xsd file with tableadapters. The BLL houses the business logic i use before sending the data to the database.
pnoneal
Member
353 Points
166 Posts
DAL and BLL
Feb 05, 2012 11:03 PM|LINK
I made two class libraries called DAL and BLL. The DAL seems to be working fine. The BLL has a problem. I added a JournalBLL.cs and it work fine. It shows up in the object data source. I added another class called JournalEntryBLL.cs and it's not showing up in the object data source. it compiles fine but just doesn't show up in the ODS. Any ideas?
I should have told you the DAL houses a strongly typed dataset .xsd file with tableadapters. The BLL houses the business logic i use before sending the data to the database.
Thanks,
Paul
Mastan Oli
Contributor
5088 Points
998 Posts
Re: DAL and BLL
Feb 06, 2012 04:24 AM|LINK
Paul,
What you have written in the JournalEntryBLL.cs? when JournalBLL.cs return values, JournalEntryBLL.cs should be work... post ur code here...
playingOOPS | மெய்ப்பொருள் காண்பதறிவு
Mark as Answer If you find helpful
pnoneal
Member
353 Points
166 Posts
Re: DAL and BLL
Feb 06, 2012 01:54 PM|LINK
I messed around with the code and made just one class for the whole site and now none of them show up. Here is the code for that one.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using DAL.dsSiteTableAdapters;
/// <summary>
/// Summary description JournalBLL
/// </summary>
namespace BLL
{
[System.ComponentModel.DataObject]
class siteBLL
{
private JournalTableAdapter _journalAdapter = null;
protected JournalTableAdapter Adapter
{
get
{
if (_journalAdapter == null)
_journalAdapter = new JournalTableAdapter();
return _journalAdapter;
}
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public dsSite.JournalDataTable GetAllJournal()
{
return Adapter.GetAllJournal();
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
public dsSite.JournalDataTable GetJournalByJournalUser(string journalUser)
{
return Adapter.GetJournalByJournalUser(journalUser);
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
public dsSite.JournalDataTable GetJournalByJournalID(int journalID)
{
return Adapter.GetJournalByJournalID(journalID);
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
public bool InsertJournal(string journalName, string journalUser)
{
// Create a new JournalRow instance
dsSite.JournalDataTable dtJournal = new dsSite.JournalDataTable();
dsSite.JournalRow rowJournal = dtJournal.NewJournalRow();
rowJournal.journalName = journalName;
rowJournal.journalUser = journalUser;
// Add the new journal
dtJournal.AddJournalRow(rowJournal);
int rowsAffected = Adapter.Update(dtJournal);
// Return true if precisely one row was inserted, otherwise false
return rowsAffected == 1;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
public bool UpdateJournal(string journalName, string journalUser, int Original_journalID)
{
// Create a new JournaltRow instance
dsSite.JournalDataTable dtJournal = Adapter.GetJournalByJournalID(Original_journalID);
if (dtJournal.Count == 0)
return false;
dsSite.JournalRow rowJournal = dtJournal[0];
rowJournal.journalName = journalName;
// Update the journal record
int rowsAffected = Adapter.Update(dtJournal);
// Return true if precisely one row was updated, otherwise false
return rowsAffected == 1;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
public bool DeleteJournal(int Original_journalID)
{
int rowsAffected = Adapter.Delete(Original_journalID);
// Return true if precisely one row was deleted, otherwise false
return rowsAffected == 1;
}
}
}
pnoneal
Member
353 Points
166 Posts
Re: DAL and BLL
Feb 06, 2012 02:35 PM|LINK
I figured it out! You can't select the class file. It has to be a code file.cs. No idea why, but it works now! woot woot woot.....