public ActionResult Create([Bind(Include = "Id,CountryName,Code,ISO2,ISO3,DateAdded,LastUpdated,Statusflag,Slug")] Country country) { if (ModelState.IsValid) { db.Countries.Add(country); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(country)); }
public ActionResult Create([Bind(Include = "Id,RegionName,RegionCode")] Region region) { if (ModelState.IsValid) { db.Regions.Add(region); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(region)); }
public ActionResult Create([Bind(Include = "Id,AppName,DateAdded,LastUpdated,Statusflag,Slug")] App app) { if (ModelState.IsValid) { db.Apps.Add(app); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(app)); }
public ActionResult Create([Bind(Include = "Id,UserGroupName,LoginType,DateAdded,LastUpdated,Statusflag,Slug")] UserGroup usergroup) { if (ModelState.IsValid) { db.UserGroups.Add(usergroup); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usergroup)); }
public ActionResult Create([Bind(Include = "Id,ProductGroupName,DateAdded,LastUpdated,Statusflag,Slug")] ProductGroup productgroup) { if (ModelState.IsValid) { db.ProductGroups.Add(productgroup); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(productgroup)); }
public ActionResult Create([Bind(Include = "Id,BranchName,BranchCode,AddressId,DateAdded,LastUpdated,Statusflag,Slug")] Branch branch) { if (ModelState.IsValid) { db.Branches.Add(branch); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AddressId = new SelectList(db.Addresses, "Id", "Slug", branch.AddressId); return(View(branch)); }
public ActionResult Create([Bind(Include = "Id,LocationName,LocationCode,RegionId,DateAdded,LastUpdated,Statusflag,Slug")] Location location) { if (ModelState.IsValid) { db.Locations.Add(location); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RegionId = new SelectList(db.Regions, "Id", "RegionName", location.RegionId); return(View(location)); }
public ActionResult Create([Bind(Include = "Id,ShortName,LongName,CountryId,DateAdded,LastUpdated,Statusflag,Slug")] City city) { if (ModelState.IsValid) { db.Cities.Add(city); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(db.Countries, "Id", "CountryName", city.CountryId); return(View(city)); }
public ActionResult Create([Bind(Include = "Id,RoleName,AppId,RoleValue,RoleDescr,DateAdded,LastUpdated,Statusflag,Slug")] Role role) { if (ModelState.IsValid) { db.Roles.Add(role); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AppId = new SelectList(db.Apps, "Id", "AppName", role.AppId); return(View(role)); }
public ActionResult Create([Bind(Include = "Id,FxnName,AppId,FxnGroup,FxnUrl,FxnFlag,FxnSort,FxnSecured,DateAdded,LastUpdated,Statusflag,Slug")] Fxn fxn) { if (ModelState.IsValid) { db.Fxns.Add(fxn); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AppId = new SelectList(db.Apps, "Id", "AppName", fxn.AppId); return(View(fxn)); }
public ActionResult Create([Bind(Include = "Id,Line1,Line2,Landmark,PostCode,CityId,DateAdded,LastUpdated,Statusflag,Slug")] Address address) { if (ModelState.IsValid) { db.Addresses.Add(address); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Cities, "Id", "ShortName", address.CityId); return(View(address)); }
public ActionResult Create([Bind(Include = "UserGroupId,RoleId,DateAdded,LastUpdated,Statusflag,Slug")] UserGroupRole usergrouprole) { if (ModelState.IsValid) { db.UserGroupRoles.Add(usergrouprole); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RoleId = new SelectList(db.Roles, "Id", "RoleName", usergrouprole.RoleId); ViewBag.UserGroupId = new SelectList(db.UserGroups, "Id", "UserGroupName", usergrouprole.UserGroupId); return(View(usergrouprole)); }
public ActionResult Create([Bind(Include = "Id,UserName,Pwd,Salt,Code,PwdExpire,LastName,FirstName,Email,Mobile,LocationId,UserGroupId,UserCode1,UserCode2,UserCode3,UserCode4,UserCode5,DateAdded,LastUpdated,Statusflag,Slug")] User user) { if (ModelState.IsValid) { user.Salt = GenUtil.RandomLower(15); user.Pwd = CryptUtil.Enkrypt(user.UserName + user.Pwd + user.Salt); user.Code = "0"; db.Users.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LocationId = new SelectList(db.Locations, "Id", "LocationName", user.LocationId); ViewBag.UserGroupId = new SelectList(db.UserGroups, "Id", "UserGroupName", user.UserGroupId); return(View(user)); }