Exemple #1
0
    public DataTable DgBind()
    {
        DataTable table = null;
        string    key   = this.txtRoleName.Text;

        table = RoleOperator.Search(key);
        return(table);
    }
Exemple #2
0
 protected void dgSites_ItemCommand1(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         int id = Convert.ToInt32(e.CommandArgument);
         RoleOperator.Delete(id);
         WebTools.Alert(this, "删除成功!");
         // this.SimplePager1.Changed = true;
     }
     else if (e.CommandName == "Detail")
     {
         int id = Convert.ToInt32(e.CommandArgument);
         this.Pop(id);
     }
 }
Exemple #3
0
        protected void tvUser_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
        {
            var user  = this.RoleService.FindById(int.Parse(e.Node.Value));
            var model = this.CurrentRole;
            var opr   = this.RolePlugService.FindRoleOperatorById(model.Id, user.Id);

            if (opr != null)
            {
                opr.Deleted    = !e.Node.Checked;
                opr.ModifyTime = DateTime.Now;
                this.RolePlugService.Update(opr);
            }
            else if (e.Node.Checked)
            {
                opr       = new RoleOperator();
                opr.Optor = this.CurrentOperatorUser;
                opr.Role  = model;
                opr.User  = user;

                this.RolePlugService.Save(opr);
            }
        }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         RoleOperator.Bind(this.cbRoleIdValue);
         DepartMentOperator.Bind(this.cbDepIdValue);
         if (Request.Params["id"] != null)
         {
             UserObject dep = SimpleOrmOperator.Query <UserObject>(Convert.ToInt32(Request.Params["id"]));
             WebFormHelper.SetDataToForm(this, dep);
             string[] ips = dep.BeginIp.Split('.');
             this.txtBeginIp1.Text = ips[0].ToString();
             this.txtBeginIp2.Text = ips[1].ToString();
             this.txtBeginIp3.Text = ips[2].ToString();
             this.txtBeginIp4.Text = ips[3].ToString();
             ips = dep.EndIp.Split('.');
             this.txtEndIp1.Text = ips[0].ToString();
             this.txtEndIp2.Text = ips[1].ToString();
             this.txtEndIp3.Text = ips[2].ToString();
             this.txtEndIp4.Text = ips[3].ToString();
         }
     }
 }