public ActionResult Update(TAREA dto) { NegocioTarea obj = new NegocioTarea(); obj.Update(dto); return(RedirectToAction("Read")); }
public ActionResult TareaCreate([Bind(Include = "id_tarea,Enunciado,Entrega,Ponderacion,curso")] TAREA tAREA) { try { if (ModelState.IsValid) { using (Sistema_estudiosEntities db = new Sistema_estudiosEntities()) { db.Database.ExecuteSqlCommand("INSERTAR_TAREA @enunciado,@entrega,@curso,@ponderacion", new SqlParameter("@enunciado", tAREA.Enunciado), new SqlParameter("@entrega", tAREA.Entrega), new SqlParameter("@curso", tAREA.curso), new SqlParameter("@ponderacion", tAREA.ponderacion) ); } return(RedirectToAction("TareaIndex")); } } catch (Exception ex) { throw new Exception(ex.Message); } ViewBag.curso = new SelectList(db.CURSOes, "id_curso", "nombre", tAREA.curso); return(View(tAREA)); }
public IHttpActionResult PutTAREA(int id, TAREA tAREA) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tAREA.ID_T) { return(BadRequest()); } var tar = db.SPA_UPDATETARE(tAREA.ID_T, tAREA.DESCRIPCION); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TAREAExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostTAREA(TAREA tAREA) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var tar = db.SPA_INSERTTAREA(tAREA.DESCRIPCION, tAREA.ID_P); return(CreatedAtRoute("DefaultApi", new { id = tAREA.ID_T }, tAREA)); }
public IHttpActionResult GetTAREA(int id) { TAREA tAREA = db.TAREA.Find(id); if (tAREA == null) { return(NotFound()); } return(Ok(tAREA)); }
public IHttpActionResult DeleteTAREA(int id) { TAREA tAREA = db.TAREA.Find(id); if (tAREA == null) { return(NotFound()); } var tar = db.SPA_DELETETAREA(id); return(Ok(tAREA)); }
// pagina qye muestra el detalle actual de la tarea que se selecione // GET: Tarea/Details/5 public ActionResult TareaDetails(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TAREA tAREA = db.TAREAs.Find(id); if (tAREA == null) { return(HttpNotFound()); } return(View(tAREA)); }
internal List <TAREA> GetTareas() { IDataReader dr = null; List <TAREA> oLista = new List <TAREA>(); try { SqlParameter[] dbparams = new SqlParameter[0] { }; dr = cDblib.DataReader("SUP_CARGAFICHEROIAP_VALIDAR_TAREAS", dbparams); while (dr.Read()) { TAREA oT = new TAREA((int)dr["t332_idtarea"], dr["t332_destarea"].ToString(), (int)dr["t331_idpt"], byte.Parse(dr["t332_estado"].ToString()), double.Parse(dr["t332_cle"].ToString()), dr["t332_tipocle"].ToString(), (dr["t332_impiap"].ToString() == "1") ? true : false, (int)dr["t305_idproyectosubnodo"], (dr["t332_fiv"].ToString() == "") ? null : (DateTime?)DateTime.Parse(dr["t332_fiv"].ToString()), (dr["t332_ffv"].ToString() == "") ? null : (DateTime?)DateTime.Parse(dr["t332_ffv"].ToString()), (bool)dr["t323_regjornocompleta"], (bool)dr["t331_obligaest"], byte.Parse(dr["t331_estado"].ToString()), (bool)dr["t323_regfes"], dr["t301_estado"].ToString() ); oLista.Add(oT); } return(oLista); } catch (Exception ex) { throw ex; } finally { if (dr != null) { if (!dr.IsClosed) { dr.Close(); } dr.Dispose(); } } }
// metodo get de la pagina inicial al cargar la tarea public ActionResult CargarTarea(int?id) { Session["Usuario"] = 2;// solo para pruebas if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TAREA tAREA = db.TAREAs.Find(id); if (tAREA == null) { return(HttpNotFound()); } return(View(tAREA)); }
public ActionResult Insert(FormCollection fc) { TAREA dto = new TAREA(); dto.NOMBRETAREA = fc["NOMBRETAREA"]; dto.RUT_USU = Convert.ToInt32(Session["rut"]); dto.ESTADO_TAREA = Convert.ToInt32(fc["ESTADO_TAREA"]); dto.RUT_EM = Convert.ToInt32(Session["rutempresa"]); NegocioTarea tar = new NegocioTarea(); tar.Insert(dto); // return View("Insert", obj); return(RedirectToAction("Read")); }
public ActionResult CargarTarea(HttpPostedFileBase fileTarea, int?id) { CargaArchivo modeloArchivo = new CargaArchivo(); if (fileTarea != null) { var id_usuario = Session["Usuario"]; try { if (id_usuario != null && id != null) { using (Sistema_estudiosEntities db = new Sistema_estudiosEntities()) { db.Database.ExecuteSqlCommand("INSERTAR_NOTA_TAREA @estudiante,@tarea", new SqlParameter("@estudiante", int.Parse(id_usuario.ToString())), new SqlParameter("@tarea", id) ); } string ruta = CrearCarpetaTarea(id); ruta += fileTarea.FileName; modeloArchivo.subirArchivo(ruta, fileTarea); ViewBag.Error = modeloArchivo.Error; ViewBag.Confirmacion = modeloArchivo.Confirmacion; } } catch { ViewBag.Error = "La tarea ya fue entregada"; } } else { ViewBag.Error = "No se ha cargado ningun archivo"; } if (id != null) { TAREA tAREA = db.TAREAs.Find(id); if (tAREA != null) { return(View(tAREA)); } } return(RedirectToAction("CargarTarea")); }
protected string CargarEspecialistasSeleccionados(int intIdTarea) { try { dr = null; dr = TAREA.LeerTecnicosTarea(intIdTarea); int i = 0; System.Text.StringBuilder strBuilderEspecialistasSel = new System.Text.StringBuilder(); strBuilderEspecialistasSel.Append("<table id='tblSeleccionados' style='width: 390px'>" + (char)13); strBuilderEspecialistasSel.Append("<colgroup><col style='width:100%' /></colgroup>"); while (dr.Read()) { hdnCorreoEspecialistaIn.Text += dr["T001_IDFICEPI"].ToString() + "/" + dr["T001_CODRED"].ToString() + ','; if (dr["T001_IDFICEPI"].ToString() == Session["IDFICEPI"].ToString()) { hdnEsTecnico.Text = "true"; } strBuilderEspecialistasSel.Append("<tr id='" + dr["T001_IDFICEPI"].ToString() + "/" + dr["T001_CODRED"].ToString() + "' "); //if (i % 2 == 0) // strBuilderEspecialistasSel.Append("class='FA' "); //else // strBuilderEspecialistasSel.Append("class='FB' "); i++; strBuilderEspecialistasSel.Append(" onclick=mm(event); "); strBuilderEspecialistasSel.Append(" ondblclick=this.className='FS';quitarSeleccionados(); "); strBuilderEspecialistasSel.Append(" style='cursor: pointer;height:14px'><td> " + dr["TECNICO"].ToString()); strBuilderEspecialistasSel.Append("</td></tr>" + (char)13); } dr.Close(); dr.Dispose(); strBuilderEspecialistasSel.Append("</table>"); return(strBuilderEspecialistasSel.ToString()); } catch (System.Exception objError) { return("N@@" + Errores.mostrarError("Error al leer catálogo de recursos.", objError)); } }
public ActionResult Comentar(FormCollection fc) { TAREA dto = new TAREA(); dto.IDTAREA = Convert.ToInt32(fc["IDTAREA"]); dto.RUT_USU = Convert.ToInt32(Session["rut"]); dto.RUT_EM = Convert.ToInt32(Session["rutempresa"]); dto.MENSAJE = Convert.ToString(fc["MENSAJE"]); DaoTarea dt = new DaoTarea(); try { dt.InsertMessage(dto); } catch (Exception ex) { new Exception("ERROR EN COMENTAR" + ex.Message); } // return View("Insert", obj); return(Redirect(Request.UrlReferrer.PathAndQuery)); }
private string CrearCarpetaTarea(int?id) { string path = Server.MapPath("~/Temp/"); try { TAREA Tar = db.TAREAs.Find(id); USUARIO Usu = db.USUARIOs.Find(Session["Usuario"]); path += Tar.CURSO1.nombre + "/" + Usu.nick; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } path += "/"; return(path); } catch { return(Server.MapPath("~/Temp/")); } }
public ActionResult Update(int IDTAREA) { NegocioTarea obj = new NegocioTarea(); TAREA aux = obj.Read().FirstOrDefault(a => a.IDTAREA == IDTAREA); ViewBag.Estado = aux.ESTADO_TAREA; ViewBag.Usuario = aux.RUT_USU; DataAcces.DaoEmpresa de = new DataAcces.DaoEmpresa(); DataAcces.DaoTarea dt = new DataAcces.DaoTarea(); try { int rut_empresa = Convert.ToInt32(Session["rutempresa"]); List <estado> list = de.ObtenerEstadoUsuario(); List <TAREA> list3 = dt.ObtenerPosts(aux.IDTAREA); ViewBag.EstadosTarea = list; ViewBag.ListaPosts = list3; } catch (Exception ex) { new Exception("ERROR EN METODO LISTAR" + ex.Message); } return(View("Update", aux)); }
public string Update(TAREA dto) { DaoTarea dao = new DaoTarea(); return(dao.Update(dto)); }
public string Insert(TAREA dto) { DaoTarea dao = new DaoTarea(); return(dao.Insert(dto)); }
private string VolcarTareas() { try { System.Text.StringBuilder sb = new System.Text.StringBuilder(); System.Text.StringBuilder sbl = new System.Text.StringBuilder(); string strTramitadas; string strPdteAclara; string strAclaRta; string strAceptadas; string strRechazadas; string strEnEstudio; string strPdtesDeResolucion; string strPdtesDeAcepPpta; string strEnResolucion; string strResueltas; string strNoAprobadas; if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkTramitadas"]).ToString())) { strTramitadas = "1"; } else { strTramitadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdteAclara"]).ToString())) { strPdteAclara = "1"; } else { strPdteAclara = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkAclaRta"]).ToString())) { strAclaRta = "1"; } else { strAclaRta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkAceptadas"]).ToString())) { strAceptadas = "1"; } else { strAceptadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkRechazadas"]).ToString())) { strRechazadas = "1"; } else { strRechazadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkEnEstudio"]).ToString())) { strEnEstudio = "1"; } else { strEnEstudio = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdtesDeResolucion"]).ToString())) { strPdtesDeResolucion = "1"; } else { strPdtesDeResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdtesDeAcepPpta"]).ToString())) { strPdtesDeAcepPpta = "1"; } else { strPdtesDeAcepPpta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkEnResolucion"]).ToString())) { strEnResolucion = "1"; } else { strEnResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkResueltas"]).ToString())) { strResueltas = "1"; } else { strResueltas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkNoAprobadas"]).ToString())) { strNoAprobadas = "1"; } else { strNoAprobadas = "0"; } //SqlDataReader drTec = null; dr = null; dr = TAREA.Volcar ( short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["rdlOpciones"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnIDArea"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnDeficiencia"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnCoordinador"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnEspecialista"]).ToString()), short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["cboSituacion"]).ToString()), short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["cboRtado"]).ToString()), (((Hashtable)Session["PANT_AVANZADO_TAR"])["txtFechaInicio"]).ToString(), (((Hashtable)Session["PANT_AVANZADO_TAR"])["txtFechaFin"]).ToString(), strTramitadas, strPdteAclara, strAclaRta, strAceptadas, strRechazadas, strEnEstudio, strPdtesDeResolucion, strPdtesDeAcepPpta, strEnResolucion, strResueltas, strNoAprobadas, int.Parse(Session["IDFICEPI"].ToString()), Session["ADMIN"].ToString() ); sb.Append("<table style='font-family:Arial;font-size:8pt;' cellSpacing='2' border=1>"); sb.Append(" <tr align=center style='background-color: #BCD4DF;'>"); sb.Append(" <td style='width:auto;'>Area</td>"); sb.Append(" <td style='width:auto;'>Orden</td>"); sb.Append(" <td style='width:auto;'>Id.Orden</td>"); sb.Append(" <td style='width:auto;'>Tarea</td>"); sb.Append(" <td style='width:auto;'>Id.Tarea</td>"); sb.Append(" <td style='width:auto;'>Fec.In.Prev</td>"); sb.Append(" <td style='width:auto;'>Fec.Fin.Prev</td>"); sb.Append(" <td style='width:auto;'>Fec.In.Real</td>"); sb.Append(" <td style='width:auto;'>Fec.Fin.Real</td>"); sb.Append(" <td style='width:auto;'>Resultado</td>"); sb.Append(" <td style='width:auto;'>Descripcion</td>"); sb.Append(" <td style='width:auto;'>Avance</td>"); sb.Append(" <td style='width:auto;'>Causas</td>"); sb.Append(" <td style='width:auto;'>Intervenciones</td>"); sb.Append(" <td style='width:auto;'>Consideraciones/Comentarios</td>"); sb.Append(" <td>Especialista</td>"); sb.Append(" </tr>"); sb.Append("</table>"); sb.Append("<table border=1 style='font-family:Arial;font-size:8pt;'>"); string sDenDefi = ""; string sDenTarea = ""; string sDesTarea = ""; string sCausa = ""; string sIntervencion = ""; string sConsideracion = ""; while (dr.Read()) { sbl.Length = 0; sbl.Append("<tr> "); sbl.Append("<td style='width:auto;' valign='top'> " + dr["AREA"].ToString() + "</td>"); sDenDefi = dr["DEFICIENCIA"].ToString().Replace("<", "<"); sDenDefi = sDenDefi.ToString().Replace("\"", """); sbl.Append("<td style='width:auto;' valign='top'>" + sDenDefi + "</td>"); sbl.Append("<td style='width:auto;' valign='top'>" + int.Parse(dr["ID_DEFI"].ToString()).ToString("#,###,##0") + "</td>"); sDenTarea = dr["TAREA"].ToString().Replace("<", "<"); sDenTarea = sDenTarea.ToString().Replace("\"", """); sbl.Append("<td style='width:auto;' valign='top'>" + sDenTarea + "</td>"); sbl.Append("<td style='width:auto;' valign='top'>" + int.Parse(dr["ID"].ToString()).ToString("#,###,##0") + "</td>"); string strFecha; if (dr["T072_FECINIPREV"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["T072_FECINIPREV"]).ToShortDateString(); } sbl.Append("<td style='width:auto;' valign='top'>" + strFecha + "</td>"); if (dr["T072_FECFINPREV"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["T072_FECFINPREV"]).ToShortDateString(); } sbl.Append("<td style='width:auto;' valign='top'>" + strFecha + "</td>"); if (dr["T072_FECINIREAL"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["T072_FECINIREAL"]).ToShortDateString(); } sbl.Append("<td style='width:auto;' valign='top'>" + strFecha + "</td>"); if (dr["T072_FECFINREAL"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["T072_FECFINREAL"]).ToShortDateString(); } sbl.Append("<td style='width:auto;' valign='top'>" + strFecha + "</td>"); // CONTINUAR AQUÍ dr["ID_AREA"].ToString().Replace((char)39, (char)34) //string sDesTarea = dr["DESCRIPCION_TAR"].ToString().Replace((char)60, (char)32); sDesTarea = dr["DESCRIPCION_TAR"].ToString().Replace("<", "<"); sDesTarea = sDesTarea.ToString().Replace("\"", """); sCausa = dr["T072_CAUSA"].ToString().Replace("<", "<"); sCausa = sCausa.ToString().Replace("\"", """); sIntervencion = dr["T072_INTERVENCION"].ToString().Replace("<", "<"); sIntervencion = sIntervencion.ToString().Replace("\"", """); sConsideracion = dr["T072_CONSIDERACION"].ToString().Replace("<", "<"); sConsideracion = sConsideracion.ToString().Replace("\"", """); sbl.Append("<td style='width:auto;' valign='top'> " + dr["RESULTADO"].ToString() + "</td>"); sbl.Append("<td style='width:auto;' valign='top'> " + sDesTarea + "</td>"); sbl.Append("<td style='width:auto;' valign='top'> " + dr["AVANCE"].ToString() + "</td>"); sbl.Append("<td style='width:auto;' valign='top'> " + sCausa + "</td>"); sbl.Append("<td style='width:auto;' valign='top'> " + sIntervencion + "</td>"); sbl.Append("<td style='width:auto;' valign='top'> " + sConsideracion + "</td>"); //11/05/2016 Juan Antonio Martin Mayoral solicita la inclusión de especialistas sbl.Append("<td style='width:auto;' valign='top'> " + dr["Especialista"].ToString() + "</td>"); /* 3/9/2008 Fernando no quiere mostrar los especialistas, dejamos lo comentarizado por se acaso */ sbl.Append("</tr>" + (char)13); sb.Append(sbl.ToString()); /*fin 3/9/2008*/ /* drTec = null; * drTec = TAREA.LeerTecnicosTarea(int.Parse(dr["ID"].ToString())); * * intContador = 0; * while (drTec.Read()) * { * sb.Append(sbl.ToString()); * sb.Append("<td valign='top'> " + drTec["TECNICO"].ToString() + "</td>"); * sb.Append("</tr>" + (char)13); * intContador = 1; * } * if (intContador == 0) * { * sb.Append(sbl.ToString()); * sb.Append("<td valign='top'> </td>"); * sb.Append("</tr>" + (char)13); * } * drTec.Close(); * drTec.Dispose(); */ } dr.Close(); dr.Dispose(); sb.Append("</table>"); sbl = null; //return sb.ToString(); string sIdCache = "GESTAR_EXCEL_CACHE_" + Session["IDFICEPI"].ToString() + "_" + DateTime.Now.ToString(); Session[sIdCache] = sb.ToString();; string sResul = "cacheado@@" + sIdCache + "@@" + sb.ToString(); sb.Length = 0; //Para liberar memoria return(sResul); } catch (Exception ex) { return("N@@" + Errores.mostrarError("Error al volcar las tareas", ex)); } }
private string ObtenerTareasAvanzado(byte byColum, byte byOrden) { try { System.Text.StringBuilder sbuilder = new System.Text.StringBuilder(); string strTramitadas; string strPdteAclara; string strAclaRta; string strAceptadas; string strRechazadas; string strEnEstudio; string strPdtesDeResolucion; string strPdtesDeAcepPpta; string strEnResolucion; string strResueltas; string strNoAprobadas; if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkTramitadas"]).ToString())) { strTramitadas = "1"; } else { strTramitadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdteAclara"]).ToString())) { strPdteAclara = "1"; } else { strPdteAclara = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkAclaRta"]).ToString())) { strAclaRta = "1"; } else { strAclaRta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkAceptadas"]).ToString())) { strAceptadas = "1"; } else { strAceptadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkRechazadas"]).ToString())) { strRechazadas = "1"; } else { strRechazadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkEnEstudio"]).ToString())) { strEnEstudio = "1"; } else { strEnEstudio = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdtesDeResolucion"]).ToString())) { strPdtesDeResolucion = "1"; } else { strPdtesDeResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkPdtesDeAcepPpta"]).ToString())) { strPdtesDeAcepPpta = "1"; } else { strPdtesDeAcepPpta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkEnResolucion"]).ToString())) { strEnResolucion = "1"; } else { strEnResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkResueltas"]).ToString())) { strResueltas = "1"; } else { strResueltas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["chkNoAprobadas"]).ToString())) { strNoAprobadas = "1"; } else { strNoAprobadas = "0"; } dr = null; dr = TAREA.Avanzado ( int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnIDArea"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnDeficiencia"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnCoordinador"]).ToString()), int.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["hdnEspecialista"]).ToString()), short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["cboSituacion"]).ToString()), short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["cboRtado"]).ToString()), short.Parse((((Hashtable)Session["PANT_AVANZADO_TAR"])["rdlOpciones"]).ToString()), (((Hashtable)Session["PANT_AVANZADO_TAR"])["txtFechaInicio"]).ToString(), (((Hashtable)Session["PANT_AVANZADO_TAR"])["txtFechaFin"]).ToString(), strTramitadas, strPdteAclara, strAclaRta, strAceptadas, strRechazadas, strEnEstudio, strPdtesDeResolucion, strPdtesDeAcepPpta, strEnResolucion, strResueltas, strNoAprobadas, int.Parse(Session["IDFICEPI"].ToString()), Session["ADMIN"].ToString(), byColum, byOrden ); int i = 0; sbuilder.Append("<table id='tblCatalogo' style='width:880px;text-align:left'>" + (char)13); //sbuilder.Append("<colgroup><col style='width:25px;padding-left:5px;padding-top:2px;' /><col style='width:213px;padding-top:2px;' /><col style='width:213px;padding-top:2px;' /><col style='width:166px;;padding-top:2px;' /><col style='width:108px;padding-top:2px;' /><col style='width:70px;padding-top:2px;' /><col style='width:84px;padding-top:2px;' /></colgroup>"); sbuilder.Append("<colgroup><col style='width:25px;' /><col style='width:213px;' /><col style='width:213px;' /><col style='width:166px;' /><col style='width:108px;' /><col style='width:70px;' /><col style='width:84px;' /></colgroup>"); sbuilder.Append("<tbody id='tbodyDatos'>" + (char)10); while (dr.Read()) { sbuilder.Append("<tr id='" + dr["ID_AREA"].ToString() + "//" + dr["AREA"].ToString() + "//" + dr["ID_DEFI"].ToString() + "//" + dr["DEFICIENCIA"].ToString() + "//" + dr["ID"].ToString() + "//" + dr["ESCOORDINADOR"].ToString() + "//" + dr["ESTADO"].ToString() + "//" + dr["CORREOCOORDINADOR"].ToString() + "//" + dr["COORDINADOR"].ToString()); //sbuilder.Append("<tr "); //if (i % 2 == 0) // sbuilder.Append("' class='FA' "); //else // sbuilder.Append("' class='FB' "); sbuilder.Append("' ondblclick=D_Tarea(this)"); sbuilder.Append(" onclick=marcar2(this);"); sbuilder.Append(" onmouseover='TTip(event)';"); sbuilder.Append(" style='cursor: pointer;height:22px'>"); sbuilder.Append("<td style='width:auto;'><INPUT title='Si está marcado sacamos el detalle de la tarea' id='" + dr["Id"].ToString() + "' onclick='D();' type=checkbox runat='server'/></td>"); sbuilder.Append("<td style='width:auto;'><nobr class='NBR' style='width:210px;'>" + int.Parse(dr["ID"].ToString()).ToString("#,###,##0") + " - " + dr["TAREA"].ToString() + "</nobr></td>"); sbuilder.Append("<td style='width:auto;'><nobr class='NBR' style='width:210px;'>" + int.Parse(dr["ID_DEFI"].ToString()).ToString("#,###,##0") + " - " + dr["DEFICIENCIA"].ToString() + "</nobr></td>"); sbuilder.Append("<td style='width:auto;'><nobr class='NBR' style='width:163px;'>" + dr["AREA"].ToString() + "</nobr></td>"); sbuilder.Append("<td style='width:auto;'> " + dr["AVANCE"].ToString() + "</td>"); sbuilder.Append("<td style='width:auto;'> " + dr["RESULTADO"].ToString() + "</td>"); string strFecha; if (dr["FECHA"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["FECHA"]).ToShortDateString(); } sbuilder.Append("<td style='width:auto;'>" + strFecha + "</td>"); sbuilder.Append("</tr>" + (char)13); //sbuilder += strFilas; i = i + 1; } dr.Close(); dr.Dispose(); sbuilder.Append("</tbody>"); sbuilder.Append("</table>"); return(sbuilder.ToString()); } catch (Exception ex) { return("N@@" + Errores.mostrarError("Error al obtener las tareas", ex)); } }
private string ObtenerTareasPropias(byte byColum, byte byOrden) { try { System.Text.StringBuilder sbuilder = new System.Text.StringBuilder(); string strTramitadas; string strPdteAclara; string strAclaRta; string strAceptadas; string strRechazadas; string strEnEstudio; string strPdtesDeResolucion; string strPdtesDeAcepPpta; string strEnResolucion; string strResueltas; string strNoAprobadas; if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkTramitadas"]).ToString())) { strTramitadas = "1"; } else { strTramitadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkPdteAclara"]).ToString())) { strPdteAclara = "1"; } else { strPdteAclara = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkAclaRta"]).ToString())) { strAclaRta = "1"; } else { strAclaRta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkAceptadas"]).ToString())) { strAceptadas = "1"; } else { strAceptadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkRechazadas"]).ToString())) { strRechazadas = "1"; } else { strRechazadas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkEnEstudio"]).ToString())) { strEnEstudio = "1"; } else { strEnEstudio = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkPdtesDeResolucion"]).ToString())) { strPdtesDeResolucion = "1"; } else { strPdtesDeResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkPdtesDeAcepPpta"]).ToString())) { strPdtesDeAcepPpta = "1"; } else { strPdtesDeAcepPpta = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkEnResolucion"]).ToString())) { strEnResolucion = "1"; } else { strEnResolucion = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkResueltas"]).ToString())) { strResueltas = "1"; } else { strResueltas = "0"; } if (bool.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["chkNoAprobadas"]).ToString())) { strNoAprobadas = "1"; } else { strNoAprobadas = "0"; } dr = null; dr = TAREA.TareasPropias ( int.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["hdnIDArea"]).ToString()), short.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["cboSituacion"]).ToString()), short.Parse((((Hashtable)Session["PANT_PROPIAS_TAR"])["cboRtado"]).ToString()), (((Hashtable)Session["PANT_PROPIAS_TAR"])["txtFecha"]).ToString(), strTramitadas, strPdteAclara, strAclaRta, strAceptadas, strRechazadas, strEnEstudio, strPdtesDeResolucion, strPdtesDeAcepPpta, strEnResolucion, strResueltas, strNoAprobadas, int.Parse(Session["IDFICEPI"].ToString()), Session["ADMIN"].ToString(), byColum, byOrden ); int i = 0; sbuilder.Append("<table id='tblCatalogo' style='width:880px;' border='0'>"); //sbuilder.Append("<colgroup><col style='width:3%' /><col style='width:24%' /><col style='width:25%' /><col style='width:19%' /><col style='width:12%' /><col style='width:8%' /><col style='width:7%' /><col style='width:2%' /></colgroup>"); sbuilder.Append(@"<colgroup> <col style='width:25px;' /> <col style='width:215px;' /> <col style='width:215px;' /> <col style='width:160px;' /> <col style='width:105px;' /> <col style='width:80px;' /> <col style='width:80px;' /> </colgroup>"); while (dr.Read()) { string strFecha; if (dr["FECHA"] == System.DBNull.Value) { strFecha = ""; } else { strFecha = ((DateTime)dr["FECHA"]).ToShortDateString(); } sbuilder.Append("<tr id='" + dr["ID_AREA"].ToString().Replace((char)39, (char)34) + "//" + dr["AREA"].ToString().Replace((char)39, (char)34) + "//" + dr["ID_DEFI"].ToString() + "//" + dr["DEFICIENCIA"].ToString().ToString().Replace((char)39, (char)34) + "//" + dr["ID"].ToString() + "//" + dr["ESCOORDINADOR"].ToString() + "//" + dr["ESTADO"].ToString() + "//" + dr["CORREOCOORDINADOR"].ToString() + "//" + dr["COORDINADOR"].ToString()); sbuilder.Append("' ondblclick=D_Tarea(this)"); sbuilder.Append(" onclick=marcar2(this);"); sbuilder.Append(" onmouseover='TTip(event)';"); sbuilder.Append(" style='cursor: pointer;height:22px'>"); sbuilder.Append("<td><INPUT title='Si está marcado sacamos el detalle de la tarea' id='" + dr["Id"].ToString() + "' onclick='D();' type=checkbox runat='server'/></td>"); sbuilder.Append("<td><nobr class='NBR' style='width:210px;'>" + int.Parse(dr["ID"].ToString()).ToString("#,###,##0") + " - " + dr["TAREA"].ToString() + "</nobr></td>"); sbuilder.Append("<td><nobr class='NBR' style='width:210px;'>" + int.Parse(dr["ID_DEFI"].ToString()).ToString("#,###,##0") + " - " + dr["DEFICIENCIA"].ToString() + "</nobr></td>"); sbuilder.Append("<td><nobr class='NBR' style='width:160px;'>" + dr["AREA"].ToString() + "</nobr></td>"); sbuilder.Append("<td>" + dr["AVANCE"].ToString() + "</td>"); sbuilder.Append("<td>" + dr["RESULTADO"].ToString() + "</td>"); sbuilder.Append("<td>" + strFecha + "</td>"); sbuilder.Append("</tr>" + (char)13); //sbuilder += strFilas; i = i + 1; } dr.Close(); dr.Dispose(); sbuilder.Append("</table>"); return(sbuilder.ToString()); } catch (Exception ex) { return("N@@" + Errores.mostrarError("Error al obtener las tareas", ex)); } }
// Ordena = campo de la select TipoOrden = 1 asc 2 desc //public DetalleTarea() //{ // this.Title = "Detalle de la tarea"; // ArrayList aFuncionesJavaScript = new ArrayList(); // aFuncionesJavaScript.Add("Capa_Presentacion/Defiencias/Functions/funciones.js"); // aFuncionesJavaScript.Add("JavaScript/funciones.js"); // this.FuncionesJavaScript = aFuncionesJavaScript; //} protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsCallback) { try { if (Session["IDRED"] == null) { try { Response.Redirect("~/SesionCaducadaModal.aspx", true); } catch (System.Threading.ThreadAbortException) { return; } } //if (Request.QueryString["bNueva"] == "false") // strTitulo = "Modificación de la tarea"; //else // strTitulo = "Creación de una nueva tarea"; strTablaHtmlCatalogo = "<table id='tblCatalogo' class='texto' style='width: 390px' cellSpacing='0' cellpadding='0' align='left' border='0'></table>"; strTablaHtmlSeleccionados = "<table id='tblSeleccionados' class='texto' style='width: 390px' cellSpacing='0' cellpadding='0' align='left' border='0'></table>"; strTitulo = "Detalle tarea"; cboAvance.Items.Insert(0, new ListItem("", "0")); cboAvance.Items[0].Selected = true; cboRtado.Items.Insert(0, new ListItem("", "0")); cboRtado.Items[0].Selected = true; hdnIDArea.Text = Request.QueryString["IDAREA"].ToString(); hdnIDDefi.Text = Request.QueryString["IDDEFICIENCIA"].ToString(); txtDeficiencia.Text = Request.QueryString["DEFICIENCIA"].ToString(); txtArea.Text = Request.QueryString["AREA"]; hdnModoLectura.Text = Session["MODOLECTURA"].ToString(); hdnEstado.Text = Request.QueryString["ESTADO"]; //Si anulada o aprobada ponemos en modo lectura if (hdnEstado.Text == "12" || hdnEstado.Text == "11") { hdnModoLectura.Text = "1"; } if (Request.QueryString["bNueva"].ToString() == "false") { #region Modificar tarea #region Carga datos Tarea hdnIDTarea.Text = Request.QueryString["IDTAREA"].ToString(); dr = null; dr = TAREA.Select(null, short.Parse(Request.QueryString["IDTAREA"])); if (dr.Read()) { txtDenominacion.Text = (string)dr["T072_DENOMINACION"]; if (dr["T072_FECINIPREV"] == System.DBNull.Value) { txtFechaInicioPrevista.Text = ""; } else { txtFechaInicioPrevista.Text = ((DateTime)dr["T072_FECINIPREV"]).ToShortDateString(); } if (dr["T072_FECINIREAL"] == System.DBNull.Value) { txtFechaInicioReal.Text = ""; } else { txtFechaInicioReal.Text = ((DateTime)dr["T072_FECINIREAL"]).ToShortDateString(); } if (dr["T072_FECFINPREV"] == System.DBNull.Value) { txtFechaFinPrevista.Text = ""; } else { txtFechaFinPrevista.Text = ((DateTime)dr["T072_FECFINPREV"]).ToShortDateString(); } if (dr["T072_FECFINREAL"] == System.DBNull.Value) { txtFechaFinReal.Text = ""; } else { txtFechaFinReal.Text = ((DateTime)dr["T072_FECFINREAL"]).ToShortDateString(); } txtDescripcion.Text = (string)dr["T072_DESCRIPCION"]; txtIdTarea.Text = dr["T072_IDTAREA"].ToString(); txtCausas.Text = (string)dr["T072_CAUSA"]; txtIntervenciones.Text = (string)dr["T072_INTERVENCION"]; txtConsideraciones.Text = (string)dr["T072_CONSIDERACION"]; cboRtado.SelectedValue = dr["T072_RESULTADO"].ToString(); cboAvance.SelectedValue = dr["T072_AVANCE"].ToString(); hdnAvanceIn.Text = dr["T072_AVANCE"].ToString(); } dr.Close(); dr.Dispose(); dr = null; #endregion #region Solapa Especialistas hdnEsCoordinador.Text = Request.QueryString["ES_COORDINADOR"].ToString(); strTablaHtmlCatalogo = CargarEspecialistas(int.Parse(hdnIDArea.Text)); string[] aTablaHtmlCatalogo = Regex.Split(strTablaHtmlCatalogo, @"##"); strTablaHtmlCatalogo = aTablaHtmlCatalogo[0]; hdnEspecialistas.Text = aTablaHtmlCatalogo[1]; #endregion if (hdnEsCoordinador.Text == "true") { this.hdnBusqueda.Text = "S"; } strTablaHtmlSeleccionados = CargarEspecialistasSeleccionados(int.Parse(txtIdTarea.Text)); hdnAdmin.Text = Request.QueryString["ADMIN"]; int intCoordinador = (Request.QueryString["COORDINADOR"].ToString() == "") ? 0 : int.Parse(Request.QueryString["COORDINADOR"].ToString()); if ( ( (hdnModoLectura.Text == "1" || hdnEsTecnico.Text == "true") && (hdnAdmin.Text != "A" && hdnEsCoordinador.Text != "true" || (hdnEsCoordinador.Text == "true" && intCoordinador != int.Parse(Session["IDFICEPI"].ToString()) ) ) ) || (hdnEstado.Text == "2" || hdnEstado.Text == "4" || hdnEstado.Text == "7" || hdnEstado.Text == "9" || hdnEstado.Text == "12" || hdnEstado.Text == "11") || (hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "false") ) { System.Web.UI.Control Area = this.FindControl("frmDatos"); ModoLectura.Poner(Area.Controls); //if (hdnEsTecnico.Text == "true" && (hdnEstado.Text != "12" && hdnEstado.Text != "11")) if (hdnEsTecnico.Text == "true" && hdnEstado.Text == "8") { Habilitar_campos_Tecnico(); hdnModoLectura.Text = "0"; } if ((hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "false") || (hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "true" && hdnEstado.Text != "8") || (hdnEsCoordinador.Text == "true" && (hdnEstado.Text == "0" || hdnEstado.Text == "2" || hdnEstado.Text == "4" || hdnEstado.Text == "7" || hdnEstado.Text == "9"))) { hdnModoLectura.Text = "1"; } } //12/05/2016 Por petición de Víctor solo podrán modificar fechas de tarea los coordinadores //y en Órdenes(deficiencias) cuyos estados sean Tramitada, Aceptada, Es estudio, Pte. de resolución y En resolución if (hdnModoLectura.Text == "0" && hdnEsCoordinador.Text == "true") { if (FechaModificable(hdnEstado.Text)) { PonerEventosFecha(); } } #endregion } else { PonerEventosFecha(); hdnEsCoordinador.Text = "true"; strTablaHtmlCatalogo = CargarEspecialistas(int.Parse(hdnIDArea.Text)); string[] aTablaHtmlCatalogo = Regex.Split(strTablaHtmlCatalogo, @"##"); strTablaHtmlCatalogo = aTablaHtmlCatalogo[0]; hdnEspecialistas.Text = aTablaHtmlCatalogo[1]; } this.txtArea.Attributes.Add("readonly", "readonly"); this.txtDeficiencia.Attributes.Add("readonly", "readonly"); //this.txtDenominacion.Attributes.Add("readonly", "readonly"); this.txtIdTarea.Attributes.Add("readonly", "readonly"); } catch (Exception ex) { hdnErrores.Text = Errores.mostrarError("Error al obtener los datos", ex); } //1º Se indican (por este orden) la función a la que se va a devolver el resultado y la función que va a acceder al servidor string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context"); string cbLlamada = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}"; //2º Se "registra" la función que va a acceder al servidor. Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true); } }
private static DesdeFicheroIAP getLinea(DesdeFicheroIAP oDesdeFicheroIAP, string sEstructu, Hashtable htTarea, Hashtable htProfesional) { TAREA oTarea = null; PROFESIONAL oProfesional = null; char[] chrs = { '+', '-', ',', '.' }; char[] chrs2 = { '+', '-', '.' }; int idx = 0; oTarea = (TAREA)htTarea[oDesdeFicheroIAP.idtarea]; if (oTarea != null) { oDesdeFicheroIAP.t332_destarea = oTarea.t332_destarea; } oProfesional = (PROFESIONAL)htProfesional[oDesdeFicheroIAP.idusuario]; if (oProfesional != null) { oDesdeFicheroIAP.Profesional = oProfesional.Profesional; } if (Utilidades.isNumeric(oDesdeFicheroIAP.idusuario)) { idx = oDesdeFicheroIAP.idusuario.IndexOfAny(chrs); if (idx == -1) { oDesdeFicheroIAP.t314_idusuario = System.Convert.ToInt32(oDesdeFicheroIAP.idusuario); } else { oDesdeFicheroIAP.t314_idusuario = -99999; } } else { oDesdeFicheroIAP.t314_idusuario = -1; } if (Utilidades.isNumeric(oDesdeFicheroIAP.idtarea)) { idx = oDesdeFicheroIAP.idtarea.IndexOfAny(chrs); if (idx == -1) { oDesdeFicheroIAP.t332_idtarea = System.Convert.ToInt32(oDesdeFicheroIAP.idtarea); } else { oDesdeFicheroIAP.t332_idtarea = -99999; } } else { oDesdeFicheroIAP.t332_idtarea = -1; } if (oDesdeFicheroIAP.fechaDesde.Length == 10) { if (Utilidades.isDate(oDesdeFicheroIAP.fechaDesde)) { oDesdeFicheroIAP.t337_fechaDesde = DateTime.Parse(oDesdeFicheroIAP.fechaDesde); if ( (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaDesde.ToString().Substring(0, 2))) || (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaDesde.ToString().Substring(3, 2))) || (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaDesde.ToString().Substring(6, 4))) ) { oDesdeFicheroIAP.t337_fechaDesde = null; } } else { oDesdeFicheroIAP.t337_fechaDesde = null; } } else { oDesdeFicheroIAP.t337_fechaDesde = null; } if (Utilidades.isNumeric(oDesdeFicheroIAP.esfuerzo)) { idx = oDesdeFicheroIAP.esfuerzo.IndexOfAny(chrs2); if (idx == -1) { oDesdeFicheroIAP.t337_esfuerzo = Double.Parse(oDesdeFicheroIAP.esfuerzo); } else { oDesdeFicheroIAP.t337_esfuerzo = -99999; } } else { oDesdeFicheroIAP.t337_esfuerzo = -1; } //if (Request.Form[Constantes.sPrefijo + "rdbImputacion"].ToString() != "D") if (sEstructu != "D") { if (oDesdeFicheroIAP.fechaHasta.Length == 10) { if (Utilidades.isDate(oDesdeFicheroIAP.fechaHasta)) { oDesdeFicheroIAP.t337_fechaHasta = DateTime.Parse(oDesdeFicheroIAP.fechaHasta); if ( (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaHasta.ToString().Substring(0, 2))) || (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaHasta.ToString().Substring(3, 2))) || (!Utilidades.isNumeric(oDesdeFicheroIAP.fechaHasta.ToString().Substring(6, 4))) ) { oDesdeFicheroIAP.t337_fechaHasta = null; } else if (oDesdeFicheroIAP.t337_fechaDesde > oDesdeFicheroIAP.t337_fechaHasta) { oDesdeFicheroIAP.t337_fechaHasta = null; } } else { oDesdeFicheroIAP.t337_fechaHasta = null; } } else { oDesdeFicheroIAP.t337_fechaHasta = null; } if (Utilidades.isNumeric(oDesdeFicheroIAP.festivos)) { if (oDesdeFicheroIAP.festivos == "1") { oDesdeFicheroIAP.bfestivos = true; } else if (oDesdeFicheroIAP.festivos == "0") { oDesdeFicheroIAP.bfestivos = false; } else { oDesdeFicheroIAP.bfestivos = null; } } else { oDesdeFicheroIAP.bfestivos = null; } } return(oDesdeFicheroIAP); }
private string Grabar(byte byteNueva, string sDenominacion, string sDescripcion, string sFechaInicioPrevista, string sFechaFinPrevista, string sFechaInicioReal, string sFechaFinReal, string sCausas, string sIntervenciones, string sConsideraciones, short shAvance, byte byRtdo, string sRecursos, string sEspecialistas, string sEspecialistasAreas, string sIDTarea, short shAvanceOld) { string sResul; if (sIDTarea == "-1") { sIDTarea = hdnIDTarea.Text; } ; try { oConn = GESTAR.Capa_Negocio.Conexion.Abrir(); tr = GESTAR.Capa_Negocio.Conexion.AbrirTransaccion(oConn); } catch (Exception ex) { if (oConn.State == ConnectionState.Open) { GESTAR.Capa_Negocio.Conexion.Cerrar(oConn); } return("N@@" + Errores.mostrarError("Error al abrir la conexión", ex)); } DateTime?dFechaInicioPrevista = null; if (sFechaInicioPrevista != "") { dFechaInicioPrevista = DateTime.Parse(sFechaInicioPrevista); } DateTime?dFechaFinPrevista = null; if (sFechaFinPrevista != "") { dFechaFinPrevista = DateTime.Parse(sFechaFinPrevista); } DateTime?dFechaInicioReal = null; if (sFechaInicioReal != "") { dFechaInicioReal = DateTime.Parse(sFechaInicioReal); } DateTime?dFechaFinReal = null; if (sFechaFinReal != "") { dFechaFinReal = DateTime.Parse(sFechaFinReal); } if (byteNueva == 0) { try { TAREA.Update(tr, int.Parse(sIDTarea), int.Parse(hdnIDDefi.Text), sDenominacion, sDescripcion, dFechaInicioPrevista, dFechaFinPrevista, dFechaInicioReal, dFechaFinReal, sCausas, sIntervenciones, sConsideraciones, shAvance, byRtdo, int.Parse(Session["IDFICEPI"].ToString())); intContador = int.Parse(sIDTarea); } catch (System.Exception objError) { sResul = Errores.mostrarError("Error al modificar la tarea.", objError); GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr, oConn); return("N@@" + sResul); } } else { try { intContador = TAREA.Insert(tr, int.Parse(hdnIDDefi.Text), sDenominacion, sDescripcion, dFechaInicioPrevista, dFechaFinPrevista, dFechaInicioReal, dFechaFinReal, sCausas, sIntervenciones, sConsideraciones, shAvance, byRtdo, int.Parse(Session["IDFICEPI"].ToString())); hdnIDTarea.Text = intContador.ToString(); sIDTarea = hdnIDTarea.Text; } catch (System.Exception objError) { sResul = Errores.mostrarError("Error al crear la tarea.", objError); GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr, oConn); return("N@@" + sResul); } } if (sRecursos == "S") { try { TAREA_USUARIO.Delete(tr, int.Parse(sIDTarea)); } catch (System.Exception objError) { sResul = Errores.mostrarError("Error al borrar los especialistas.", objError); GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr, oConn); return("N@@" + sResul); } string[] aEspecialistas = Regex.Split(sEspecialistas, ","); for (int j = 0; j < aEspecialistas.Length; j++) { if (aEspecialistas[j] == "") { continue; } try { string[] aID = Regex.Split(aEspecialistas[j], "/"); TAREA_USUARIO.Insert(tr, int.Parse(sIDTarea), int.Parse(aID[0])); } catch (System.Exception objError) { sResul = Errores.mostrarError("Error al insertar los especialistas.", objError); GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr, oConn); return("N@@" + sResul); } } } string[] aEspecialistasAreas = Regex.Split(sEspecialistasAreas, ","); for (int j = 0; j < aEspecialistasAreas.Length; j++) { if (aEspecialistasAreas[j] == "") { continue; } try { string[] aID = Regex.Split(aEspecialistasAreas[j], "/"); Integrante.Insertar(tr, int.Parse(hdnIDArea.Text), int.Parse(aID[0]), "5"); } catch (System.Exception objError) { sResul = Errores.mostrarError("Error al insertar los Especialistas-Areas.", objError); GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr, oConn); return("N@@" + sResul); } } try { GESTAR.Capa_Negocio.Conexion.CommitTransaccion(tr); sResul = ""; } catch (Exception ex) { GESTAR.Capa_Negocio.Conexion.CerrarTransaccion(tr); sResul = "N@@" + Errores.mostrarError("Error al grabar los datos ( commit )", ex); } finally { GESTAR.Capa_Negocio.Conexion.Cerrar(oConn); } string strMensaje = ""; string strAsunto = ""; string strTO; string[] aTecnicosIn = Regex.Split(this.hdnCorreoEspecialistaIn.Text, ","); string[] aTecnicosOut = Regex.Split(sEspecialistas, ","); // CORREO (TECNICOS) BAJAS, ALTAS CUANDO EL ESTADO DE LA DEFICIENCIA ESTÁ EN RESOLUCIÓN if (hdnEstado.Text == "8") { // NOTIFICACION BAJAS int intEncontrado; for (int j = 0; j < aTecnicosIn.Length; j++) { if (aTecnicosIn[j] == "") { continue; } intEncontrado = 0; for (int i = 0; i < aTecnicosOut.Length; i++) { if (aTecnicosIn[j] == aTecnicosOut[i]) { intEncontrado = 1; break; } } if (intEncontrado == 0) { strAsunto = "Desasignación de tarea"; strMensaje = Session["NOMBRE"] + @" le ha desasignado de una tarea.</p><br><br><br><br>"; strMensaje += @"<table id='tblContenido' width='100%' class='texto' border='0' cellspacing='0' cellpadding='0'>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Área:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + Request.QueryString["AREA"].ToString() + "<BR><BR></td><tr>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Orden:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + Request.QueryString["IDDEFICIENCIA"].ToString() + "-" + Request.QueryString["DEFICIENCIA"].ToString() + "<BR><BR></td><tr>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Tarea:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + sIDTarea + "-" + sDenominacion + "</td><tr>"; strMensaje += @"</table>"; string[] aID = Regex.Split(aTecnicosIn[j], "/"); //strAsunto += " Usuario ( " + aID[0] + "/" + aID[1] +" ) NOTIFICACION BAJAS"; //CASO BAJA if (aID[1].Trim() == "") { strMensaje = " La aplicación GESTAR ha intentado enviar correo al usuario con código FICEPI " + aID[0] + " y no ha podido. EL motivo es que no tiene asignado código de red. Por favor, rogamos se corrija esta situación. "; strTO = "IntranetCau"; //caso de una persona que no tenga cod_red Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 13); strTO = "EDA"; } else { strTO = aID[1]; } Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 2); } } // NOTIFICACION ALTAS for (int j = 0; j < aTecnicosOut.Length; j++) { if (aTecnicosOut[j] == "") { continue; } intEncontrado = 0; for (int i = 0; i < aTecnicosIn.Length; i++) { if (aTecnicosOut[j] == aTecnicosIn[i]) { intEncontrado = 1; break; } } if (intEncontrado == 0) { strAsunto = "Asignación de tarea"; strMensaje = @"<p>" + Session["NOMBRE"] + " le ha asignado como <LABEL class='TITULO'>ESPECIALISTA</LABEL></p><br><br><br><br>"; strMensaje += @"<table id='tblContenido' width='100%' class='texto' border='0' cellspacing='0' cellpadding='0'>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Área:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + Request.QueryString["AREA"].ToString() + "<BR><BR></td><tr>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Orden:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + Request.QueryString["IDDEFICIENCIA"].ToString() + "-" + Request.QueryString["DEFICIENCIA"].ToString() + "<BR><BR></td><tr>"; strMensaje += @"<tr><td width='15%' valign='top'><LABEL class='TITULO'>Tarea:</LABEL></td>"; strMensaje += @"<td width='85%' valign='top'>" + sIDTarea + "-" + sDenominacion + "</td><tr>"; strMensaje += @"</table>"; string[] aID = Regex.Split(aTecnicosOut[j], "/"); //strAsunto += " Usuario ( " + aID[0] + "/" + aID[1] +" ) NOTIFICACION ALTAS"; //CASO ALTA if (aID[1].Trim() == "") { strMensaje = " La aplicación GESTAR ha intentado enviar correo al usuario con código FICEPI " + aID[0] + " y no ha podido. EL motivo es que no tiene asignado código de red. Por favor, rogamos se corrija esta situación. "; strTO = "IntranetCau"; //caso de una persona que no tenga cod_red Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 13); strTO = "EDA"; } else { strTO = aID[1]; } Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 2); } } if (shAvance != shAvanceOld) { string[] aID = Regex.Split(Request.QueryString["CORREOCOORDINADOR"].ToString(), "/"); strAsunto = "Avance de tarea"; cboAvance.SelectedValue = shAvance.ToString(); strMensaje = Session["NOMBRE"] + @" ha modificado el % de avance.<BR><BR><BR><BR>"; strMensaje += @"<table id='tblContenido' width='90%' class='texto' border='0' cellspacing='0' cellpadding='0'>"; strMensaje += @"<tr><td width='20%' valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Área:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += Request.QueryString["AREA"] + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Orden:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += Request.QueryString["IDDEFICIENCIA"].ToString() + "-" + Request.QueryString["DEFICIENCIA"].ToString() + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Tarea:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += sIDTarea + "-" + sDenominacion + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Avance:</LABEL>"; strMensaje += @"</td><td valign='top'>"; if (shAvance != 0) { strMensaje += cboAvance.SelectedItem.Text; } strMensaje += @"<br><br></td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Causas:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += sCausas.Replace(((char)10).ToString().Replace((char)34, (char)39), "<br>") + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Intervenciones:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += sIntervenciones.Replace(((char)10).ToString().Replace((char)34, (char)39), "<br>") + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"<tr><td valign='top'>"; strMensaje += @"<LABEL class='TITULO'>Consideraciones - Comentarios:</LABEL>"; strMensaje += @"</td><td valign='top'>"; strMensaje += sConsideraciones.Replace(((char)10).ToString().Replace((char)34, (char)39), "<br>") + "<br><br>"; strMensaje += @"</td></tr>"; strMensaje += @"</table>"; //strAsunto += " Usuario ( " + aID[0] + "/" + aID[1] +" ) MODIFICACION DE LA SOLAPA DE PARTES"; if (aID[1].Trim() == "") { strMensaje = " La aplicación GESTAR ha intentado enviar correo al usuario con código FICEPI " + aID[0] + " y no ha podido. EL motivo es que no tiene asignado código de red. Por favor, rogamos se corrija esta situación. "; strTO = "IntranetCau"; //caso de una persona que no tenga cod_red Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 13); strTO = "EDA"; } else { strTO = aID[1]; } Correo.Enviar(strAsunto, strMensaje, strTO, "", "", "", 2); } } // FIN CORREO return(sResul); }