public ActionResult InfosPlan(int id, string date) { planGeneratore plandGen = new planGeneratore(); DataTable dt = plandGen.getInfoPlanGenerale(id.ToString()); PlanInfoModel mode = new PlanInfoModel(); mode.PlanID = id.ToString(); mode.PlanDate = date.Replace('-', '/'); if (dt.Rows.Count > 0) { mode.PoidTotal = String.Format("{0:0.00}", dt.Rows[0]["TotalPoids"]); mode.Somme = String.Format("{0:0.00}", dt.Rows[0]["TotalEncaissement"]); mode.remarque = dt.Rows[0]["PlanInstruction"].ToString(); mode.ChauffeurCode = dt.Rows[0]["Chauffeur_ID"].ToString(); mode.CammionCode = dt.Rows[0]["Camion_ID"].ToString(); ViewData["requestAide"] = mode.listItemAideRequest(dt.Rows[0]["AIDES"].ToString()); mode.TextAidesRequest = dt.Rows[0]["AIDES"].ToString(); mode.Remorque = dt.Rows[0]["Remorque"].ToString(); mode.type_tournee = dt.Rows[0]["Type_tournees"].ToString(); } else { mode.PoidTotal = "-"; mode.Somme = "-"; mode.remarque = "-"; mode.ChauffeurCode = "NULL"; mode.CammionCode = "NULL"; ViewData["requestAide"] = new List <SelectListItem>(); mode.TextAidesRequest = ""; mode.Remorque = "0"; mode.type_tournee = "NULL"; } int codeCam = 0; try { codeCam = (mode.CammionCode != null) ? Int32.Parse(mode.CammionCode) : 0; } catch (Exception ex) { } if (codeCam != 0) { DataTable dtRel = Configs._query.executeProc("getRelations", "ID@int@" + codeCam); if (dtRel != null) { for (int i = 0; i < dtRel.Rows.Count; i++) { string namee = dtRel.Rows[i]["RessourceFamille"].ToString(); ViewData[namee] = dtRel.Rows[i]["RessEnfentID"].ToString(); } } } ViewData["lstChauffeur"] = Configs._query.executeProc("PRC_getDefFamiliesList", "ID@int@2"); ViewData["lstRemorque"] = Configs._query.executeProc("PRC_getDefFamiliesList", "ID@int@4"); return(View(mode)); }
public ActionResult InfosPlan(PlanInfoModel model) { if (model.TextAidesRequest == null) { model.TextAidesRequest = ""; } if (model.remarque != null) { model.remarque = model.remarque.Replace("'", "''"); } int result = majRdv.updateInfoPlanGeneral(model); return(RedirectToAction("InfosPlan", "RDV", new { id = model.PlanID, date = model.PlanDate })); }