protected void Page_Load(object sender, EventArgs e) { if (this.Session["usuario"] == null) { this.Response.Redirect("~/InicioQYMS2.aspx"); } this.usuario = (UsuarioBC)this.Session["usuario"]; if (!this.IsPostBack) { TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); SiteBC site = new SiteBC(); utils.CargaDrop(this.ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos()); this.utils.CargaDrop(this.ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos()); this.utils.CargaDrop(this.ddl_editTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); this.utils.CargaDrop(this.ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos()); this.utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); YMS_ZONA_BC yms = new YMS_ZONA_BC(); utils.CargaDropNormal(this.ddl_site, "ID", "NOMBRE", yms.ObteneSites(this.usuario.ID)); this.utils.CargaDrop(this.ddl_buscarMotivo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1")); this.ltl_contenidoCaract.Text = this.crearContenido(); } this.ObtenerTrailer(false); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); ShorteckBC s = new ShorteckBC(); //rlcli.DataSource = dt; //rlcli.DataTextField = "DESCRIPCION"; //rlcli.DataValueField = "ID"; //rlcli.DataBind(); //utils.CargaCheck(this.chklst_editCaracteristicas, "ID", "DESCRIPCION", catt.obtenerTodo()); d.Site_Todos(ddl_buscarSite); ddl_buscarSite_IndexChanged(null, null); d.Transportista_Todos(ddl_editTran); //utils.CargaDrop(ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos()); utils.CargaDrop(ddl_editTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); utils.CargaDrop(ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos()); utils.CargaDrop(ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); utils.CargaDrop(ddTipoBloqueo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1")); utils.CargaDrop(ddl_editShorteck, "SHOR_ID", "SHOR_DESC", s.ObtenerTodos()); ltl_contenidoCaract.Text = crearContenido(); ObtenerTrailer(true); } }
protected void btn_grabar_Click(object sender, EventArgs e) { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); tipo_trailer.DESCRIPCION = this.txt_editDesc.Text; tipo_trailer.COLOR = this.txt_editColor.Text; if (this.hf_idTipoTrailer.Value == "") { if (tipo_trailer.Crear(tipo_trailer)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Tipo trailer creado exitosamente');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al agregar tipo trailer. Intente nuevamente.');", true); } this.hf_idTipoTrailer.Value = ""; this.txt_editDesc.Text = ""; } else { tipo_trailer.ID = int.Parse(this.hf_idTipoTrailer.Value); if (tipo_trailer.Modificar(tipo_trailer)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Tipo trailer modificado exitosamente');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al modificar tipo trailer. Intente nuevamente.');", true); } } this.ObtenerTipoTrailer(true); }
private void CargaDrops() { DataTable dt = new TrailerTipoBC().ObtenerTodo(); utils.CargaDrop(ddl_editTipo, "TRTI_ID", "TRTI_DESC", dt); utils.CargaDropTodos(ddl_buscarTipo, "TRTI_ID", "TRTI_DESC", dt); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["usuario"] == null) { Response.Redirect("../InicioQYMS.aspx"); } usuario = (UsuarioBC)Session["usuario"]; CaractCargaBC catt = new CaractCargaBC(); TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); SiteBC site = new SiteBC(); DataTable dt = catt.obtenerTodo(); //rlcli.DataSource = dt; //rlcli.DataTextField = "DESCRIPCION"; //rlcli.DataValueField = "ID"; //rlcli.DataBind(); //utils.CargaCheck(this.chklst_editCaracteristicas, "ID", "DESCRIPCION", catt.obtenerTodo()); utils.CargaDrop(ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos()); utils.CargaDrop(ddl_editTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); utils.CargaDrop(ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos()); utils.CargaDrop(ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); utils.CargaDropNormal(ddl_site, "ID", "NOMBRE", site.ObtenerTodos()); utils.CargaDrop(ddl_buscarMotivo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1")); ltl_contenidoCaract.Text = crearContenido(); ObtenerTrailer(true); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["usuario"] == null) { Response.Redirect("~/InicioQYMS2.aspx"); } usuario = (UsuarioBC)Session["Usuario"]; if (!IsPostBack) { CaractCargaBC catt = new CaractCargaBC(); TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); YMS_ZONA_BC yms = new YMS_ZONA_BC(); DataTable dt = catt.obtenerTodo(); CargaDrops c = new CargaDrops(); c.Proveedor_Todos(ddl_buscarProveedor); if (usuario.PROVEEDOR != "") { this.ddl_buscarProveedor.SelectedValue = usuario.ID_PROVEEDOR.ToString(); this.ddl_buscarProveedor.Enabled = false; } DataTable ds = yms.ObteneSites(((UsuarioBC)Session["Usuario"]).ID); utils.CargaDropNormal(this.ddl_buscarSite, "ID", "NOMBRE", ds); txt_buscarDesde.Text = DateTime.Now.ToShortDateString(); txt_buscarHasta.Text = DateTime.Now.ToShortDateString(); ObtenerPreIngresos(true); } }
protected void Page_Load(object sender, EventArgs e) { this.usuario = (UsuarioBC)this.Session["Usuario"]; if (!this.IsPostBack) { this.drops.Site(this.ddl_Site, this.usuario.ID); //SiteBC site = new SiteBC(); //utils.CargaDrop(this.ddl_Site, "ID", "NOMBRE", site.ObtenerTodos()); ddl_Site_SelectedIndexChanged(null, null); this.hf_idLugar.Value = ""; TrailerTipoBC tt = new TrailerTipoBC(); this.crearLeyenda(tt.obtenerTodo(), this.pnl_leyendaTipoTrailer, "DESCRIPCION"); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "graba", "graba_tab();", true); TrailerTipoBC tt = new TrailerTipoBC(); this.crearLeyenda(tt.obtenerTodo(), this.pnl_leyendaTipoTrailer, "DESCRIPCION"); if (this.ddl_Site.SelectedIndex > 0) { this.dv_leyendaEstado.Visible = true; SolicitudBC s = new SolicitudBC(); DataTable dtl = s.ObtenerColorXSite(int.Parse(this.ddl_Site.SelectedValue)); // crearLeyenda(dtl, pnl_leyendaEstado, "SOLICITUD_ESTADO"); //leyendaEstadoSolicitud(int.Parse(ddl_Site.SelectedValue)); } else { this.dv_leyendaEstado.Visible = false; } } }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); if (e.CommandName == "ELIMINAR") { this.hf_idTipoTrailer.Value = e.CommandArgument.ToString(); tipo_trailer = tipo_trailer.obtenerXID(int.Parse(this.hf_idTipoTrailer.Value)); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalConfirmacion();", true); } }
private void CargaDrops() { DataTable dt; dt = new HorarioBC().ObtenerTodo(); utils.CargaDropNormal(ddl_buscarHorario, "HORA_ID", "HORA_COD", dt); dt = new TrailerTipoBC().ObtenerTodo(); utils.CargaDropTodos(ddl_editTipo, "TRTI_ID", "TRTI_DESC", dt); ddl_editTipo.SelectedIndex = 0; }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { SiteBC s = new SiteBC(); TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); this.utils.CargaDrop(this.ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos()); this.utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); this.utils.CargaDrop(this.ddl_site, "ID", "DESCRIPCION", s.ObtenerTodos()); } }
protected void gv_listar_RowEditing(object sender, GridViewEditEventArgs e) { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); this.gv_listar.SelectedIndex = e.NewEditIndex; this.hf_idTipoTrailer.Value = this.gv_listar.SelectedDataKey.Value.ToString(); tipo_trailer = tipo_trailer.obtenerXID(int.Parse(this.gv_listar.SelectedDataKey.Value.ToString())); this.txt_editDesc.Text = tipo_trailer.DESCRIPCION; this.txt_editColor.Text = tipo_trailer.COLOR; //rcp_editColor.SelectedColor = System.Drawing.ColorTranslator.FromHtml(tipo_trailer.COLOR); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalEditarTipoTrailer();", true); }
public void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); utils.CargaDrop(ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos()); CaractCargaBC catt = new CaractCargaBC(); DataTable dt = catt.obtenerTodo(); // rlcli.DataSource = dt; // rlcli.DataTextField = "DESCRIPCION"; // rlcli.DataValueField = "ID"; // rlcli.DataBind(); } }
private void CargaDrops() { DataTable dt; dt = new RegionBC().ObtenerTodo(); utils.CargaDropTodos(ddl_buscarRegion, "REGI_ID", "REGI_NOMBRE", dt); ddl_buscarRegion_SelectedIndexChanged(null, null); dt = new HorarioBC().ObtenerTodo(); utils.CargaDropNormal(ddl_buscarHorario, "HORA_ID", "HORA_COD", dt); dt = new TrailerTipoBC().ObtenerTodo(); utils.CargaDropTodos(ddl_vehiculoTipo, "TRTI_ID", "TRTI_DESC", dt); ddl_vehiculoTipo.SelectedIndex = 0; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["Usuario"] == null) { this.Response.Redirect("~/InicioQYMS2.aspx"); } this.usuario = (UsuarioBC)this.Session["Usuario"]; if (!this.IsPostBack) { TrailerTipoBC tipo = new TrailerTipoBC(); this.drop.Site_Normal(this.dropsite, this.usuario.ID); this.drop.Transportista(this.ddl_buscarTransportista); this.utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); this.ObtenerTrailer(true); } }
private void CargaDrops() { TransportistaBC tran = new TransportistaBC(); TrailerTipoBC tipo = new TrailerTipoBC(); ShorteckBC s = new ShorteckBC(); DataTable dt; dt = tran.ObtenerTodos(); utils.CargaDrop(this.ddl_editTran, "ID", "NOMBRE", dt); utils.CargaDrop(this.ddl_buscarTransportista, "ID", "NOMBRE", dt); dt = tipo.obtenerTodo(); utils.CargaDrop(this.ddl_editTipo, "ID", "DESCRIPCION", dt); utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", dt); utils.CargaDrop(this.ddTipoBloqueo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1")); utils.CargaDrop(this.ddl_editShorteck, "SHOR_ID", "SHOR_DESC", s.ObtenerTodos()); }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EDITAR") { hf_id.Value = e.CommandArgument.ToString(); TrailerTipoBC tipo_trailer = new TrailerTipoBC().ObtenerXId(Convert.ToInt32(e.CommandArgument)); txt_editDesc.Text = tipo_trailer.TRTI_DESC; txt_editColor.Text = tipo_trailer.TRTI_COLOR; utils.AbrirModal(this, "modalEdit"); } if (e.CommandName == "ELIMINAR") { hf_id.Value = e.CommandArgument.ToString(); utils.AbrirModal(this, "modalConf"); } }
private void ObtenerTipoTrailer(bool forzarBD) { if (ViewState["lista"] == null || forzarBD) { TrailerTipoBC tt = new TrailerTipoBC(); ViewState["lista"] = tt.ObtenerTodo(txt_buscarNombre.Text); } DataView dw = new DataView((DataTable)ViewState["lista"]); if (ViewState["sortExpresion"] != null && ViewState["sortExpresion"].ToString() != "") { dw.Sort = (String)ViewState["sortExpresion"]; } gv_listar.DataSource = dw.ToTable(); gv_listar.DataBind(); }
protected void btn_eliminar_Click(object sender, EventArgs e) { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); if (tipo_trailer.Eliminar(int.Parse(this.hf_idTipoTrailer.Value))) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('Tipo trailer eliminado exitosamente');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al eliminar tipo trailer. Revise si tiene otros datos asociados');", true); } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalTipoTrailer')", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar_confirmacion", "cerrarModal('modalConfirmacion')", true); this.ObtenerTipoTrailer(true); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("~/InicioQYMS2.aspx"); } usuario = (UsuarioBC)Session["Usuario"]; if (!IsPostBack) { TrailerTipoBC tipo = new TrailerTipoBC(); drop.Site_Normal(dropsite, usuario.ID); drop.Transportista(ddl_buscarTransportista); utils.CargaDrop(ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo()); drop_SelectedIndexChanged(null, null); ObtenerTrailer(true); } }
private void ObtenerTipoTrailer(bool forzarBD) { if (this.ViewState["lista"] == null || forzarBD) { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); string descripcion = this.txt_buscarNombre.Text; DataTable dt = tipo_trailer.obtenerXParametro(descripcion); this.ViewState["lista"] = dt; } DataView dw = new DataView((DataTable)this.ViewState["lista"]); if (this.ViewState["sortExpresion"] != null && this.ViewState["sortExpresion"].ToString() != "") { dw.Sort = (String)this.ViewState["sortExpresion"]; } this.gv_listar.DataSource = dw.ToTable(); this.gv_listar.DataBind(); }
protected void btn_editGuardar_Click(object sender, EventArgs e) { try { TrailerTipoBC tt = new TrailerTipoBC(); tt.TRTI_DESC = txt_editDesc.Text; tt.TRTI_COLOR = txt_editColor.Text; if (hf_id.Value == "") { if (tt.Guardar()) { utils.ShowMessage2(this, "guardar", "success_nuevo"); utils.CerrarModal(this, "modalEdit"); } else { utils.ShowMessage2(this, "guardar", "error_nuevo"); } } else { tt.TRTI_ID = Convert.ToInt32(hf_id.Value); if (tt.Guardar()) { utils.ShowMessage2(this, "guardar", "success_modificar"); } else { utils.ShowMessage2(this, "guardar", "error_modificar"); } } } catch (Exception ex) { utils.ShowMessage(this, ex.Message, "error", false); } finally { ObtenerTipoTrailer(true); } }
protected void btn_confEliminar_Click(object sender, EventArgs e) { try { TrailerTipoBC tipo_trailer = new TrailerTipoBC(); if (tipo_trailer.Eliminar(Convert.ToInt32(hf_id.Value))) { utils.ShowMessage2(this, "eliminar", "success"); utils.CerrarModal(this, "modalConf"); } else { utils.ShowMessage2(this, "eliminar", "error"); } } catch (Exception ex) { utils.ShowMessage(this, ex.Message, "error", false); } finally { ObtenerTipoTrailer(true); } }
public bool Crear(TrailerTipoBC trailer) { return(tran.TrailerTipo_Crear(trailer)); }
public bool Modificar(TrailerTipoBC trailer) { return(tran.TrailerTipo_Modificar(trailer)); }