public ActionResult Edit(Guid RoleId, Models.aspnet_Roles collection) { try { int outputId = _dataobject.Update(collection); return(RedirectToAction(this.ActionReturn())); } catch (Exception ex) { Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex); return(PartialView(this._updateview, collection)); } }
public int Update(Models.aspnet_Roles data) { try { this.Validate(data); data.LoweredRoleName = data.RoleName.ToLower(); this._db.Entry(data).State = System.Data.Entity.EntityState.Modified; this._db.SaveChanges(); return(0); } catch (Exception) { throw; } }
public int Insert(Models.aspnet_Roles data) { try { var appobject = this._db.aspnet_Applications.Where(m => m.ApplicationName == System.Web.Security.Membership.ApplicationName).SingleOrDefault(); this.Validate(data); data.RoleId = Guid.NewGuid(); if (appobject != null) { data.ApplicationId = appobject.ApplicationId; } data.LoweredRoleName = data.RoleName.ToLower(); this._db.aspnet_Roles.Add(data); this._db.SaveChanges(); return(0); } catch (Exception) { throw; } }