public ActionResult createPost(HttpPostedFileBase image, string name, string username, string password, string view, string create, string delete, string edit, string accView, string accCreate, string accUpdate, string accDelete, FormCollection collection) { UserCrudServices services = new UserCrudServices(); string names = (string)Session["name"]; string usernames = (string)Session["username"]; if (services.checkUsername(username) == false && image != null && image.ContentLength > 0) { User user = new User(); if (services.Create(collection, image, user)) { foreach (var accName in serviceAccounts.allTransactionaccounts()) { if (Request.Form[accName.name] != null) { string value = Request.Form[accName.name]; Permission p = new Permission(); p.user_id = user.Id; p.account_Name = accName.name; p.urls = "N/A"; services.addPermission(p); } } services.save(); return(RedirectToAction("viewUsers")); } } return(RedirectToAction("Create")); }