Exemplo n.º 1
0
        private void PopupElimina_EliminaButtonClicked(object sender, EventArgs e)
        {
            try
            {
                Boolean attivo = false;
                string  IDUtenteSelezionato = null;

                foreach (GridViewRow row in gvUtenti.Rows)
                {
                    CheckBox chkSelected = (CheckBox)row.FindControl("cbSelected");
                    if (chkSelected.Checked)
                    {
                        attivo = ((CheckBox)row.FindControl("Attivo")).Checked;
                        IDUtenteSelezionato = chkSelected.Attributes["key"];
                    }
                }

                int IDUtente = Convert.ToInt32(Session["IDUtente"].ToString());
                AnagraficaDealerService proxyMtd = new AnagraficaDealerService();
                proxyMtd.DeleteUtente(IDUtente);
                Session.Remove("IDUtente");
                GestioneUtentiSubMenuControl.enableBtnModifica(false);
                GestioneUtentiSubMenuControl.enableBtnElimina(false);

                PopupElimina.Hide();

                gvUtenti.DataSource = proxyMtd.GetAllUtenti();
                gvUtenti.DataBind();
                utenteUpdatePanel.Update();
            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }
Exemplo n.º 2
0
        private void PopupElimina_EliminaButtonClicked(object sender, EventArgs e)
        {
            try
            {
                Boolean attivo = false;
                string IDUtenteSelezionato = null;

                foreach (GridViewRow row in gvUtenti.Rows)
                {
                    CheckBox chkSelected = (CheckBox)row.FindControl("cbSelected");
                    if (chkSelected.Checked)
                    {
                        attivo = ((CheckBox)row.FindControl("Attivo")).Checked;
                        IDUtenteSelezionato = chkSelected.Attributes["key"];
                    }
                }

                int IDUtente = Convert.ToInt32(Session["IDUtente"].ToString());
                AnagraficaDealerService proxyMtd = new AnagraficaDealerService();
                proxyMtd.DeleteUtente(IDUtente);
                Session.Remove("IDUtente");
                GestioneUtentiSubMenuControl.enableBtnModifica(false);
                GestioneUtentiSubMenuControl.enableBtnElimina(false);

                PopupElimina.Hide();

                gvUtenti.DataSource = proxyMtd.GetAllUtenti();
                gvUtenti.DataBind();
                utenteUpdatePanel.Update();
            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }