public ActionResult EditSummit(ProposalModel proposal) { try { proposal.ContracEthereumProposal = ((ProposalModel)Session["Proposal"]).ContracEthereumProposal; proposal.QuestionType = ((ProposalModel)Session["Proposal"]).QuestionType; UserModel user = (UserModel)Session["User"]; using (ProposalDataAccess proposalDataAccess = new ProposalDataAccess()) { if (proposalDataAccess.UpdateProposal(proposal)) { ProposalFilter Filtro = new ProposalFilter(); Filtro.Email = user.Email; // Filtro.TypeVoting = 0; ProposalBussiness ProposalLogic = new ProposalBussiness(); List <ProposalModel> ListProposal = new List <ProposalModel>(); ListProposal = ProposalLogic.SearchProposalByUser(Filtro); ViewBag.Success = "Se modificó correctamente"; return(View("ProposalList", ListProposal)); } else { ProposalBussiness ProposalLogic = new ProposalBussiness(); ProposalModel Filtro = new ProposalModel(); Filtro.ContracEthereumProposal = proposal.ContracEthereumProposal; ProposalModel CurrentProposal = new ProposalModel(); CurrentProposal = ProposalLogic.SearchProposal(Filtro)[0]; ViewBag.SucceErrorss = "Se modificó correctamente"; return(View("Edit", CurrentProposal)); } } } catch { return(View("error")); } }
public ActionResult Edit(string ContracEthereumProposal) { try { ProposalBussiness ProposalLogic = new ProposalBussiness(); ProposalModel Filtro = new ProposalModel(); Filtro.ContracEthereumProposal = ContracEthereumProposal; ProposalModel CurrentProposal = new ProposalModel(); CurrentProposal = ProposalLogic.SearchProposal(Filtro)[0]; Session["Proposal"] = CurrentProposal; return(View(CurrentProposal)); } catch { return(View("error")); } }
public List <ProposalModel> SearchProposal(ProposalModel filter) { ProposalBussiness bussiness = new ProposalBussiness(); return(bussiness.SearchProposal(filter)); }