protected void LoadDest() { try { List<CLIENTS_CONTACTS> lDest = new List<CLIENTS_CONTACTS>(); CLIENTS_CONTACTS curent = new CLIENTS_CONTACTS(); curent.ID_CONTACT = Convert.ToInt32(Session.GET_AND_DECRYPT(CYS_SESSION_TAGS.SESSION_LOGGED_S_IDCONTACT)); curent.NOM = Session.GET_AND_DECRYPT(CYS_SESSION_TAGS.SESSION_LOGGED_S_PRENOM).ToString() + " " + Session.GET_AND_DECRYPT(CYS_SESSION_TAGS.SESSION_LOGGED_S_NOM).ToString(); lDest.Add(curent); repDestinataire.DataSource = lDest; repDestinataire.DataBind(); ViewState["Destinataire"] = lDest; } catch (Exception ex) { throw new ApplicationException(String.Empty, ex); } }
protected void fermer_dest_Click(object sender, EventArgs e) { List<CLIENTS_CONTACTS> lDest = ViewState["Destinataire"] as List<CLIENTS_CONTACTS>; CLIENTS_CONTACTS add = new CLIENTS_CONTACTS(); add.ID_CONTACT = Convert.ToInt32(ComboDest.SelectedItem.Value); add.NOM = ComboDest.SelectedItem.Text; lDest.Add(add); repDestinataire.DataSource = lDest; repDestinataire.DataBind(); ViewState["Destinataire"] = lDest; ComboDest.Items.Remove(ComboDest.SelectedItem); ComboDest.DataBind(); }
protected void valider_dest_Click(object sender, EventArgs e) { List<CLIENTS_CONTACTS> lDest = ViewState["Destinataire"] as List<CLIENTS_CONTACTS>; CLIENTS_CONTACTS add = new CLIENTS_CONTACTS(); if (ID_PROJET_EDIT.Value == string.Empty) { add.ID_CONTACT = Convert.ToInt32(ComboDest.SelectedItem.Value); add.NOM = ComboDest.SelectedItem.Text; lDest.Add(add); repDestinataire.DataSource = lDest; repDestinataire.DataBind(); ViewState["Destinataire"] = lDest; ComboDest.Items.Remove(ComboDest.SelectedItem); ComboDest.DataBind(); } else { add.ID_CONTACT = Convert.ToInt32(ComboDest.SelectedItem.Value); add.NOM = ComboDest.SelectedItem.Text; lDest.Add(add); RepeaterDestinataireEdit.DataSource = lDest; RepeaterDestinataireEdit.DataBind(); ViewState["Destinataire"] = lDest; ComboDest.Items.Remove(ComboDest.SelectedItem); ComboDest.DataBind(); CYS_UTIL.ExecuteScriptInUpdatePanel(updatepanel_projet_edit, "showMod('#modal_projet_general_edit');"); } }