protected void AggiungiUtenteButton_Click(object sender, ImageClickEventArgs e) { try { if (Page.IsValid) { Utente utente = new Utente(); //Profilo profilo = new Profilo(); utente.Nome = txtNomeUtente.Text; utente.Cognome = txtCognomeUtente.Text; utente.Email = txtEmailUtente.Text; utente.UserID = txtUsernameUtente.Text; utente.IDProfilo = Convert.ToInt32(ddlProfiloUtente.SelectedItem.Value); //profilo.NomeProfilo = ddlProfiloUtente.SelectedItem.Text; utente.CodRuolo = txtCodiceRuolo.Enabled ? txtCodiceRuolo.Text : ""; Boolean esiste = proxyMtd.InsertUtente(utente); if (!esiste) { InitializeDatiUtente(); Response.Redirect("~/Utenti.aspx"); } else { PopupMessaggio.ShowMsgBox("Utente gia presente.", false); } } } catch (Exception ex) { PopupMessaggio.ShowMsgBox("Errore :" + ex.Message, true); } }
public string UpdateUtente(Utente obj) { Methods.UtenteMng utente = new Methods.UtenteMng(); return(utente.UpdateUtente(obj)); }
protected void ModicaUtenteButton_Click(object sender, ImageClickEventArgs e) { try { if (Page.IsValid) { Utente utente = new Utente(); utente.IDUtente = Convert.ToInt32(IDUtenteHiddenField.Value); utente.Nome = txtNomeUtente.Text; utente.Cognome = txtCognomeUtente.Text; utente.Email = txtEmailUtente.Text; utente.UserID = txtUsernameUtente.Text; utente.IDProfilo = Convert.ToInt32(ddlProfiloUtente.SelectedValue); utente.CodRuolo = txtCodiceRuolo.Enabled ? txtCodiceRuolo.Text : "" ; String error = proxyMtd.UpdateUtente(utente); if (error != String.Empty) { PopupMessaggio.ShowMsgBox("Utente non modificato", false); } else { InitializeDatiUtente(); Response.Redirect("~/Utenti.aspx"); } } } catch (Exception ex) { PopupMessaggio.ShowMsgBox(ex.Message, true); } }
public Boolean InsertUtente(Utente obj) { Methods.UtenteMng utente = new Methods.UtenteMng(); return(utente.InsertUtente(obj)); }