private void EditRole() { PrivRole byId = this.roleSer.GetById(this.roleId); byId.Name = this.txtName.Text.Trim(); this.roleSer.Update(byId); base.RegisterScript("succeed();"); }
private void InitPage() { if (this.action == "edit") { PrivRole byId = this.roleSer.GetById(this.roleId); this.txtName.Text = byId.Name; } }
private void AddRole() { PrivRole privRole = new PrivRole(); privRole.Id = Guid.NewGuid().ToString(); privRole.Name = this.txtName.Text.Trim(); privRole.No = this.roleSer.GetNextNo(); this.roleSer.Add(privRole); base.RegisterScript("succeed();"); }
protected void btnDelete_Click(object sender, EventArgs e) { List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldRoleId.Value); foreach (string current in listFromJson) { PrivRole byId = this.roleSer.GetById(current); if (byId != null) { this.roleSer.Delete(byId); } } this.InitPage(); }