none
Special SP that can't be map MVC Model View RRS feed

  • Question

  • Hi,

    I have a special SP that I can't map to any table in my MVC Model to create a controller and views.

    My question is how can I get my SP using Entity Framework for my MVC project that I can create a Controllers and view?

    Here is my Log Table:

    USE [CARD]
    GO
    
    SELECT [LOGID]
          ,[LogCard]
          ,[LogPosSerial]
          ,[LogResult]
          ,[LogDate]
          ,[LogTime]
          ,[LogPosLocation]
          ,[LogAmount]
      FROM [dbo].[LOG]
    GO
    
    
    

    And here is my SP:

    USE [CARD]
    GO
    
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    
     CREATEProcedure [dbo].[GetCARDLogByDT]
    (     
        @DateStart Date,
    	@DateFinished Date,
    	@LogId int output,
    	@CARDNo nvarchar(16) output, 
    	@PosSerial nvarchar(10)output,
    	@ResultDescription nvarchar(15)output,
    	@LocationName nvarchar(50) output,
    	@LogAmount nvarchar(50) output
    )
    AS 
    BEGIN
    
    SELECT [dbo].[LOG].[LOGID]
          ,[dbo].CARDNOLIST.CARDNo
          ,[dbo].POS.PosSerial,
    	  CASE
    		WHEN [dbo].[LOG].[LogResult] = 0 THEN 'Hizmet alamaz.'
    		ELSE [dbo].RESULTLIST.ResultDescription
    	  END AS ResultDescription
          ,[LogDate]
          ,[LogTime]
          ,[dbo].LOCATION.LocationName,
    	  CASE
    		WHEN [dbo].[LOG].LogAmount = 0 THEN 0
    		ELSE PaymentAmount
    	  END AS LogAmount
      FROM [dbo].[LOG] 
      LEFT JOIN
    	dbo.CARDNOLIST 
    		ON [dbo].[LOG].LogCARD=dbo.CARDNOLIST.ENOID
    	LEFT JOIN dbo.POS
    		ON [dbo].[LOG].LogPosSerial=dbo.POS.POSID
    	LEFT JOIN dbo.RESULTLIST
    		ON [dbo].[LOG].LogResult=dbo.RESULTLIST.RESID
    	LEFT JOIN dbo.LOCATION
    		ON [dbo].[LOG].LogPosLocation=dbo.LOCATION.LOCID
    	LEFT JOIN dbo.PAYMENT
    		ON [dbo].[LOG].LogPosLocation=PaymentLocation
    	WHERE [LogDate] BETWEEN @DateStart AND @DateFinished
    END
    

    Friday, March 4, 2016 2:43 PM

Answers

All replies