how to specify fluent api for newly created table in nopcommerce - nopcommerce

I want to display top 5 popular product on my home page.
i am trying to study the nopcommerce project.
so i have decided to make 1 table in which i will maintain this:
ProductMostViewed:
Id ProductId ProductViewcount
1 more thing i am not getting is can i directly create this table in sql server management studio??
here do i need to add category field or productid will do.
like for eg.Computer==>Desktop==>HP Pavilion Elite M9150F Desktop PC
so when any user will open any particular product detail page then i will increment in ProductViewcount.
but one thing i am not getting is where do i create this class file and where do i specify fluent api and is this appropriate solution for doing this task???
please guide me

May be this link can help you to fix out your issue.

Related

Creating user WantList and WantToSellList in Buddypress / Wordpress

I’m working on a site cataloging recording artists and their releases. It is hosted on Siteground and posted with Wordpress. It is a wordpress database.
We catalog records, all the way down to the specific version of each release (each version is a post). I'm currently using buddypress to create the user accounts and etc.
https://staging3.recordcollectorsoftheworldunite.com/release/like-a-virgin-3/
Here’s an example of a release page. Each version is uploaded as a post. Custom post type->album (is one example). Currently I have buttons (they don’t do anything) in each version’s foreach loop that say “WANT” “HAVE” “SELL”.
I want these buttons to add to the user's WantList, HaveList, and WantToSellList. These will be unique arrays for each user.
I'm thinking the best way would be to create new column in the album's entry in the database called this_user_wants_this, _has_this, _wants_to_sell_this, etc. That column would be a dynamic column that each user's profile would fill in? Each user would have an entirely different list of wants and haves and wants-to-sells.
Here’s what I want to do in English.
If user is logged in and presses the WANT button on this_post(), Change this post’s row “want_this_item” to ‘1’ for this_user only.
if “want_this_item” == 1, change “want_this_item” back to 0.
I don’t understand the language of what I would need to write out. How do I create the field for “want_this_item”, and then what code do I need to modify it?
I've tried creating an x_profile_field in buddypress, is there something to this? I still don't exactly understand how to modify that with the buttons.
Thanks so much!

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

pro asp.net 4.5 in c# book by adam freeman sportstore

just wondering did anybody complete the sport store application in this book, i am having a problem with the data binding in the orders page for the admin, i want to pull in the product id from the order lines table but i keep getting errors, it working correctly for the quantity but i can seem to get the product id to bind. i have tried the following code but this is not working for me at the moment
**<td><%# Item.OrderLines.Product_ProductID %></td>**
it says i am missing a definition in the orderline
First of all, OrderLines is of type List most likely. So the list doesn't have a definition of Product_ProductID. You should rather make a loop for Item.OrderLines and then you can access each order line of the order with its product. At second, take a look at your OrderLine model. Does it contain Product_ProductID? Most likely it has Product property
references to Product model which contains ProductID. So after all, your code would look like:
**<td><%# Item.OrderLines[i].Product.ProductID %></td>**

VB ASP.NET check if data is in table if yes, update, else insert

I have looked through the entire internet (well that's what it feels like) to find this out.
Tables - Authors and Titles
add new title must be linked to an author, so I need to check that the author exists, if so, update the titles table with the user data from the textboxes. If the author does not exist, I need to insert the author first & last name into the author table, then the title info into the title table.
this is in VB, using ASP.NET, and my database is a file, I'm not using SQL server, just Visual Studio 2008.
Many thanks in advance for any guidance
Dim insertParameters As New ListDictionary()
insertParameters.Add("ISBN", ISBNTextBox.Text)
insertParameters.Add("Title", titleTextBox.Text)
insertParameters.Add("EditionNumber", editionNumberTextBox.Text)
insertParameters.Add("Copyright", copyrightTextBox.Text)
insertParameters.Add("FirstName", firstTB.Text)
insertParameters.Add("Surname", secondTB.Text)
LinqDataSource1.Insert(insertParameters)
It sounds to me like you should take a step back to get the big picture. Here is a link to a video to get you started on LinqToSQL http://www.youtube.com/watch?v=zy4Y34brSC8&feature=related. The reason I say that is it appears as though you might be missing the fundamentals and trying to put the cart before the horse so to speak. And here is a link to the MS documentation which I believe should really help you in the long run http://msdn.microsoft.com/en-us/library/bb386976%28v=VS.90%29.aspx

Help learning asp.net

I am currently building an asp.net application. Its supposed to be pretty simple.
The problem is, I've only experience with asp.net mvc and for this app I'm limited to .net 2.0 so no mvc.
The only requirement is this.
I have a table of about 2000 records with these columns:
Id, Code1(unique), Code2(unique), Name, LastName, Email.
The table is already populated with Id, Code1, Code2.
Now, the idea is that when someone looks up their record (through Code1 or Code2) they are able to fill the rest of the fields (Name, LastName, Email).
So, search -> if no email, name, lastname set =>edit=>display
What do I need? please help.
I have tried Details View but Im not sure how to allow edit only if the email field is blank.
Do I need something else?
I think the easiest way to go is the following:
2 textboxes, 1 button (Search), 1 GridView, 1 SqlDataSource.
Gridview should be hooked up to SqlDataSource, which in turn should take 2 parameters (textbox values)
use textboxes for searching, on Search click, GridView.DataBind()
Make sure your SqlDataSource has the Update command specified
Check out ASP.NET Data tutorials for more info, got to Step 3 in this tutorial for GridView Updating help.
You'd be able to edit 1 record at a time, I wish I could give you more details on setting up the Gridview for automatic Updates, but it's been a while since I've worked with it (Google should help you with this though).

Resources