Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Classes like this as shown below:
C#
public class HomeRoot
    {
        public int pID { set; get; }
        public string PName { set; get; }
        public int Pparent { set; get; }
        public List<HomeSubCat> HomeSubCatList { set; get; } 
        
    }
    public class HomeSubCat
    {
        public int sCatID { set; get; }
        public string sCatName { set; get; }
        public int sCatParent { set; get; }
        public List<HomeProduct> HomeProductlist { set; get; }
    }
    public class HomeProduct
    {
        public int PrId { set; get; }
        public int PrItemId { set; get; }
        public string PrName { set; get; }
        public string PrUrl { set; get; }
        public string Prcomp { set; get; }
        public string PrImage { set; get; }
        public decimal PrMrp { set; get; }
        public decimal PrSrate { set; get; }
    }

and Store procedure is like as shown below:
SQL
alter proc sp_aa_aspnetGetHometemp
as  
begin 
select  pCat.Id pID,pcat.Name PName,pcat.Parent_Id Pparent,sCat.Id sCatID,scat.Name sCatName,scat.Parent_Id sCatParent,p.Id PrId,p.ItemId PrItemId,p.Name PrName,p.FriendlyUrl PrUrl,p.Compname Prcomp,pImg.FileName PrImage,i.Mrp PrMrp,i.Srate PrSrate from tbl_aa_aspnet_Categories pCat 
inner join tbl_aa_aspnet_Categories sCat on(sCat.Parent_Id = pCat.Id and sCat.Id in (select top  4 id from tbl_aa_aspnet_Categories where Parent_Id=pCat.Id and ShowHome=1 and IsDelete=0))
inner join tbl_aa_aspnet_ProductAssociation PA on(PA.CategoryId=sCat.Id) 
inner join tbl_aa_aspnet_Product p on(p.Id=  PA.ProductId and p.ShowHome=1 ) 
inner join tbl_aa_aspnet_ProductImages pImg on(p.Id= pImg.ProductId and pImg.id=(select Top 1 id from tbl_aa_aspnet_ProductImages where IsDelete=0 and ProductId=p.Id ))
inner join item i on(p.ItemId=i.code)
where pCat.ShowHome=1 and pCat.IsDelete=0
order by pcat.Rank, sCat.Rank

end


I want to convert this store procedure data into my model using then i would be ableto display details on the front.
Please help.
Posted
Comments
F-ES Sitecore 19-Sep-15 9:37am    
Your question is basically "how do I write a website". Google for the "mvc nerd diner" and "mvc book store" tutorials, they will show you all the steps needed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900