public RoleAuthor InsertRoleAuthor(RoleAuthor model) { var data = _dapperHelper.Insert <RoleAuthor>("Insert into [RoleAuthor](RoleName,[AccessPages]) values" + " ('" + model.RoleName + "','" + model.AccessPages + "')", null, commandType: CommandType.Text); return(data); }
public IActionResult Create(RoleAuthorModel model) { try { RoleAuthor obj = new RoleAuthor(); obj.RoleName = model.RoleName; obj.AccessPages = model.AccessPages; var result = _roleAuthorService.InsertRoleAuthor(obj); TempData["SuccessMsg"] = "Data saved successfully"; } catch (Exception ex) { TempData["ErrorMsg"] = ex.Message; } return(RedirectToAction("Index")); }
public RoleAuthor UpdateRoleAuthor(RoleAuthor model) { var data = _dapperHelper.Update <RoleAuthor>("Update [RoleAuthor] set RoleName ='" + model.RoleName + "',[AccessPages]='" + model.AccessPages + "' where ID ='" + model.ID + "'", null, commandType: CommandType.Text); return(data); }