Note that there are some explanatory texts on larger screens.

plurals
  1. POАltering database based on user id
    primarykey
    data
    text
    <p>Ok, I really looked, googled, this site, for a few days now, tried a bunch of different things, and I can't find an answer. I'm a real newbie, so please be patient with me. Thank you!</p> <p>so, i'm trying to create a web application that will display client information after purchase. I'm using VS2012 express and C#, and I decided to use MVC4, mostly because there was a tutorial on ASP.NET that came pretty close to what I was looking to do. Any comments on my choices is not requested but also not unwelcome.</p> <p>So the admin will enter all sales information at the end of each day. We record client phone numbers as account numbers in our sales protocol, so my thought was, to keep it simple, to just use the clients phone number as a login to the web application as well. Also, that way, when a client logs into the site to view the database, the database would filter automatically so that the particular client could only see their transactions. </p> <p>The tutorial I followed is <a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4" rel="nofollow">here</a>.</p> <p>I figured out that this is the point where the filter needs to be applied, but i'm having a lot of trouble doing so. The controller is named "MainController" The database is named "Main", table is "Mains" "AccountNumber" is the field in the db that should match the Current User Id</p> <pre><code>public ActionResult Index() { return View(db.Mains.ToList()); } </code></pre> <p>As I understand it, I have to place [InitializeSimpleMembership] above, then grab the UserId, then define it as the filter.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload