public ActionResult TalaoItens(TalaoItensModelView model) { if (ModelState.IsValid) { if (model.talaoitensid != 0) { //update //busca o ITempDataProvider completo TalaoItensModelView msalvo = new TalaoItensModelView(); msalvo = ServiceTalaoItens.GetTalaoItensId(model.talaoitensid); if (msalvo != null) { msalvo.obs = model.obs; msalvo.status = Convert.ToInt16(model.statusb); ServiceTalaoItens.UpdateTalaoItens(msalvo); return(Redirect(Domain.Util.config.UrlSite + "BookItens/TalaoItens/" + model.representanteid + "/" + model.talaoid)); } } } return(View(model)); }
public ActionResult TalaoItens(Int16 id = 0, Int16 id2 = 0, string id3 = "")//repreid, Talaoid, TalaoItensid { TalaoItensModelView model = new TalaoItensModelView(); if (!string.IsNullOrEmpty(id3) & id3 != "0") { model = ServiceTalaoItens.GetTalaoItensId(Convert.ToInt16(id3)); } if (id != 0 & id2 != 0) { model.Representantes = ServiceRepresentante.getRepresentante(id); model.TaloesItens = ServiceTalaoItens.GetTalaoItens(id2, id); model.TaloesItensStatus = ServiceTalaoItensStatus.getTalaoItensStatusCombo(); model.Taloes = ServiceTalao.getTalaoid(id2); } //pega o representante ViewBag.repre = getRepre(model.Representantes); //pega o Talao ini e final getIntervalo(model.Taloes); ViewBag.situacao = Domain.Util.valida.getSituacao(model.talaoitensstatusid); return(View(model)); }