public ActionResult Test() { UserModel Model = new UserModel(); // List<string> mylist = new List<string>({Id= "element1",Name= "element2" }); CommunityBL CommunityBL = new BL.BusinessLayer.CommunityBL(); Model.CommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId == 0).ToList(); Model.SubCommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId != 0).ToList(); return View(Model); }
public ActionResult Signup(UserModel model, FormCollection collection) { UserBL userBL = new UserBL(); UserBM userBM = new UserBM(); userBM.Name = model.Name; userBM.Email = model.Email; userBM.Password = model.Password; userBM.UserTypeId = Convert.ToInt32(collection["UserType"].ToString()); userBM.DOB = Convert.ToDateTime(model.DOB); userBM.Gender = collection["gender"].ToString(); userBM.Active = true; userBM.CommunityId = model.CommunityId; userBM.SubCommunityId = model.SubCommunityId; userBM.CountryId = model.CountryId; userBM.StateId = model.StateId; userBM.CityId = model.CityId; userBM.CommunityName = collection["hdCommunityName"].ToString(); userBM.SubCommunityName = collection["hdSubCommunityName"].ToString(); userBM.CreatedBy = 1; userBM.ModifiedBy = 1; userBM.CreationDate = DateTime.Now.Date; userBM.ModificationDate = DateTime.Now.Date; int userId = userBL.Create(userBM); FillUserGeneralInformation(userId); TempData[Message.Success] = "User Registered Successfully. Please Login."; // If we got this far, something failed, redisplay form return RedirectToAction("Login"); }