void BindData(string VbConsultar) { DataTable dtbl = new DataTable(); Cnx.BaseDatos(Session["D[BX"].ToString(), Session["$VR"].ToString(), Session["V$U@"].ToString(), Session["P@$"].ToString()); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_ConfiguracionV2_ 12,'" + VbConsultar + "','','','','',0,0,0,0,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); SqlDataAdapter sqlDa = new SqlDataAdapter(VbTxtSql, sqlCon); sqlDa.Fill(dtbl); } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); GrdDatos.Rows[0].Cells[0].ColumnSpan = dtbl.Columns.Count; GrdDatos.Rows[0].Cells[0].Text = "No existen registros ..!"; GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BIndDatos() { DataTable DtB = new DataTable(); Cnx.SelecBD(); using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_PANTALLA_Asignacion 4,@Pr,@T,'','',@Al,0,1,@ICC,'01-1-2009','01-01-1900','01-01-1900'"; sqlConB.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB)) { SC.Parameters.AddWithValue("@Al", DdlAlmacen.Text.Trim()); SC.Parameters.AddWithValue("@Pr", TxtBusqueda.Text.Trim()); SC.Parameters.AddWithValue("@T", DdlTipo.Text.Trim()); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); using (SqlDataAdapter DAB = new SqlDataAdapter()) { DAB.SelectCommand = SC; DAB.Fill(DtB); if (DtB.Rows.Count > 0) { GrdDatos.DataSource = DtB; GrdDatos.DataBind(); } else { GrdDatos.DataSource = null; GrdDatos.DataBind(); } } } } }
protected void BindData(string VbDesPefil, string VbDesUsu, string Accion) { if (Accion.Equals("UPD")) { Cnx.SelecBD(); using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_ConfiguracionV2_ 14,@NomUsu,@DesPrfl,'','','',@IdG,0,@Idm,@ICC,'01-01-1','02-01-1','03-01-1'"; sqlConB.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB)) { SC.Parameters.AddWithValue("@NomUsu", VbDesUsu); SC.Parameters.AddWithValue("@DesPrfl", VbDesPefil); SC.Parameters.AddWithValue("@IdG", Session["IdGrupoRP"]); SC.Parameters.AddWithValue("@Idm", Session["77IDM"]); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); using (SqlDataAdapter SDA = new SqlDataAdapter()) { using (DataSet DSTDdl = new DataSet()) { SDA.SelectCommand = SC; SDA.Fill(DSTDdl); DSTDdl.Tables[0].TableName = "Grupos"; DSTDdl.Tables[1].TableName = "UsuAsignados"; DSTDdl.Tables[2].TableName = "UsuSinAsign"; DSTDdl.Tables[3].TableName = "PerfilAsig"; DSTDdl.Tables[4].TableName = "PerfilSinAsig"; DSTDdl.Tables[5].TableName = "TraerDatosParaAsigPerfil"; DSTDdl.Tables[6].TableName = "TraerDatosPrflAsigdos"; ViewState["DSTDdl"] = DSTDdl; } } } } } DSTDdl = (DataSet)ViewState["DSTDdl"]; string VbCodAnt = DdlGruposRP.Text.Trim(); DdlGruposRP.DataSource = DSTDdl.Tables[0]; DdlGruposRP.DataTextField = "NombreGrupo"; DdlGruposRP.DataValueField = "CodIdGrupo"; DdlGruposRP.DataBind(); DdlGruposRP.Text = VbCodAnt; GrdDatos.DataSource = DSTDdl.Tables[1]; GrdDatos.DataBind(); GrdDatosUsin.DataSource = DSTDdl.Tables[2]; GrdDatosUsin.DataBind(); GrdPerfilAsig.DataSource = DSTDdl.Tables[3]; GrdPerfilAsig.DataBind(); GrdSinAsig.DataSource = DSTDdl.Tables[4]; GrdSinAsig.DataBind(); }
protected void BindData(string VbConsultar, string Accion) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataTable DT = new DataTable(); DataRow[] Result; if (Accion.Equals("UPD")) { Cnx.SelecBD(); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_Pantalla_Parametros 3,'','','','','',0,0,0,@ICC,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlCon)) { SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(DTDet); ViewState["DTDet"] = DTDet; } } } DTDet = (DataTable)ViewState["DTDet"]; DT = DTDet.Clone(); Result = DTDet.Select("Modelo LIKE '%" + VbConsultar + "%'"); foreach (DataRow DR in Result) { DT.ImportRow(DR); } if (DT.Rows.Count > 0) { DataView DV = DT.DefaultView; DV.Sort = "CodModelo"; DT = DV.ToTable(); GrdDatos.DataSource = DT; GrdDatos.DataBind(); string VblLbl = ""; Result = Idioma.Select("Objeto= 'GrdActiv'"); foreach (DataRow row in Result) { VblLbl = row["Texto"].ToString().Trim(); } foreach (GridViewRow row in GrdDatos.Rows) { LinkButton lb = (LinkButton)row.Cells[0].Controls[0]; lb.Text = VblLbl; } } else { GrdDatos.DataSource = null; GrdDatos.DataBind(); } }
protected void BindData(string VbConsultar, string Accion) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataRow[] Result; if (Accion.Equals("UPD")) { Cnx.SelecBD(); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_TablasGeneral 12,'','','','','','','','TipoUbGeo','SELECT',0,0,0,0,@Idm,@ICC,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlCon)) { SC.Parameters.AddWithValue("@Idm", Session["77IDM"]); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(DTDet); ViewState["DTDet"] = DTDet; } } } DTDet = (DataTable)ViewState["DTDet"]; DataTable DT = new DataTable(); DT = DTDet.Clone(); Result = DTDet.Select("Descripcion LIKE '%" + VbConsultar + "%'"); foreach (DataRow DR in Result) { DT.ImportRow(DR); } if (DT.Rows.Count > 0) { DataView DV = DT.DefaultView; DV.Sort = "TipoUbicaGeogr DESC"; DT = DV.ToTable(); GrdDatos.DataSource = DT; GrdDatos.DataBind(); } else { DT.Rows.Add(DT.NewRow()); GrdDatos.DataSource = DT; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindData(string VbConsultar) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataTable dtbl = new DataTable(); string VbTxtSql = "EXEC SP_TablasGeneral 7,@C,'','','','','','','CatgrMel','SELECT',0,0,0,0,@Idm,0,'01-01-1','02-01-1','03-01-1'"; Cnx.SelecBD(); using (SqlConnection SCnx = new SqlConnection(Cnx.GetConex())) { SCnx.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, SCnx)) { SC.Parameters.AddWithValue("@C", VbConsultar); SC.Parameters.AddWithValue("@Idm", Session["77IDM"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); } } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); GrdDatos.Rows[0].Cells[0].ColumnSpan = dtbl.Columns.Count; DataRow[] Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindData() { Idioma = (DataTable)ViewState["TablaIdioma"]; DataRow[] Result; DataTable dtbl = new DataTable(); string VbTxtSql = "EXEC Consultas_General_Manto 1,@Pmt,'','','',0,0,0,@ICC,'01-12-00','02-10-00','03-10-00'"; Cnx.SelecBD(); using (SqlConnection SCnx = new SqlConnection(Cnx.GetConex())) { SCnx.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, SCnx)) { SC.Parameters.AddWithValue("@Pmt", TxtBusqueda.Text.Trim()); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); } } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindDataAlaF(string VbConsultar) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataRow[] Result; DataTable dtbl = new DataTable(); Cnx.SelecBD(); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_Pantalla_Parametros 16, @Cns,'','','','ALAFIJA',0,0,0,@ICC,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlCon)) { SC.Parameters.AddWithValue("@Cns", VbConsultar); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); } } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
void BindData(string VbDesmenu) { DataTable dtbl = new DataTable(); Cnx.SelecBD(); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = "EXEC SP_ConfiguracionV2_ 3, @Dsc, @Us,'','','', @Ing,0, @Idm, @ICC,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlCon)) { string borr = ViewState["VblIngMS"].ToString(); SC.Parameters.AddWithValue("@Dsc", VbDesmenu); SC.Parameters.AddWithValue("@Us", Session["C77U"]); SC.Parameters.AddWithValue("@Ing", ViewState["VblIngMS"]); SC.Parameters.AddWithValue("@Idm", Session["77IDM"]); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); GrdDatos.Rows[0].Cells[0].Text = "No existen registros ..!"; GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } } } }
protected void BindData() { Idioma = (DataTable)ViewState["TablaIdioma"]; string VbOpc = ""; if (RdbTodos.Checked == true) { VbOpc = ""; } if (RdbAbierto.Checked == true) { VbOpc = "A"; } if (RdbCumpl.Checked == true) { VbOpc = "C"; } DataRow[] Result; Cnx.ValidarFechas(TxtFechI.Text.Trim(), TxtFechF.Text.Trim(), 2); var Mensj = Cnx.GetMensj(); if (!Mensj.ToString().Trim().Equals("")) { Result = Idioma.Select("Objeto= '" + Mensj.ToString().Trim() + "'"); foreach (DataRow row in Result) { Mensj = row["Texto"].ToString().Trim(); } ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + Mensj + "');", true); Page.Title = ViewState["PageTit"].ToString(); return; } DataTable dtbl = new DataTable(); string VbTxtSql = "EXEC Consultas_General_Manto 4,@Hk,@Prmt,'','',0,0,0,@ICC,@FI,@FF,'03-10-00'"; Cnx.SelecBD(); using (SqlConnection SCnx = new SqlConnection(Cnx.GetConex())) { SCnx.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, SCnx)) { SC.Parameters.AddWithValue("@Prmt", VbOpc); SC.Parameters.AddWithValue("@Hk", DdlAeronave.Text.Trim() == "" ? "" : DdlAeronave.SelectedItem.Text.Trim()); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SC.Parameters.AddWithValue("@FI", Convert.ToDateTime(TxtFechI.Text.Trim())); SC.Parameters.AddWithValue("@FF", Convert.ToDateTime(TxtFechF.Text.Trim())); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); } } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindData(string VbConsultar, string Accion) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataRow[] Result; if (Accion.Equals("UPD")) { Cnx.SelecBD(); using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex())) { string VbTxtSql = " EXEC SP_TablasPlantillaM 12,'','','','','','','','','SELECT',0,0,0,@ICC,0,0,'01-01-1','02-01-1','03-01-1'"; sqlConB.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB)) { SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); using (SqlDataAdapter SDA = new SqlDataAdapter()) { using (DataSet DSTDdl = new DataSet()) { SDA.SelectCommand = SC; SDA.Fill(DSTDdl); DSTDdl.Tables[0].TableName = "Taller"; DSTDdl.Tables[1].TableName = "CCosto"; ViewState["DSTDdl"] = DSTDdl; } } } } } DSTDdl = (DataSet)ViewState["DSTDdl"]; DataTable DT = new DataTable(); DT = DSTDdl.Tables[0].Clone(); Result = DSTDdl.Tables[0].Select("NomTaller LIKE '%" + VbConsultar + "%'"); foreach (DataRow DR in Result) { DT.ImportRow(DR); } if (DT.Rows.Count > 0) { DataView DV = DT.DefaultView; DV.Sort = "IdTaller DESC"; DT = DV.ToTable(); GrdDatos.DataSource = DT; GrdDatos.DataBind(); } else { DT.Rows.Add(DT.NewRow()); GrdDatos.DataSource = DT; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void DdlStatus_TextChanged(object sender, EventArgs e) { if (TxtCodOT.Text.Trim().Equals("")) { return; } if ((int)ViewState["VblCE1"] == 0) { return; } Idioma = (DataTable)ViewState["TablaIdioma"]; if (CkbCancel.Checked == true) { DataRow[] Result = Idioma.Select("Objeto= 'Mens01OTC'"); foreach (DataRow row in Result) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + row["Texto"].ToString() + "');", true); } //La O.T. se encuentra cancelada, no es posible realizar la acción. return; } if (!ViewState["EstadoAnt"].ToString().Trim().Equals(DdlStatus.Text.Trim()) && !DdlStatus.Text.Trim().Equals("")) //Cerrda y se Abre { Cnx.SelecBD(); using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex())) { sqlCon.Open(); using (SqlTransaction Transac = sqlCon.BeginTransaction()) { string VBQuery = "EXEC SP_PANTALLA_OT_Cerradas 5,@E,@US,'','',@COT,0,0,@ICC,'01-1-2009','01-01-1900','01-01-1900'"; using (SqlCommand SC = new SqlCommand(VBQuery, sqlCon, Transac)) { SC.Parameters.AddWithValue("@E", DdlStatus.Text.Trim()); SC.Parameters.AddWithValue("@US", Session["C77U"].ToString()); SC.Parameters.AddWithValue("@COT", TxtCodOT.Text.Trim()); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); try { string PMensj = "", PEstado = "";; // var Mensj = SC.ExecuteScalar(); SqlDataReader SDR = SC.ExecuteReader(); if (SDR.Read()) { PMensj = HttpUtility.HtmlDecode(SDR["Mensj"].ToString().Trim()); PEstado = HttpUtility.HtmlDecode(SDR["EstadoAnt"].ToString().Trim()); } SDR.Close(); if (!PMensj.ToString().Trim().Equals("")) { DataRow[] Result = Idioma.Select("Objeto= '" + PMensj.ToString().Trim() + "'"); foreach (DataRow row in Result) { PMensj = row["Texto"].ToString().Trim(); } ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + PMensj + "');", true); Transac.Rollback(); GrdDatos.DataSource = null; GrdDatos.DataBind(); DdlStatus.Text = ViewState["EstadoAnt"].ToString().Trim(); return; } Transac.Commit(); sqlCon.Close(); GrdDatos.DataSource = null; GrdDatos.DataBind(); ViewState["EstadoAnt"] = PEstado.Trim(); Traerdatos(TxtCodOT.Text.Trim(), "UPD"); } catch (Exception ex) { Transac.Rollback(); DataRow[] Result = Idioma.Select("Objeto= 'MensErrMod'"); foreach (DataRow row in Result) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + row["Texto"].ToString() + "');", true); } //Error en el ingreso')", true); Cnx.UpdateErrorV2(Session["C77U"].ToString(), ViewState["PFileName"].ToString().Trim(), "UPDATE", ex.StackTrace.Substring(ex.StackTrace.Length - 300, 300), ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString()); } } } } } }
protected void BindDPasos(string VbOT) { Idioma = (DataTable)ViewState["TablaIdioma"]; DataTable dtbl = new DataTable(); string VbTxtSql = "EXEC SELECT_Pasos_OT_Cerradas @O,@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8, @ICC, @Idm"; string VP1 = "", VP2 = "", VP3 = "", VP4 = "", VP5 = "", VP6 = "", VP7 = "", VP8 = ""; DataRow[] Result = Idioma.Select("Objeto= 'BtnMroInsPre'"); foreach (DataRow row in Result) { VP1 = row["Texto"].ToString().Trim(); } //Inspección Preliminar Result = Idioma.Select("Objeto= 'BtnMroPrDes'"); foreach (DataRow row in Result) { VP2 = row["Texto"].ToString().Trim(); } //Pruebas antes de desarme Result = Idioma.Select("Objeto= 'BtnMroRteDes'"); foreach (DataRow row in Result) { VP3 = row["Texto"].ToString().Trim(); } //Reporte del desarme Result = Idioma.Select("Objeto= 'BtnMroDanOc'"); foreach (DataRow row in Result) { VP4 = row["Texto"].ToString().Trim(); } //Daños Escondidos Result = Idioma.Select("Objeto= 'BtnMroAccCorr'"); foreach (DataRow row in Result) { VP5 = row["Texto"].ToString().Trim(); } //Proceso de Inspección Result = Idioma.Select("Objeto= 'BtnMroPrueF'"); foreach (DataRow row in Result) { VP6 = row["Texto"].ToString().Trim(); } //Prueba Final Result = Idioma.Select("Objeto= 'BtnMroCumpl'"); foreach (DataRow row in Result) { VP7 = row["Texto"].ToString().Trim(); } //Cumplido / Verificado Result = Idioma.Select("Objeto= 'BtnMroTrabEje'"); foreach (DataRow row in Result) { VP8 = row["Texto"].ToString().Trim(); } //Trabajo Ejecutado Cnx.SelecBD(); using (SqlConnection SCnx = new SqlConnection(Cnx.GetConex())) { SCnx.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, SCnx)) { SC.Parameters.AddWithValue("@O", VbOT); SC.Parameters.AddWithValue("@P1", VP1); SC.Parameters.AddWithValue("@P2", VP2); SC.Parameters.AddWithValue("@P3", VP3); SC.Parameters.AddWithValue("@P4", VP4); SC.Parameters.AddWithValue("@P5", VP5); SC.Parameters.AddWithValue("@P6", VP6); SC.Parameters.AddWithValue("@P7", VP7); SC.Parameters.AddWithValue("@P8", VP8); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SC.Parameters.AddWithValue("@Idm", Session["77IDM"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(dtbl); } } if (dtbl.Rows.Count > 0) { GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); } else { dtbl.Rows.Add(dtbl.NewRow()); GrdDatos.DataSource = dtbl; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); GrdDatos.Rows[0].Cells[0].ColumnSpan = dtbl.Columns.Count; DataRow[] Result1 = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result1) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindData(string Accion) { if (Accion.Equals("UPD")) { using (SqlConnection sqlCon = new SqlConnection(Cnx.BaseDatosPrmtr())) { string VbTxtSql = " EXEC SP_Configuracion 2, @Frm,'','','','',0,0,0,0,'01-01-1','02-01-1','03-01-1'"; sqlCon.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlCon)) { SC.Parameters.AddWithValue("@Frm", DdlForm.Text.Trim()); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); SqlDataAdapter SDA = new SqlDataAdapter(); SDA.SelectCommand = SC; SDA.Fill(DTDet); ViewState["DTDet"] = DTDet; } } } string StrCondic = ""; string VbCorreg = ""; if (CkbSinCorr.Checked == true) { VbCorreg = " AND (Aleman = '' OR Aleman = '0')"; } DTDet = (DataTable)ViewState["DTDet"]; DataTable DT = new DataTable(); DT = DTDet.Clone(); if (RdbMens.Checked == true) { StrCondic = " Espanol LIKE '%" + TxtBusqueda.Text.Trim() + "%'" + VbCorreg; } if (RdbIngles.Checked == true) { StrCondic = "Ingles LIKE '%" + TxtBusqueda.Text.Trim() + "%'" + VbCorreg; } if (RdbObj.Checked == true) { StrCondic = "Objeto LIKE '%" + TxtBusqueda.Text.Trim() + "%'" + VbCorreg; } if (RdbDesc.Checked == true) { StrCondic = " Descripcion LIKE '%" + TxtBusqueda.Text.Trim() + "%'" + VbCorreg; } DataRow[] DR = DTDet.Select(StrCondic); if (IsIENumerableLleno(DR)) { DT = DR.CopyToDataTable(); } if (DT.Rows.Count > 0) { DataView DV = DT.DefaultView; DV.Sort = "IdFormulario,Descripcion"; DT = DV.ToTable(); GrdDatos.DataSource = DT; GrdDatos.DataBind(); } else { DT.Rows.Add(DT.NewRow()); GrdDatos.DataSource = DT; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); { GrdDatos.Rows[0].Cells[0].Text = "Vacío"; } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } }
protected void BindData(string Accion) { try { Idioma = (DataTable)ViewState["TablaIdioma"]; string VbTxtSql, VbCodAnt; if (Accion.Equals("UPD")) { Cnx.SelecBD(); using (SqlConnection SCnx = new SqlConnection(Cnx.GetConex())) { string VbHK; if (DdlAeronave.Text.Equals("")) { VbHK = ""; } else { VbHK = DdlAeronave.SelectedItem.Text.Trim(); } if (VbHK.Trim().Equals("")) { VbTxtSql = "EXEC Consultas_General 6, '', '', '',@Todo,@Di, @ICC, '06-01-2012', '06-01-2012'"; } else { VbTxtSql = "EXEC Consultas_General 6, @A, '', '',@Todo,@Di, @ICC, '06-01-2012', '06-01-2012'"; } SCnx.Open(); using (SqlCommand SC = new SqlCommand(VbTxtSql, SCnx)) { SC.Parameters.AddWithValue("@Todo", CkbVisualTodo.Checked == true ? 1 : 0); SC.Parameters.AddWithValue("@Di", TxtDiaVisual.Text); SC.Parameters.AddWithValue("@A", VbHK); SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]); using (SqlDataAdapter SDA = new SqlDataAdapter()) { using (DataSet DST = new DataSet()) { SDA.SelectCommand = SC; SDA.Fill(DST); DST.Tables[0].TableName = "Servicios"; DST.Tables[1].TableName = "HK"; DST.Tables[2].TableName = "SvcRst"; DST.Tables[3].TableName = "UbicacionSinInst"; ViewState["DST"] = DST; } } } } } DST = (DataSet)ViewState["DST"]; if (DST.Tables[0].Rows.Count > 0) { GrdDatos.DataSource = DST.Tables[0]; GrdDatos.DataBind(); } else { DST.Tables[0].Rows.Add(DST.Tables[0].NewRow()); GrdDatos.DataSource = DST.Tables[0]; GrdDatos.DataBind(); GrdDatos.Rows[0].Cells.Clear(); GrdDatos.Rows[0].Cells.Add(new TableCell()); DataRow[] Result = Idioma.Select("Objeto= 'SinRegistros'"); foreach (DataRow row in Result) { GrdDatos.Rows[0].Cells[0].Text = row["Texto"].ToString(); } GrdDatos.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center; } VbCodAnt = DdlAeronave.Text.Trim(); DdlAeronave.DataSource = DST.Tables[1]; DdlAeronave.DataTextField = "Matricula"; DdlAeronave.DataValueField = "CodAeronave"; DdlAeronave.DataBind(); DdlAeronave.Text = VbCodAnt; } catch (Exception Ex) { DataRow[] Result = Idioma.Select("Objeto= 'MensIncovCons'"); foreach (DataRow row in Result) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + row["Texto"].ToString() + "');", true); } // Cnx.UpdateErrorV2(Session["C77U"].ToString(), ViewState["PFileName"].ToString().Trim(), "Consulta Proximos cumplimientos", Ex.StackTrace.Substring(Ex.StackTrace.Length > 300 ? Ex.StackTrace.Length - 300 : 0, 300), Ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString()); } }