public DsPuntosRecepcion GetPuntosRecepcionDataSet() { DsPuntosRecepcion ds = new DsPuntosRecepcion(); Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "PuntoRecepcionSEL"); return(ds); }
public bool ConsultarByDescripcion() { DsPuntosRecepcion ds = new DsPuntosRecepcion(); SqlParameter pCodigo = new SqlParameter("@RazonSocial", this.RazonSocial); Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "PuntoRecepcionByRazonSocialSEL", pCodigo); if (ds.Datos.Rows.Count > 0) { DsPuntosRecepcion.DatosRow dr = (DsPuntosRecepcion.DatosRow)ds.Datos.Rows[0]; this.PuntoRecepcionID = dr.PuntoRecepcionID; this.Codigo = dr.Codigo; this.RazonSocial = dr.RazonSocial; this.Nombre = dr.IsNombreNull() ? null : dr.Nombre; this.Email = dr.IsEmailNull() ? null : dr.Email; this.FechaAlta = dr.FechaAlta; //SFE: 16/10/2012. Modificacion de Puntos de Recepcion. No tiene mas una ag de ref de redespacho a este nivel. //this.AgenciaReferenciaRedespacho = dr.AgenciaReferenciaRedespachoID; //this.EsReceptora = dr.EsReceptora; //this.Domicilio.DomicilioID = dr.DomicilioID; //this.Responsable.ResponsableID = dr.ResponsableID; //this.EntregaDomicilio = dr.EntregaDomicilio; //this.EstadoAgencia = (SisPack.EstadoAgencia)dr.EstadoAgenciaID; //this.EmpresaTercerosEntregaID = dr.IsEmpresaTercerosEntregaIDNull() ? 0 : dr.EmpresaTercerosEntregaID; //this.EmpresaTercerosID = dr.EmpresaTercerosID; //this.TarifarioRetiroEntregaID = dr.IsTarifarioRetiroEntregaIDNull() ? 0 : dr.TarifarioRetiroEntregaID; //this.NoRestringirAgencias = dr.NoRestringirAgenciasVisualizacion; } return(true); }
public DsPuntosRecepcion GetAgenciasALLByAgenciaReferencia() { DsPuntosRecepcion ds = new DsPuntosRecepcion(); SqlParameter pAgenciaReferenciaRedespachoID = new SqlParameter("@AgenciaReferenciaID", this.AgenciaReferenciaRedespacho); Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "GetAgenciasALLByAgenciaReferenciaID", pAgenciaReferenciaRedespachoID); return(ds); }
public DsPuntosRecepcion.DatosRow GetPuntoRecepcionDatosRow() { DsPuntosRecepcion ds = new DsPuntosRecepcion(); SqlParameter pPuntoRecepcionID = new SqlParameter("@PuntoRecepcionID", this.PuntoRecepcionID); Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "PuntoRecepcionONE", pPuntoRecepcionID); return((DsPuntosRecepcion.DatosRow)ds.Datos.Rows[0]); }
public DsPuntosRecepcion VisualizarDestinosConsolidado(int agenciaID, int tipoDestinoID, int empresaTercerosID) { DsPuntosRecepcion ds = new DsPuntosRecepcion(); SqlParameter pAgenciaID = new SqlParameter("@AgenciaID", Utiles.BaseDatos.IntToSql(agenciaID)); SqlParameter pTipoDestinoID = new SqlParameter("@TipoDestinoID", Utiles.BaseDatos.IntToSql(tipoDestinoID)); SqlParameter pEmpresaTercerosID = new SqlParameter("@EmpresaTercerosID", Utiles.BaseDatos.IntToSql(empresaTercerosID)); Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "VisualizarDestinosConsolidados", pAgenciaID, pEmpresaTercerosID, pTipoDestinoID); return(ds); }
private void LlenarComoDestinos() { txtEmpresaID.Text = busqEmpresaTerceros1.EmpresaTercerosID; int tipoDestinoID = rbtCasoA.Checked ? 6 : 1; int empresaTercerosID = Utiles.Validaciones.obtieneEntero(busqEmpresaTerceros1.EmpresaTercerosID); string agenciaID = AgenciaConectadaID.ToString(); DsPuntosRecepcion ds = SisPackController.LlenarCombos.VisualizarDestino(ddlDestino, agenciaID, tipoDestinoID, empresaTercerosID); ddlDestino.Items.Clear(); ddlDestino.DataSource = ds.Datos; ddlDestino.DataTextField = "RazonSocial"; ddlDestino.DataValueField = "PuntoRecepcionID"; ddlDestino.DataBind(); ddlDestino.Items.Insert(0, new ListItem("Elija destino", string.Empty)); }
private void BindGrid(int currentPage) { SisPackController.AdministrarGrillas.Configurar(this.dtgPuntosRecepcion, "PuntoRecepcionID", this.CantidadOpciones); IPuntoRecepcion oPunto = PuntoRecepcionFactory.GetPuntoRecepcion(); string razonSocial = this.txtRazonSocial.Text; string provinciaDescrip = this.txtProvincia.Text; string sucursalDGI = this.txtSucursalDGI.Text; //dtgAgencias.DataSource = oAgencia.GetAgenciasConsultaDataSet(); DsPuntosRecepcion ds = oPunto.GetPuntosRecepcionDataSet(); //dtgAgencias.DataSource= ds.Datos.Select("UnidadNegocioID = " + this.UnidadNegocioID + " AND RazonSocial LIKE '" + razonSocial + "%' AND ProvinciaDescrip LIKE '%" + provinciaDescrip + "%'","RazonSocial"); this.dtgPuntosRecepcion.DataSource = (DsPuntosRecepcion.DatosRow[])ds.Datos.Select("Codigo LIKE '" + sucursalDGI + "%' AND RazonSocial LIKE '" + this.txtRazonSocial.Text + "%'" + " AND ProvinciaDescrip LIKE '" + this.txtProvincia.Text + "%'", "RazonSocial"); dtgPuntosRecepcion.CurrentPageIndex = currentPage; dtgPuntosRecepcion.DataBind(); }
private void BindGridPuntosRecepcionCL() { SisPackController.AdministrarGrillas.Configurar(this.dtgPuntosRecepcion, "PuntoRecepcionID", this.CantidadOpciones); try { IPuntoRecepcion puntoRecepcion = PuntoRecepcionFactory.GetPuntoRecepcion(); DsPuntosRecepcion ds = null; ds = puntoRecepcion.GetPuntosRecepcionDataSet(); string sucursal = this.txtSucursal.Text; string razon = this.txtRazonSocial.Text; string filtro = "Codigo LIKE '" + sucursal + "%' AND RazonSocial LIKE '" + razon + "%'"; DsPuntosRecepcion.DatosRow[] drPuntoRecepcion = (DsPuntosRecepcion.DatosRow[])ds.Datos.Select(filtro); dtgPuntosRecepcion.DataSource = drPuntoRecepcion; dtgPuntosRecepcion.DataBind(); if (Session["dsPuntosRecepcionCL"] != null) { DsPuntosRecepcion dsPuntosRecepcion = (DsPuntosRecepcion)Session["dsPuntosRecepcionCL"]; foreach (DataGridItem item in this.dtgPuntosRecepcion.Items) { if (dsPuntosRecepcion.Datos.Select("PuntoRecepcionID = " + Convert.ToInt32(item.Cells[0].Text.Trim())).Length > 0) { ((CheckBox)this.dtgPuntosRecepcion.Items[item.ItemIndex].Cells[3].FindControl("ckSeleccionarP")).Checked = true; } } dsPuntosRecepcion = null; } ds = null; puntoRecepcion = null; } catch (Exception ex) { throw ex; } }
private void BindGridPuntosRecepcion() { SisPackController.AdministrarGrillas.Configurar(this.dtgPuntosRecepcion, "PuntoRecepcionID", this.CantidadOpciones); try { IPuntoRecepcion puntoRecepcion = PuntoRecepcionFactory.GetPuntoRecepcion(); DsPuntosRecepcion ds = null; ds = puntoRecepcion.GetPuntosRecepcionDataSet(); string sucursal = this.txtSucursal.Text; string razon = this.txtRazonSocial.Text; string filtroEspecial = this.txtFiltro.Text; string agenciaActual = this.txtAgenciaActual.Text; string filtro = "Codigo LIKE '" + sucursal + "%' AND RazonSocial LIKE '" + razon + "%'"; //Agregar que si no le paso una agencia actual, no la tenga que buscar. /* if (filtroEspecial ==NegociosSisPackInterface.SisPack.TipoAgencia.Cabecera.ToString()) * { * if(agenciaActual != null && agenciaActual.Length > 0) * filtro += " AND EsCabecera = true AND AgenciaID <> " + agenciaActual; * else * filtro += " AND EsCabecera = true" ; * } * else if (filtroEspecial ==NegociosSisPackInterface.SisPack.TipoAgencia.Madre.ToString()) * filtro += " AND (AgenciaMadre IS NULL OR AgenciaMadre <> " + agenciaActual + " ) AND AgenciaID <> " + agenciaActual; */ DsPuntosRecepcion.DatosRow[] drPuntoRecepcion = (DsPuntosRecepcion.DatosRow[])ds.Datos.Select(filtro); dtgPuntosRecepcion.DataSource = drPuntoRecepcion; dtgPuntosRecepcion.DataBind(); } catch (Exception ex) { throw ex; //this.txtErrorMsg.Text = "Error al consultar datos de agencias: " + ex.Message; } }
public bool ConsultarAgenciaRedespacho() { DsPuntosRecepcion.DatosRow dr; if (this.PuntoRecepcionID == 0) { DsPuntosRecepcion ds = this.GetPuntosRecepcionDataSet(); if (ds == null) { return(false); } dr = ds.Datos.FindByPuntoRecepcionID(this.PuntoRecepcionID); if (dr == null) { return(false); } } else { dr = this.GetPuntoRecepcionDatosRow(); if (dr == null) { return(false); } } this.CargarFila(dr); //this.Empresa.Consultar(); //((Domicilio)this.Domicilio).Consultar(); //this.Responsable.Consultar(); //this.ServiciosPuntoRecepcionCol.PuntoRecepcionID = this.PuntoRecepcionID; //this.ServiciosPuntoRecepcionCol.Consultar(); ////this.ModificaPuntoVenta = dr.ModificaPuntoVenta; //this.ModificaPuntoRecepcion = dr.ModificaPuntoRecepcion; ////this.UltimoNroRendicion = dr.IsUltimoNroRendicionNull() ? 0 : dr.UltimoNroRendicion; return(true); }
//Puntos Recepción protected void ckSeleccionarP_CheckChanged(object sender, EventArgs e) { try { if (Convert.ToInt32(Request.QueryString["ConLineas"].ToString()) > 0) { CheckBox box = (CheckBox)sender; DataGridItem item = (DataGridItem)box.NamingContainer; DsPuntosRecepcion.DatosRow[] unPunto; DsPuntosRecepcion puntoSel = Session["dsPuntosRecepcionCL"] != null ? (DsPuntosRecepcion)Session["dsPuntosRecepcionCL"] : new DsPuntosRecepcion(); string puntoRecepcionID = item.Cells[0].Text; unPunto = (DsPuntosRecepcion.DatosRow[])puntoSel.Datos.Select("PuntoRecepcionID=" + puntoRecepcionID); if (box.Checked) { if (unPunto.Length == 0) { DsPuntosRecepcion.DatosRow row = puntoSel.Datos.NewDatosRow(); row.PuntoRecepcionID = Convert.ToInt32(item.Cells[0].Text); row.Nombre = ""; row.FechaAlta = System.DateTime.Today; row.Codigo = item.Cells[1].Text; row.DomicilioID = 0; row.RazonSocial = item.Cells[2].Text; row.EstadoAgenciaID = 0; puntoSel.Datos.Rows.Add(row); row = null; } else { puntoSel.Datos.RemoveDatosRow(unPunto[0]); } } else { puntoSel.Datos.RemoveDatosRow(unPunto[0]); } Session["dsPuntosRecepcionCL"] = puntoSel; box = null; item = null; unPunto = null; puntoSel = null; } else { CheckBox box = (CheckBox)sender; DataGridItem item = (DataGridItem)box.NamingContainer; DsPuntosRecepcion.DatosRow[] unPunto; DsPuntosRecepcion puntoSel = Session["dsPuntosRecepcion"] != null ? (DsPuntosRecepcion)Session["dsPuntosRecepcion"] : new DsPuntosRecepcion(); string puntoRecepcionID = item.Cells[0].Text; unPunto = (DsPuntosRecepcion.DatosRow[])puntoSel.Datos.Select("PuntoRecepcionID=" + puntoRecepcionID); if (box.Checked) { if (unPunto.Length == 0) { DsPuntosRecepcion.DatosRow row = puntoSel.Datos.NewDatosRow(); row.PuntoRecepcionID = Convert.ToInt32(item.Cells[0].Text); row.Nombre = ""; row.FechaAlta = System.DateTime.Today; row.Codigo = item.Cells[1].Text; row.DomicilioID = 0; row.RazonSocial = item.Cells[2].Text; row.EstadoAgenciaID = 0; puntoSel.Datos.Rows.Add(row); row = null; } else { puntoSel.Datos.RemoveDatosRow(unPunto[0]); } } else { puntoSel.Datos.RemoveDatosRow(unPunto[0]); } Session["dsPuntosRecepcion"] = puntoSel; box = null; item = null; unPunto = null; puntoSel = null; } } catch (Exception ex) { ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(ex.Message + " En CheckChanged"); } }
private void Buscar() { int total = 0; try { if (parametro != "3") //si no se un punto de recepción { #region Agencia IAgencia agencia = AgenciaFactory.GetAgencia(); DsAgencias ds = agencia.GetAgenciasDataSet(); string filtro = "SucursalDGI LIKE '" + this.sucursal + "%' AND RazonSocial LIKE '" + this.razonSocial + "%'"; //Agregar que si no le paso una agencia actual, no la tenga que buscar. if (this.filtroEspecial == NegociosSisPackInterface.SisPack.TipoAgencia.Cabecera.ToString()) { if (this.agenciaActual != null && this.agenciaActual.Length > 0) { filtro += " AND EsCabecera = true AND AgenciaID <> " + this.agenciaActual; } else { filtro += " AND EsCabecera = true"; } } else if (this.filtroEspecial == NegociosSisPackInterface.SisPack.TipoAgencia.Madre.ToString()) { filtro += " AND (AgenciaMadre IS NULL OR AgenciaMadre <> " + this.agenciaActual + " ) AND AgenciaID <> " + this.agenciaActual; } DsAgencias.DatosRow[] drLista = (DsAgencias.DatosRow[])ds.Datos.Select(filtro); total = drLista.Length; if (total > 0) { if (total == 1) { DsAgencias.DatosRow dr = drLista[0]; this.txtAgenciaID.Text = dr.AgenciaID.ToString(); this.txtSucursal.Text = dr.SucursalDGI; this.txtRazonSocial.Text = dr.RazonSocial; this.txtErrorMsg.Text = ""; this.txtOpen.Text = ""; } else { this.txtSucursal.Text = this.sucursal; this.txtRazonSocial.Text = this.razonSocial; this.txtOpen.Text = "S"; this.txtFiltro.Text = this.filtroEspecial; this.txtAgenciaActual.Text = this.agenciaActual; } this.txtParametro.Text = this.parametro; } else { this.txtAgenciaID.Text = ""; this.txtErrorMsg.Text = "No se encontraron datos."; this.txtOpen.Text = ""; } #endregion } else { #region PuntoRecepcion IPuntoRecepcion puntoRecepcion = PuntoRecepcionFactory.GetPuntoRecepcion(); DsPuntosRecepcion ds = null; ds = puntoRecepcion.GetPuntosRecepcionDataSet(); string sucursal = this.txtSucursal.Text; string razon = this.txtRazonSocial.Text; string filtroEspecial = this.txtFiltro.Text; string agenciaActual = this.txtAgenciaActual.Text; string filtro = "Codigo LIKE '" + sucursal + "%' AND RazonSocial LIKE '" + razon + "%'"; DsPuntosRecepcion.DatosRow[] drPuntoRecepcion = (DsPuntosRecepcion.DatosRow[])ds.Datos.Select(filtro); total = drPuntoRecepcion.Length; if (total > 0) { if (total == 1) { this.txtAgenciaID.Text = drPuntoRecepcion[0].PuntoRecepcionID.ToString(); this.txtSucursal.Text = drPuntoRecepcion[0].Codigo; this.txtRazonSocial.Text = drPuntoRecepcion[0].RazonSocial; this.txtErrorMsg.Text = ""; this.txtOpen.Text = ""; } else { this.txtSucursal.Text = this.sucursal; this.txtRazonSocial.Text = this.razonSocial; this.txtOpen.Text = "S"; this.txtFiltro.Text = this.filtroEspecial; this.txtAgenciaActual.Text = this.agenciaActual; } this.txtParametro.Text = this.parametro; } else { this.txtAgenciaID.Text = ""; this.txtErrorMsg.Text = "No se encontraron datos."; this.txtOpen.Text = ""; } #endregion } } catch (Exception ex) { this.txtErrorMsg.Text = "Error al consultar datos de agencias: " + ex.Message; } }
private void Page_Load(object sender, System.EventArgs e) { #region Configuracion Empresa string emp = System.Configuration.ConfigurationSettings.AppSettings["Empresa"]; this.rbtCasoA.Text = "Sin Líneas de " + emp; this.rbtCasoB.Text = "Con Líneas de " + emp; #endregion #region IsAuthenticated if (User.Identity.IsAuthenticated) { string sOpcion = "abmConsolidados"; Menu oMenu = (Menu)this.FindControl("Menu1"); this.ValidarSeguridad(oMenu, sOpcion); } #endregion if (Session["Usuario"] != null) { this.usuario = (IUsuarios)Session["Usuario"]; } this.lblFechaActual.Text = DateTime.Today.ToString("dd/MM/yyyy"); this.txtFechaConsolidado.Text = DateTime.Today.ToString("dd/MM/yyyy"); this.txtFechaConsolidado.Enabled = false; ddlDestino.Enabled = false; if (!IsPostBack) { #region !IsPostBack Session["DsGuiaCasoA"] = null; Session["DsGuiaCasoB"] = null; this.txtAgenciaConectadaID.Text = AgenciaConectadaID.ToString(); this.txtConsolidadoID.Text = this.Request.QueryString["ConsolidadoID"] == null ? "" : this.Request.QueryString["ConsolidadoID"]; IAgencia oAgencia = AgenciaFactory.GetAgencia(); oAgencia.AgenciaID = Convert.ToInt32(this.AgenciaConectadaID); oAgencia.ConsultarBasicoByAgenciaID(); this.lblAgenciaConectadaDescrip.Text = oAgencia.RazonSocial; this.busqEmpresaTerceros1.AgenciaReferencia = this.AgenciaConectadaID.ToString(); this.txtDestino.Enabled = false; if (this.txtConsolidadoID.Text == "") { this.tblModificacion.Attributes.Add("Style", "Display: none"); this.rbtCasoA.Checked = true; this.txtDestino.Visible = false; this.butImprimir.Enabled = false; string empresaTercerosID = Request.QueryString["EmpresaTercerosID"]; string destinoID = Request.QueryString["DestinoID"]; string tipDestinoID = Request.QueryString["TipoDestinoID"]; string indice = Request.QueryString["Indice"]; /* * if(destinoID == "") * Session["DsGuias"] = null; */ //this.BinGrillaPendientes(); Consultar(); if (empresaTercerosID != null && destinoID != null && tipDestinoID != null) { txtEmpresaID.Text = empresaTercerosID; IEmpresaTerceros empresa = EmpresaTercerosFactory.GetEmpresaTerceros(); empresa.EmpresaTercerosID = Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text); empresa.Consultar(); busqEmpresaTerceros1.RazonSocial = empresa.RazonSocial; busqEmpresaTerceros1.EmpresaTercerosID = empresa.EmpresaTercerosID.ToString(); if (tipDestinoID == "6") { rbtCasoA.Checked = true; rbtCasoB.Checked = false; } else { rbtCasoA.Checked = false; rbtCasoB.Checked = true; } DsPuntosRecepcion ds = SisPackController.LlenarCombos.VisualizarDestino(ddlDestino, AgenciaConectadaID.ToString(), Utiles.Validaciones.obtieneEntero(tipDestinoID), Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text)); ddlDestino.DataSource = ds; ddlDestino.DataTextField = "RazonSocial"; ddlDestino.DataValueField = "PuntoRecepcionID"; ddlDestino.DataBind(); ddlDestino.Items.Insert(0, new ListItem("Elija destino", string.Empty)); ddlDestino.SelectedIndex = Utiles.Validaciones.obtieneEntero(indice); txtDestinoID.Text = indice; Consultar(); SoloLectura(); } } else { this.ddlDestino.Visible = false; this.txtFechaConsolidado.Enabled = false; this.txtTarifaEstimada.Enabled = false; butDestino.Visible = false; butLimpiar.Visible = false; //butCodigo.Visible = false; //butConsultar.Visible = false; SoloLectura(); Editar(); Consultar(); } #endregion } else { //Esta haciendo PostBack, verificar que no sea un consolidado ya armado string empresaTercerosID = Request.QueryString["EmpresaTercerosID"]; string destinoID = Request.QueryString["DestinoID"]; string tipDestinoID = Request.QueryString["TipoDestinoID"]; string ind = Request.QueryString["Indice"]; if (txtConsolidadoID.Text == "") { #region PostBackFiltros if (Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text) > 0) { int indice = 0; if (ddlDestino.SelectedIndex > 0) { indice = ddlDestino.SelectedIndex; } IEmpresaTerceros empresa = EmpresaTercerosFactory.GetEmpresaTerceros(); empresa.EmpresaTercerosID = Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text); empresa.Consultar(); busqEmpresaTerceros1.RazonSocial = empresa.RazonSocial; busqEmpresaTerceros1.EmpresaTercerosID = empresa.EmpresaTercerosID.ToString(); int tipoDestinoID = rbtCasoA.Checked ? 6 : 1; DsPuntosRecepcion ds = SisPackController.LlenarCombos.VisualizarDestino(ddlDestino, AgenciaConectadaID.ToString(), tipoDestinoID, Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text)); ddlDestino.DataSource = ds; ddlDestino.DataTextField = "RazonSocial"; ddlDestino.DataValueField = "PuntoRecepcionID"; ddlDestino.DataBind(); ddlDestino.Items.Insert(0, new ListItem("Elija destino", string.Empty)); ddlDestino.SelectedIndex = Utiles.Validaciones.obtieneEntero(txtDestinoID.Text); SoloLectura(); } #endregion } else { if (Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text) > 0) { IEmpresaTerceros empresa = EmpresaTercerosFactory.GetEmpresaTerceros(); empresa.EmpresaTercerosID = Utiles.Validaciones.obtieneEntero(txtEmpresaID.Text); empresa.Consultar(); busqEmpresaTerceros1.RazonSocial = empresa.RazonSocial; busqEmpresaTerceros1.EmpresaTercerosID = empresa.EmpresaTercerosID.ToString(); SoloLectura(); } } } if (this.txtConsolidadoID.Text != "") { BinGrillaAsignadas(); } //if(txtNroConsolidado.Text == "" || txtDestinoID.Text == "" || ddlDestino.SelectedIndex > -1) // butAceptar.Enabled = false; this.chkTodos.Attributes.Add("onclick", "SelecGuias()"); this.Validaciones(); }