internal bool UpdateRow(UserInfo uinfo, string doenten, string tdoente, string deslocCod, string numCons) { DALDeslocacoes infDAL = new DALDeslocacoes(); VwDeslocProd doente = infDAL.GetDeslocProdUser(tdoente, doenten, numCons); return(infDAL.InsertDeslocProd(PreencheTable(uinfo, doente.T_DOENTE, doente.DOENTE, doente.N_CONS, doente.T_EPISODIO, doente.EPISODIO, doente.PRODUTO, doente.COD_SERV_ORIG, deslocCod))); }
public bool LoadHistDesloc(string tdoente, string doente, string numCons) { try { DALDeslocacoes dal = new DALDeslocacoes(); List <VwDesloc> listItems = dal.GetHistDesloc(tdoente, doente, numCons); listDesloc = (from vw in listItems select new Deslocacao { T_EPISODIO = vw.T_EPISODIO, EPISODIO = vw.EPISODIO, DT_DESLOC = vw.DT_DESL, COD_SERV = vw.COD_SERV, DESCR_SERV = vw.DESCR_SERV, CONTACTO_SERV = vw.CONTACTO_SERV, NOME_USER = String.Format("{0} {1}", vw.TITULO, vw.NOME) }).ToList(); return(true); } catch (Exception e) { return(false); } }
internal bool UpdateRow(UserInfo uinfo, string itemRow, string deslocCod, string numCons) { DALDeslocacoes infDAL = new DALDeslocacoes(); VwDoentesPresentes doente; if (!String.IsNullOrEmpty(numCons)) { doente = infDAL.GetDeslocUserComNcons(itemRow.Split('_')[0], itemRow.Split('_')[1], numCons); } else { doente = infDAL.GetDeslocUser(itemRow.Split('_')[0], itemRow.Split('_')[1]); } TblDesloc tbl = new TblDesloc(); tbl.T_DOENTE = doente.T_DOENTE; tbl.DOENTE = doente.DOENTE; tbl.N_CONS = doente.N_CONS; tbl.T_EPISODIO = doente.T_EPISODIO; tbl.EPISODIO = doente.EPISODIO; tbl.COD_SERV = deslocCod; tbl.USER_CRI = uinfo.userID; tbl.DT_DESL = DateTime.Now; tbl.DT_CRI = DateTime.Now; bool res = infDAL.InsertDoenteDesloc(tbl); return(res); }
public ActionResult Index() { try { if (Session[Constants.SS_USER] != null) { DALDeslocacoes dal = new DALDeslocacoes(); PisosModel pisos = new PisosModel(); pisos.LoadPisos(); ValenciaModel valencias = new ValenciaModel(); valencias.LoadValenciasParametrizadas(uinfo.listValenciasParametrizadas); valencias.LoadValenciasParametrizadasProdutos(uinfo.listValenciasParametrizadas); valencias.LoadValencias(uinfo.listCodServ); Session["InfADValencias"] = valencias; Session["InfADPisos"] = pisos; ParameterModel paramProd = new ParameterModel(); paramProd.FillParameters(); paramProd.FillDestDoente(); paramProd.FillDestProd(); Session["InfADDeslocProd"] = paramProd; DeslocacoesModel infADTable = new DeslocacoesModel(); Tuple <DeslocacoesModel, ValenciaModel, ParameterModel, PisosModel> tp = new Tuple <DeslocacoesModel, ValenciaModel, ParameterModel, PisosModel>(infADTable, valencias, paramProd, pisos); return(View(tp)); } else { return(RedirectToAction("Index", "Home")); } } catch (Exception e) { return(View()); } }
internal bool AddNewRow(UserInfo uinfo, string tdoente, string doente, string ncons, string tEpis, string epis, string selProd, string selOrig, string selDest) { DALDeslocacoes infDAL = new DALDeslocacoes(); return(infDAL.InsertDeslocProd(PreencheTable(uinfo, tdoente, doente, ncons, tEpis, epis, selProd, selOrig, selDest))); }