public ActionResult AddUsers() { LoginRepo Lr1 = new LoginRepo(); ProfileModel model1 = Lr1.dropdownrepo1(); try { LoginRepo Lr = new LoginRepo(); ProfileModel model = Lr.dropdownrepo1(); return(View(model)); } catch (SqlException) { ViewData["Errormessage"] = "Please Enter All The Data."; return(View(model1)); } }
public ActionResult AddUsers(ProfileModel model, FormCollection form) { LoginRepo Lr1 = new LoginRepo(); ProfileModel model1 = Lr1.dropdownrepo1(); try { LoginRepo Lr = new LoginRepo(); ProfileModel model2 = Lr.dropdownrepo1(); if (Lr.AddUsersrepo(model, form)) { ViewData["Successmessage"] = "Registered successfully."; } return(View(model2)); } catch (SqlException) { ViewData["Errormessage"] = "This Email Address is Already taken."; return(View(model1)); } }