Best Way To Implement A Certain Part Of Model
Feb 13, 2011
I am trying to figure out the best way to implement a certain part of my model.I have an entity named Customer which has CustomerLocations (1-*) which have SalesOrders (1-*) which have Invoices (1-*).I want to allow them to have multiple addresses (Billing and Shipping) per customer and per location. I want to store those values in the sales orders and invoices, not a foreign key, what if they delete one of their addresses later down the road.I have tried complex types, but then they can't have multiple, can they? And having an Address entity, customer --> address (1-*) is ok, but a bit clumsy. How would you have a collection of billing and shipping addresses.?
View 1 Replies
ADVERTISEMENT
Feb 22, 2011
im making an application in vb.net (duh!) anyway i have created and coded the whole project and it performs exactly as i want it to (i dont need code help). my problem lies with the fact that my project is 2-3 parts
1.a setup form that gathers inital data about the enviroment stores this data encrypted in a config file. after inital setup this form is not displayed again. but needs to be run on both computers
2. the second form is the real application form im in the process of turning this part in to a background service anyway this form is the one that establishes the connection between two nodes it works correctly
3. the config files
anyway here is my problem i want to make this application distributional with just one file the (.exe) and have this .exe make everything else happen. it runs the setup form and creates the first config file which it does then it needs to produce a copy of just the second form and the config file to transfer to workstation #2 that will run independtly without the whole application which i cant make happen then it needs to turn both workstations application on by only starting one on either computer and invoke the other computer to start its corrosponding app also no idea how to make this happen any ideas or suggestions as to where to look to try to find my answers.im thinking i might need to make two seperate applications (a setup app, and the running app) and include them both in a project and use the setup.exe to to package them together this is a little side project that im making for my self to use to make programming a little easier so i plan on giving it out to some fellow students to test and tell me what they think so im not really worried about ease of use or complicated procedures yet but if it turns out to work and actually be of use to anyone else i would be willing to rewrite it to distribute to the masses but for now i just want it to work for me.
View 4 Replies
Jan 12, 2012
my requirement is that i have to count occurrence of a certain date and between two months
suppose i have 10-jan-2012 now i have a date range 1-jan-2012 between 1-feb-2013 my requirement is that if i find 10-jan between 1-jan-2012 between 1-feb-2013 irrespective of year i know that 10-jan will come twice between 1-jan-2012 between 1-feb-2013 i am not understanding how to do this.i meanto say that i have to compare only day and month part of the date which will solve my problem
View 1 Replies
May 21, 2009
in my text file i have two part. Called bottom and top. So i need to read the Top part first then and match the line with bottom part. Its like this
[Code]...
View 5 Replies
Sep 1, 2011
Assuming an architecture as such.MODEL > BLL > DLL
Trying to implement lazy loading in my MODEL I have run into a circular dependency between my MODEL and BLL..Basically imagine a property in my model that I want to implement as follows
Public Readonly Property ProjectCategory As ProjectCategory
Get
If Me._ProjectCategory Is Nothing Then
Me._ProjectCategory = ProjectCategoryBLL.GetProjectCategoryByID(Me._ProjectCategoryID)
End If
[Code]...
I have my MODEL, BLL and DLL in separate projects and because of the fact that my BLL references my model I can not reference my BLL from my model as this would create a circular dependency.
View 3 Replies
May 24, 2012
I'm quite new to MVC and while I've been trying to follow the best practices , I believe I may not be understanding certain fundamentals of either
-a. Using models and viewmodels appropriately
-b. Passing models into a controller for validation purposes.
The general purpose of my program is to select a stored procedure from a list of stored procedures, create a form where the user can fill out all the appropriate input variables, and then to execute that stored procedure. The tool is for non-technical people, so I'm eventually going to have to do a good deal of input validation.
As such I have four models: A Script Model, a Parameter Model, a Parameter Enum model and a Query Model, and two viewmodels: a paramviewmodel that generates the form to fill out, and a scriptviewmodel that creates a listbox filled with the possible script choices. I am using a prewritten database system to fill out my viewmodels in an init method in my controller (which I'm not sure is the proper way to do this?).
The viewmodels are as follows:
Imports System
Imports System.Collections.Generic
Public Class ScriptViewModel
[Code]....
I'm trying to work out the functionality. Also, I think this may be too much code in the view, even though most of it is display code.
Anyways, I have two main questions. One, does creating a model in my controller, calling an init method on it, and then passing it to the view make any sense in an mvc context (if not, how would I proceed?). Two, if I want to perform validation on the form I output in my htmlhelper, but I want to use my query model validation (and not my paramviewmodel), how can I do that? Most of the examples I've seen involve a controller that recieves an appropriate model variable, and the binding is performed outside the controller itself. They then just check modelstate. Is there any way I could do something similar here?
Edit: Is there any way I can make the syntax highlighting less crappy?
View 1 Replies
Mar 16, 2009
I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I use NHibernate to do the work on my business entities. For example:
[code]...
However, on my User class I have some properties and collections of other objects that ideally I'd like to be lazy loaded. But of course, the ISession is created and disposed within the repository, which I guess is why, outside of that, when I try to access those properties I get a "Could not initialize proxy - no Session" error.Is my only option then to disable lazy loading when using repositories? Or is it possible (or just foolish) to somehow get the session into scope in the business layer?I do like the repository model, and NHibernate is growing on me (after lots of initial frustration trying to make it work), so what's the best way you gurus have found of using them together?
View 1 Replies
Mar 27, 2010
Hey I am a newcomer to Visual Basic. I am using VB 2008 Express. My problem is I have a combo box filled with model #'s and I would like to have each model # correspond with a different id #, but I have no idea on how to do this, and I have found no documentation on it.
View 8 Replies
Jun 19, 2012
how to phrase my question, but what I am trying to do is inside a for each loop set the item of a model then set the value of that item.
dim td as new project.model.mymodel create model object
For each dr as datarow in dt.rows
dim itemName as string = convert.tostring(dr("Field"))
td.itemName = "6"
next
I keep getting an error that itemName is not part of collection td
View 2 Replies
Mar 29, 2012
I have a program that prints raw code to Zebra printers. We are adding some Intermec printers. So I would like to be able to pull the Model of the Printer (selected from a standard printer dialog) and use that to chose the code that would be sent to the printer.
View 8 Replies
Jan 31, 2009
how do I load a .x model from a folder and then show it in a box(a picturebox?) on a form?
I know it would use DirectX.
I've looked all over the place for how to do it but can't find any ways
View 2 Replies
Jan 10, 2009
My name is Mal, I live in Pelican Waters, Queensland, Australia.There is an application I'd like to build and I have been tossing up between a desktop and a web model. I have been studying PHP and Javascript for the past 2 years. I was studying VB a couple of years ago and have returned to it recently.
View 6 Replies
Feb 27, 2011
Is not the @Model MyModelClass notation not supported in VB Razor Views? It's not working for me. What is the construct for it?
View 1 Replies
Jul 12, 2010
I am new to .net, I am just taking a shot in the dark through this whole thing. I have an Addresses table with a StateID and CountryID field. They refer to the States and Countries table. I am using LINQ to SQL and Visual Studio 2010.
[Code]...
View 1 Replies
Dec 18, 2009
To make this easier I will use a concrete example using movies and genres. A genre can be associated with many movies. Genres can increase over time and so can movies.
The use case is as follows. The user wants to filter movies by selecting his/her desired genres.
So, I have a page where at the top there is a section where the user can pick any combination of genres to filter on using checkboxes. Below that is a list of movies that are in those genres.
In MVC I am trying to implement this using a ViewPage(of IDictionary(of Genre, Boolean)) where the boolean is whether or not a particular Genre has been selected for filtering.
I then go into loop that creates checkboxes for them to select:
<% for each genre As KeyValuePair(Of Genre, Boolean) in Model %>
<%=Html.Hidden("genre[" & i & "].Key", genre.Key.ID)%>
<%=Html.CheckBox("genre[" & i & "].Value", genre.Value)%>
[Code].....
I am aware this can be done using Ajax and I will most likely do it using Ajax but I would still like to know why this doesn't work.
View 1 Replies
Dec 1, 2011
I have a misunderstanding somewhere with the Entity Framework. This code is from my unit testing:
Public Sub UpdateRosterLinkTest()
Dim target As PlayerAdmin = New PlayerAdmin()
target.PlayerAdminManager = playerAdminTestManager
target.Team = playerAdminTestManager.GetAirForceMensBB()
[code]....
When I run this code, I can see the changes saved to the SQL Server this pulls from (RosterLink = Roster Link, like I set in the unit test).However, my unit test is failing, because team.RosterLink is still Nothing. The function GetAirForceMensBB() returns the Team with TeamId = 12434:
Function GetAirForceMensBB() As DAL.Team
Return (From team In Container.Teams Where team.TeamId = 12434).SingleOrDefault
End Function
I'm sure I'm using the entity framework incorrectly and it probably has something to do with the fact that I am calling the PlayerAdminTestManager in different places, but I don't understand why. Although, I set the PlayerAdminManager to be the PlayerAdminTestManager. PlayerAdminTestManager extends PlayerAdminManager, fyi.Why is team.RosterLink not showing the update from UpdateRosterLink?
EDIT:Container is my ObjectContext. This is how I access the information stored in the database.Container.Teams represents my Teams table.
View 1 Replies
Mar 29, 2012
fetching data from simulated model
View 1 Replies
Feb 6, 2012
I am using MS Visual Basic Express 2010 and trying to generate "ADO.Net Entity Framework" entities from an existing local SQL Server Express database.
Using the "Entity Data Model Wizard" I am asked to configure a connection. Here I prompted to choose a "Data source" and given two options 'Microsoft SQL Server Compact 3.5' and 'Microsoft SQL Server Database File'. I select the second option.
I'm then prompted for connection properties, I have to enter the "Database file name (new or existing)". Here I browse to the SQL server database file of interest (found using Management Studio Express) namely[code]...
View 7 Replies
Oct 26, 2009
I am in the process of using a two-dimensional array to find wind chill factors. My application uses a nudTemp for temperature and nudWind for Wind Velocity. When temp and wind are chosen from the nud list, it is supposed to display the wind chill temp in a text box and then display a message box. Right now it does everything it is supposed to do except that it does not display the proper wind chill factor.
I know it is an issue with my arrays so I was provided with an example but I don't know how to modify it so that it matches my code. I have added all of the array values but it is naming the array variables I am having issues with.
Sample code I was provided:
Private arr1 As Integer() = New Integer() {10, 20, 30}
Private arr2 As Integer() = New Integer() {100, 200, 300}
[CODE]...
I have provided my code as I have it thus far, listed below.
Option Strict On
Public Class frmWindChill
Dim intWindChill(7, 5) As Integer
[CODE]...
View 1 Replies
Mar 3, 2009
Anyway for my vb class we need to write an auto inquiry system. Im a total n00b and am struggling altogether. My interface is below Basically what my problem is (among others) is that I don't know how to assign prices to each model from the combo box. This is what I used to populate the two boxes:
[Code]...
View 9 Replies
Oct 18, 2009
How do I retrieve the computer model information?For example, I have a dell inspiron 1545. How do I retrieve that information in a label? I search a lot of WMI information but can't seem to find it. It SAYS 1545 on my system properties
View 5 Replies
Jan 7, 2009
i need mathematical calculation model code.
View 2 Replies
Apr 26, 2009
I am wondering what I am missing in the attached code that is making it impossible for me to make the VB.NET program below work using MVC (Model-View-Controller). Right now, I am really lost despite my best efforts...
I am trying to implement the observer pattern and think that my code is getting closer to MVC but not quite there yet, firstly because it wont even run ... nevertheless I know that there is someone out there who knows what I am doing wrong and I would definitely benefit from any guidance or help that someone more experienced in MVC VB.NET implementation can give .. hence this letter.
[Code]...
View 6 Replies
Jul 3, 2009
Does anyone have a good website for the basics of using Model View Control pattern with either vb.net or C#.
View 1 Replies
Sep 16, 2009
I'm looking for an open-source VB.NET app that demonstrates a lot of .NET's power, ideally something that works fully offline. Maybe some of you have encountered an amazing utility app on CodeProject?
View 1 Replies
Jul 27, 2011
I have a VB.NET 2010 solution, that contains 2 projects, a class library and a Windows Forms Application.The class library basically is a model, used for doing database integration. I currently have the connection string placed in the class library project settings, but they do not seem to be listed anywhere in the config file of the application. What's the best practice for retrieving the connection string in the class library? I don't want to use a singleton. Should it be stored in the application or class library?
View 2 Replies
May 18, 2009
I'm trying to avoid the use of magic strings as much as I can, but I can't find the correct syntax for VB to bind a single model like is shown in this c# example. (Currently the below says "expected end of statement" under the Model text).
<% Dim FormObject As Form = (Form)Model %>
A simple directcast was need
<% Dim FormObject As Form = DirectCast(Model, Form)%>
View 2 Replies
Mar 9, 2012
MVC 3, VB.NET, RAZOR app, using EF. I am having an issue in my post function with the database not updating at all... Using a break at db.savechanges() I look at the variable and all of the correct information is contained in the UpdateModel( ) part. But no dice the code executes and returns no errors so all looks fine but when I look at the database table it has not been changed at all, all of the old values are still present.. Function is as follows:
<AcceptVerbs(HttpVerbs.Post)>
Function EditCourse(ByVal _eCourse As cours) As ActionResult
Dim id As Integer = _eCourse.course_id
[Code]....
View 1 Replies
Sep 13, 2009
I'm kind of torn between these two error-handling models:Create a boolean Error and a string ErrorMessage property for your object. Catch all exceptions internally in the object's methods and pass the messages along using conditional logic from the caller, ie:
[Code]...
To me, it seems like the same amount of code either way, except that you have property code for the Error and ErrorMessage properties. However, you also can tell when an error occurs without having to check for exceptions. Which pattern should I go with?
View 6 Replies
Jul 7, 2011
am currently trying to do this in MVC3, VB.NET.
Consider the following model:
Public Class SampleData
Public Property PTY_1 as String
[code].....
View 2 Replies