Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Dudes,

I am very very new to MVC . So only I struggling in Small Concept .. My question is I want to create a Customer Form . It contain 13 fields..

13 fields are

1)CustomerID,2)Customer Name,3)Management,4)No of Partners,Address Type(3 radio buttons),5) Street ,6)Location,8)Country,9)State,10)City,11)Phone No,12)Email,13)Website

I need to bring this all 13 Fields in Single Form.

I created the DB for this Form And its Fully Normalized and i used Primary key and References.My tables listed below.

My table are

**Customer**
CustomerID Primary key Uniqueidentifier not null,
Display Name Varchar(100) null,
Print Name Varchar(100) null,
Customer Type ID Uniqueidentifier null.

**CustomerType**
Customer TypeID Primary key Uniqueidentifier not null,
Display Name Varchar(100) null,,
PrintName Varchar(100) null,
UnderCustomerTypeID Uniqueidentifier null.

**Customer Address**
CustomerAddressID Primary key Uniqueidentifier not null,
CustomerID Uniqueidentifier null,
AddressID Uniqueidentifier null.

**Address**
AddressID Primary key Uniqueidentifier not null,
AddressTypeID Uniqueidentifier null,
DisplayName Varchar(100) null,
SalutationID Uniqueidentifier null,
PrintName Varchar(100) null,
SimpleMode bit null,
DetailMode bit null,
Street Varchar(100) null,
Location Varchar(100) null,
Place Varchar(100) null,
AreadID Uniqueidentifier null,
Pincode Varchar(100) null.

**Area**
AreaID Primary key Uniqueidentifier not null,
DisplayName Varchar(100) null,
PrintName Varchar(100) null,
CityID Uniqueidentifier null.

**Salutation**
SalutationID Primary key Uniqueidentifier not null,
DisplayName Varchar(100) null,
PrintName Varchar(100) null

**City**
CityID Primary key Uniqueidentifier not null,
DisplayName Varchar(100) null,
PrintName Varchar(100) null ,
StateID Uniqueidentifier null.

**State**
StateId Primary key Uniqueidentifier not null,
DisplayName Varchar(100) null ,
PrintName Varchar(100) null ,
CountryID Uniqueidentifier null.

**Country**

CountryID Primary key Uniqueidentifier not null,
DisplayName Varchar(100) null ,
PrintName Varchar(100) null.

Here CustomerType , Area, Salutation, City, State,Country all are Separate Forms I Just refer these Id's to Main Table.

First I connect the Database to Visual Studio 2012 Express for web. Then I connect the Edmx File . Then I Created the Model and ViewModel. Depend upon ViewModel I Created the Controller.
Now what i want is i need to create the Separate Form for that CustomerType , Area, Salutation, City, State,Country. And also i want to refer that ID in the Main Form. For that what shall I do. The Model and ViewModel which i had created is not Working..

please any one give me the Suggestion.

How To bring all these fields in Single Form and also have to do CRUD Operation.

When I click the Save Button It want to save the data in all Fields In that Tables

How to do this Using MVC 4 and I waiting for your reply dudes..

Thanks
Posted
Updated 4-Nov-15 2:12am
v2
Comments
Suvendu Shekhar Giri 3-Nov-15 1:06am    
It's better that you ask very specific question which can represent you problem and don't share all the code, we just need the code relevant to your problem.
Member 12087373 3-Nov-15 4:16am    
ok suvendu u don't consider the Code . I mentioned my table above and also the fields I need to bring in single Form and if it want to save the data in Mutiple table. For that what shall I do ?
Krunal Rohit 3-Nov-15 1:18am    
Post the relevant code and details. Try with debugger and narrow down your problem.

-KR
Member 12087373 3-Nov-15 4:16am    
ok KrunalRohit u don't consider the Code . I mentioned my table above and also the fields I need to bring in single Form and if it want to save the data in Mutiple table. For that what shall I do ?

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