public ActionResult ModifierClient(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Client client = dal.ObtenirTousLesClients().FirstOrDefault(c => c.Id == id); if (client == null) { return(HttpNotFound()); } ClientModification client1 = new ClientModification() { Id = client.Id, Nom = client.Nom, Prenom = client.Prenom, Email = client.Email, ConfirmEmail = client.ConfirmEmail, Password = client.Password, Date_Naissance = client.Date_Naissance, Telephone = client.Telephone }; return(View(client1)); }
public ClientUpdateCommand(ClientModification modificationInstance) : base("ClientUpdate") { if (modificationInstance == null) { throw new ArgumentNullException(nameof(modificationInstance)); } modificationInstance.AddToCommand(this); }
public ClientEditCommand(uint clientId, ClientModification modificationInstance) : base("ClientEdit") { if (modificationInstance == null) { throw new ArgumentNullException(nameof(modificationInstance)); } AddParameter("clid", clientId); modificationInstance.AddToCommand(this); }
/// <summary> /// Sets one or more values concerning your own client, and makes them available to other clients through the server where applicable /// </summary> /// <param name="modificationInstance">The modifications as class</param> public SimpleResponse UpdateClient(ClientModification modificationInstance) { if (modificationInstance == null) { throw new ArgumentNullException("modificationInstance"); } Command command = SharedCommandName.ClientUpdate.CreateCommand(); modificationInstance.AddToCommand(command); return(ResponseBase <SimpleResponse> .Parse(SendCommand(command))); }
public ActionResult ModifierClient(ClientModification client) { if (ModelState.IsValid) { //dal.ModifierClient(client); dal.ModifierClient(client.Id, client.Nom, client.Prenom, client.Email, client.ConfirmEmail, client.Date_Naissance, client.Password, client.Telephone); return(RedirectToAction("Index")); } else { return(View(client)); } }