public ActionResult CreateEdit(int IDModel) { DocModel form; if (IDModel != 0) { form = DocModelProvider.GetDocModel(IDModel); } else { form = new DocModel(); } ViewBag.Accounts = AccountProvider.GetAllAccounts(); ViewBag.campaigns = CampaignProvider.getListCampagne(0); return(View(form)); }
// GET: Model public ActionResult Index(DocModelApiPoco form) { List <DocModel> result = new List <DocModel>(); result = DocModelProvider.GetDocModels(form); //ViewBag.idAccount = form; List <Account> lstAccount = new List <Account>(); lstAccount.Add(new Account { IDAccount = 0, AccountName = "" }); lstAccount.AddRange(AccountProvider.GetAllAccounts()); ViewBag.Accounts = lstAccount; List <Campaign> lstCampaign = new List <Campaign>(); lstCampaign.Add(new Campaign { IDCampaign = 0, Title = "" }); lstCampaign.AddRange(CampaignProvider.getListCampagne(0)); ViewBag.campaigns = lstCampaign; return(View(result)); }