siddesh bobade

siddesh bobade

  • NA
  • 15
  • 9.3k

Not Being able to Access Class File

Mar 3 2015 12:53 AM
Hello guys,
I have Created a class Product.cs
namespace Products
{
public partial class Product
{
public Product()
{
//
// TODO: Add constructor logic here
//
}
#region Member variables
Guid m_Id = Guid.Empty;
string m_Name = null;
string m_Comment = null;
#endregion
#region Properties
public Guid PersonId
{
get
{
return m_Id;
}
}
public string Name
{
get
{
return m_Name;
}
set
{
m_Name = value;
}
}
public string Comment
{
get
{
return m_Comment;
}
set
{
m_Comment = value;
}
}
#endregion
#region Methods
public static Product[] GetAllProduct(DataTable datatable)
{
List<Product> prod = new List<Product>();
if (datatable != null && datatable.Rows.Count > 0)
{
foreach (DataRow datarow in datatable.Rows)
{
Product pro = new Product();
FillProductObject(datarow, pro);
prod.Add(pro);
}
}
return prod.ToArray();
}
public static void FillProductObject(DataRow dataRow, Product obj)
{
object value = null;
value = dataRow["ID"];
if (value != null)
{
obj.m_Id = (Guid)value;
}
value = dataRow["ProductName"];
if (value != null)
{
obj.m_Name = value.ToString();
}
value = dataRow["ProductComent"];
if (value != null)
{
obj.m_Comment = value.ToString();
}
}
#endregion
}
}
I want to access this class in my Default.aspx.cs which i m not being able to do so i tried most of the possible ways like  namespace and all so kindly help me with this issue asap.
 thanks
siddesh 
 

Answers (5)