Friday, June 29, 2012
Thursday, June 14, 2012
Wednesday, June 13, 2012
How to add new tables to NOPCommerce
I spent plenty of time for delving into this problem' depths. I can summarize the solution as follows:
1. Create The Entity Class (e.g Entity.cs)
Path : Nop/Core/Domain/Entity.cs
2. Create The Mapping Class (e.g EntityMap.cs)
Path : Nop/Data/Mapping/EntityMap.cs
3. Create a Model for MVC (e.g EntityModel.cs)
Path : Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs
4. Create a validator for model (e.g EntityValidator.cs)
Path : Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs
5. Create A Mapping Configuration On AutoMapperStartupTask.cs for Entity and Model
Path : Nop/Admin/Infrastructure OR Nop/Web/Infrastructure
6. Apply Mapping between Model and Entity on MappingExtensions.cs
Path : Nop/Admin OR Nop/Web
7. Create a service class and service interface (e.g EntityService.cs , IEntityService.cs)
Path : Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs
8. Update DependencyRegistrar.cs
9. Finally Create Controller and View for given model
1. Create The Entity Class (e.g Entity.cs)
Path : Nop/Core/Domain/Entity.cs
2. Create The Mapping Class (e.g EntityMap.cs)
Path : Nop/Data/Mapping/EntityMap.cs
3. Create a Model for MVC (e.g EntityModel.cs)
Path : Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs
4. Create a validator for model (e.g EntityValidator.cs)
Path : Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs
5. Create A Mapping Configuration On AutoMapperStartupTask.cs for Entity and Model
Path : Nop/Admin/Infrastructure OR Nop/Web/Infrastructure
6. Apply Mapping between Model and Entity on MappingExtensions.cs
Path : Nop/Admin OR Nop/Web
7. Create a service class and service interface (e.g EntityService.cs , IEntityService.cs)
Path : Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs
8. Update DependencyRegistrar.cs
9. Finally Create Controller and View for given model
Thursday, May 24, 2012
Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)
I got this when i use linq query
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}
Friday, May 11, 2012
The data source does not support server-side data paging
You can't use an IQueryable object to data bind to a GridView and still use Paging and Sorting. You must return a List to the GridView using the ToList() method.
Thanks
Subscribe to:
Posts (Atom)
I Built a New Kind of Number Puzzle Game (And You Can Play It Free)
For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...
-
I have tried data-gramm="false" and hiding it through CSS, but neither of these solutions has worked. If anyone can resolve this i...
-
Microsoft Graph API provides powerful capabilities to interact with Microsoft 365 services. In this guide, we’ll explore how to create calen...
-
Microsoft Graph API is a powerful tool that allows developers to access a wide range of Microsoft 365 services, including Outlook and Calend...