Exemplo n.º 1
0
        private void updategrid()
        {
            MembershipUser user = Membership.GetUser();
            string id = user.ProviderUserKey.ToString();
            Guid g = Guid.Parse(id);
            RoutesManager rm = new RoutesManager(g);
            rm.GetAllRoutes();
            List<Entities.Route> result;
            result = rm.GetAllRoutes();
            GridView1.DataSource = result;
            GridView1.DataBind();
            Label3.Visible = false;
            for (int i = 0, checkedCount = 0; i < GridView1.Rows.Count; i++)
            {
                CheckBox chb = (CheckBox)GridView1.Rows[i].Cells[0].Controls[1];
                if (chb.Checked)
                {
                    checkedCount++;

                    if (checkedCount < 2)
                    {
                        LinkButton1.Visible = false;
                        return;
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();
            string id = user.ProviderUserKey.ToString();
            Guid g = Guid.Parse(id);
            RoutesManager rm = new RoutesManager(g);
            rm.DeleteAllRoutes();

            rm.GetAllRoutes();
            List<Entities.Route> result;
            result = rm.GetAllRoutes();
            GridView1.DataSource = result;
            LinkButton1.Visible = false;
            GridView1.DataBind();
        }