示例#1
0
        protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
            Numeros num  = ControllerManager_Alt.Numeros.GetById(Convert.ToInt32(DropDownList3.SelectedValue));
            IList   list = PermissionManager.GetPermissionIdentifiers(num.GetType(), PermissionAction.Create);

            if (list != null)
            {
                GridView3.DataSource = list;
                GridView3.DataBind();
            }
        }
示例#2
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            Numeros num  = new Numeros();
            IList   list = PermissionManager.GetUsersForEntity(num, DropDownList2.SelectedItem.Text, PermissionAction.Create);

            if (list == null)
            {
                return;
            }
            GridView1.DataSource = list;
            GridView1.DataBind();
        }
示例#3
0
        protected void btnLista_Click(object sender, EventArgs e)
        {
            Numeros num = ControllerManager_Alt.Numeros.GetById(Convert.ToInt32(DropDownList3.SelectedValue));

            foreach (ListItem lip in ListBox1.Items)
            {
                if (lip.Selected)
                {
                    PermissionManager.AddEntityPermision(num.GetType(), DropDownList3.SelectedItem.Text, lip.Text);
                }
            }
        }
示例#4
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            if (!PermissionManager.Check(sender))
            {
                return;
            }

            Numeros num = new Numeros();

            if (PermissionManager.Check(num))
            {
                num.Num     = Convert.ToInt32(Label1.Text);
                Label4.Text = num.Num.ToString();
            }

            double primero   = Convert.ToDouble(Label1.Text);
            double segundo   = Convert.ToDouble(Label3.Text);
            double resultado = 0;

            switch (Label2.Text)
            {
            case "+":
                resultado = primero + segundo;
                break;

            case "-":
                resultado = primero - segundo;
                break;

            case "*":
                resultado = primero * segundo;
                break;

            case "/":
                resultado = primero / segundo;
                break;
            }
            if (!string.IsNullOrEmpty(txtresult.Text))
            {
                Label4.Text = txtresult.Text;
            }
            else
            {
                Label4.Text = resultado.ToString();
            }
        }
示例#5
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Numeros num = new Numeros();
            IList   list;

            if (!ControllerManager.EntityPermission.ListIdentifiers(num.GetType(), Membership.GetUser(DropDownList1.SelectedItem.Text).ProviderUserKey, (PermissionAction)3, out list))
            {
                if (list == null)
                {
                    return;
                }
                GridView1.DataSource = list;
                GridView1.DataBind();
            }
            else
            {
                GridView1.DataSource = PermissionManager.GetEntitysForAction(num.GetType(), PermissionAction.Create);
                GridView1.DataBind();
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Numeros num = new Numeros();
                DropDownList3.DataSource = PermissionManager.GetEntitysForAction(num.GetType(), PermissionAction.Create);
                DropDownList3.DataBind();

                DropDownList2.DataSource = PermissionManager.GetEntitysForAction(num.GetType(), PermissionAction.Create);
                DropDownList2.DataBind();

                ListBox1.DataSource     = MembershipManager.ListBySite();
                ListBox1.DataTextField  = "UserName";
                ListBox1.DataValueField = "ID";
                ListBox1.DataBind();

                DropDownList1.DataSource     = MembershipManager.ListBySite();
                DropDownList1.DataTextField  = "UserName";
                DropDownList1.DataValueField = "ID";
                DropDownList1.DataBind();
            }
        }