Exemple #1
0
    private void EditRole()
    {
        PrivRole byId = this.roleSer.GetById(this.roleId);

        byId.Name = this.txtName.Text.Trim();
        this.roleSer.Update(byId);
        base.RegisterScript("succeed();");
    }
Exemple #2
0
 private void InitPage()
 {
     if (this.action == "edit")
     {
         PrivRole byId = this.roleSer.GetById(this.roleId);
         this.txtName.Text = byId.Name;
     }
 }
Exemple #3
0
    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();");
    }
Exemple #4
0
    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();
    }