Ejemplo n.º 1
0
        public ActionResult SaveUser3(String UserName, String Company, String Login, String Password, List <Address> UserAddresses)
        {
            MoreComplexUserDTO user = new MoreComplexUserDTO();

            user.UserName      = UserName; //Extract data from FormCollection by providing field 'name'
            user.Company       = Company;
            user.Login         = Login;
            user.Password      = Password;
            user.UserAddresses = UserAddresses;

            ViewBag.Msg = GetMessage(user);
            return(View("Create3"));
        }
Ejemplo n.º 2
0
        public ActionResult SaveUser2(FormCollection values)
        {
            MoreComplexUserDTO user = new MoreComplexUserDTO();

            user.UserName = values["UserName"]; //Extract data from FormCollection by providing field 'name'
            user.Company  = values["Company"];
            user.Login    = values["Login"];
            user.Password = values["Password"];

            user.UserAddresses = new List <Address>();

            /*-------------
             * Here we need some mechanism to parse complex objects arrays to load into our List
             * We can check every key and see which keys are of 'User Address' type
             */

            ViewBag.Msg = GetMessage(user);
            return(View("Create2"));
        }
Ejemplo n.º 3
0
 private String GetMessage(MoreComplexUserDTO user)
 {
     return(String.Format("UserName:'******',Company:'{1}',Login:'******',Password:'******'", user.UserName, user.Company, user.Login, user.Password));
 }
Ejemplo n.º 4
0
 public ActionResult SaveUser6(MoreComplexUserDTO user)
 {
     ViewBag.Msg = GetMessage(user);
     return(View("Create6"));
 }
Ejemplo n.º 5
0
 public ActionResult SaveUser5(MoreComplexUserDTO user, List <EducationInfo> Edu, List <String> hobbies)
 {
     ViewBag.Msg = GetMessage(user);
     return(View("Create5"));
 }