protected string Grabar(string strDatos) { string sResul = ""; int? idPT; IB.SUPER.ADM.SIC.BLL.ParametrizacionDestinoPT oLista = new IB.SUPER.ADM.SIC.BLL.ParametrizacionDestinoPT(); try { #region Genero lista de objetos List <IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT> Catalogo = new List <IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT>(); string[] aClase = Regex.Split(strDatos, "///"); foreach (string oClase in aClase) { if (oClase == "") { continue; } string[] aValores = Regex.Split(oClase, "##"); //0. Opcion BD. "I", "U", "D" //1. ID OC //2. ID Profesional //3. ID PT //4. Bloquear if (aValores[3] == "") { idPT = null; } else { idPT = int.Parse(aValores[3]); } IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT oElem = new IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT(); oElem.bd = aValores[0]; oElem.ta212_idorganizacioncomercial = int.Parse(aValores[1]); oElem.t001_idficepi_comercial = int.Parse(aValores[2]); oElem.t331_idpt = idPT; oElem.ta213_nocambioautomatico = bool.Parse(aValores[4]); Catalogo.Add(oElem); } #endregion oLista.GrabarLista(Catalogo); sResul = "OK@#@"; } catch (Exception ex) { sResul = "Error@#@" + Errores.mostrarError("Error al grabar.", ex, false); } finally { oLista.Dispose(); } return(sResul); }
private string buscarParametrizaciones() { StringBuilder sb = new StringBuilder(); string sRes = ""; bool? bEstado; int? idOC = null; int? idFicepi = null; bool bMostrarProfBaja = false; string bloquear = ""; string disabled = ""; sb.Append("<table id='tblDatos' class='texto' style='width:990px; text-align:left;' mantenimiento='1' border='0'>"); sb.Append("<colgroup><col style='width:20px;' /><col style='width:300px;'><col style='width:290px'><col style='width:250px;'><col style='width:70px;'><col style='width:60px;'></colgroup>"); sb.Append("<tbody>"); IB.SUPER.ADM.SIC.BLL.ParametrizacionDestinoPT oP = new IB.SUPER.ADM.SIC.BLL.ParametrizacionDestinoPT(); try { List <IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT> oLista = oP.CatPrametrizaciones(); foreach (IB.SUPER.ADM.SIC.Models.ParametrizacionDestinoPT oElem in oLista) { sb.Append("<tr bd='' idOC='" + oElem.ta212_idorganizacioncomercial.ToString() + "'"); sb.Append(" idP='" + oElem.t001_idficepi_comercial + "' idPT='" + oElem.t331_idpt.ToString() + "'"); sb.Append(" idPTOri='" + oElem.t331_idpt.ToString() + "'"); sb.Append(" style='height:20px'>");//onkeydown='activarGrabar()' sb.Append("<td></td>"); sb.Append("<td onmouseover='TTip(event)' style='width:310px;'><span class='NBR W290'>" + oElem.denOC + "</span></td>"); if (oElem.baja) { sb.Append("<td onmouseover='TTip(event)' style='width:310px;'><span class='NBR W290' style='color:red;'>" + oElem.denProfesional + "</span></td>"); } else { sb.Append("<td onmouseover='TTip(event)' style='width:310px;'><span class='NBR W290'>" + oElem.denProfesional + "</span></td>"); } sb.Append("<td onmouseover='TTip(event)' style='width:310px;'><span class='NBR W290'>" + oElem.denPT + "</span></td>"); sb.Append("<td><input type='checkbox' class='check MANO' style='width:15px;margin-left:25px;' /></td>"); if (oElem.ta213_nocambioautomatico) { bloquear = "checked='checked'"; } else { bloquear = ""; } if (oElem.denPT == "") { disabled = "disabled = 'disabled'"; } else { disabled = ""; } sb.Append("<td><input onclick='checkUpdated(this)' type='checkbox' " + bloquear + " " + disabled + " class='check MANO' style='width:15px;margin-left:15px;' /></td>"); sb.Append("</tr>"); } sb.Append("</tbody>"); sb.Append("</table>"); strTablaHtml = sb.ToString(); sRes = "OK@#@" + strTablaHtml; } catch (Exception ex) { sErrores += Errores.mostrarError("Error al cargar la parametrización de las organizaciones comerciales", ex); sRes = "ERROR@#@" + ex.Message; this.hdnMensajeError.Text = ex.Message; } finally { oP.Dispose(); } return(sRes); }