user3475467 user3475467 - 4 months ago 20
Vb.net Question

Can't find class in namespace

I have created a class, but when I try to access it using

Dim obj As New FabSalesDB.BusinessLayer.DayEnd


the compiler can't find it in
FabSalesDB.BusinessLayer
but it can find other classes. What could be the reason?

namespace FabSalesDB.BusinessLayer
{
public class DayEnd : BusinessObjectBase
{
public enum DayEndFields
{
date,
CashTaken,
CardsTaken,
CashRegistered,
CardsRegistered,
CashVariance,
CardVariance,
R200,
R100,
R50,
R20,
R10,
R5,
R2,
R1,
c50,
c20,
c10,
c5,
c1
}
DateTime _date;
float _CashTaken;
float _CardsTaken;
float _CashRegistered;
float _CardsRegistered;
float _CashVariance;
float _CardVariance;
int _R200;
int _R100;
int _R50;
int _R20;
int _R10;
int _R5;
int _R2;
int _R1;
int _c50;
int _c20;
int _c10;
int _c5;
int _c1;
public DateTime date
{

get { return _date; }
set
{
if (_date != value)
{
_date = value;
PropertyHasChanged("date");
}
}

}
public float CashTaken
{

get { return _CashTaken; }
set
{
if (_CashTaken != value)
{
_CashTaken = value;
PropertyHasChanged("CashTaken");
}
}

}
public float CardsTaken
{

get { return _CardsTaken; }
set
{
if (_CardsTaken != value)
{
_CardsTaken = value;
PropertyHasChanged("CardsTaken");
}
}

}
public float CashRegistered
{

get { return _CashRegistered; }
set
{
if (_CashRegistered != value)
{
_CashRegistered = value;
PropertyHasChanged("CashRegistered");
}
}

}
public float CardsRegistered
{

get { return _CardsRegistered; }
set
{
if (_CardsRegistered != value)
{
_CashRegistered = value;
PropertyHasChanged("CardsRegistered");
}
}

}
public float CashVariance
{

get { return _CashVariance; }
set
{
if (_CashVariance != value)
{
_CashVariance = value;
PropertyHasChanged("CashVariance");
}
}

}
public float CardVariance
{

get { return _CardVariance; }
set
{
if (_CardVariance != value)
{
_CardVariance = value;
PropertyHasChanged("CardVariance");
}
}

}
public int R200
{
get { return _R200; }
set
{
if (_R200 != value)
{
_R200 = value;
PropertyHasChanged("R200");
}
}
}
public int R100
{
get { return _R100; }
set
{
if (_R100 != value)
{
_R100 = value;
PropertyHasChanged("R100");
}
}
}
public int R50
{
get { return _R50; }
set
{
if (_R50 != value)
{
_R50 = value;
PropertyHasChanged("R50");
}
}
}
public int R20
{
get { return _R20; }
set
{
if (_R20 != value)
{
_R20 = value;
PropertyHasChanged("R20");
}
}
}
public int R10
{
get { return _R10; }
set
{
if (_R10 != value)
{
_R10 = value;
PropertyHasChanged("R10");
}
}
}
public int R5
{
get { return _R5; }
set
{
if (_R5 != value)
{
_R5 = value;
PropertyHasChanged("R5");
}
}
}
public int R2
{
get { return _R2; }
set
{
if (_R2 != value)
{
_R2 = value;
PropertyHasChanged("R2");
}
}
}
public int R1
{
get { return _R1; }
set
{
if (_R1 != value)
{
_R1 = value;
PropertyHasChanged("R1");
}
}
}
public int c50
{
get { return _c50; }
set
{
if (_c50 != value)
{
_c50 = value;
PropertyHasChanged("c50");
}
}
}
public int c20
{
get { return _c20; }
set
{
if (_c20 != value)
{
_c20 = value;
PropertyHasChanged("c20");
}
}
}
public int c10
{
get { return _c10; }
set
{
if (_c10 != value)
{
_c10 = value;
PropertyHasChanged("c10");
}
}
}
public int c1
{
get { return _c1; }
set
{
if (_c1 != value)
{
_c1 = value;
PropertyHasChanged("c1");
}
}
}
public int c5
{
get { return _c5; }
set
{
if (_c5 != value)
{
_c5 = value;
PropertyHasChanged("c5");
}
}
}
}

Answer

Your class should have a constructor if you want to use it with Class Var=new Class();
The constructor should be:

public DayEnd ()
    {
        //
        // TODO: Add constructor logic here
        //
    }
Comments