Пример #1
0
        public DsServicioRecorridos GetServicioRecorridosDataSet()
        {
            DsServicioRecorridos ds = new DsServicioRecorridos();

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ServicioRecorridoALL");

            return(ds);
        }
Пример #2
0
        public override global::System.Data.DataSet Clone()
        {
            DsServicioRecorridos cln = ((DsServicioRecorridos)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Пример #3
0
        public DsServicioRecorridos GetServicioRecorridosConsultaByServicioDataSet(string servicioTransporteDescrip)
        {
            DsServicioRecorridos ds = new DsServicioRecorridos();
            SqlParameter         pServicioTransporteDescrip = new SqlParameter("@ServicioTransporteDescrip", servicioTransporteDescrip);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ServicioRecorridoSEL", pServicioTransporteDescrip);

            return(ds);
        }
Пример #4
0
        public DsServicioRecorridos GetServicioRecorridosByServicioTransporteIDDataSet()
        {
            DsServicioRecorridos ds = new DsServicioRecorridos();
            SqlParameter         pServicioTransporteID = new SqlParameter("@ServicioTransporteID", this.ServicioTransporteID);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ServicioRecorridoByServicioTransporteID", pServicioTransporteID);

            return(ds);
        }
Пример #5
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DsServicioRecorridos ds = new DsServicioRecorridos();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Пример #6
0
        private void BindGridEditar(int currentPage)
        {
            try
            {
                SisPackController.AdministrarGrillas.Configurar(this.dtgParadas, "ParadaCodigo", this.CantidadOpciones);

                this.dsParadas              = (DsServicioRecorridos)Session["dtgParadas"];
                dtgParadas.DataSource       = this.dsParadas;
                dtgParadas.CurrentPageIndex = currentPage;
                dtgParadas.DataBind();
            }
            catch (Exception ex)
            {
                ManejaErrores(ex);
            }
        }
Пример #7
0
        public DsServicioRecorridos ObtenerAgenciasPromocion()
        {
            try
            {
                DsServicioRecorridos ds = new DsServicioRecorridos();

                SqlParameter pServicioTransporteID          = new SqlParameter("@ServicioTransporteID", this.ServicioTransporteID);
                SqlParameter pPromocionServicioTransporteID = new SqlParameter("@PromocionServicioTransporteID", this.PromocionServicioTransporteID);
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ObtieneAgenciasPromocionSEL", pServicioTransporteID, pPromocionServicioTransporteID);

                return(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #8
0
        public bool Consultar()
        {
            DsServicioRecorridos ds = this.GetServicioRecorridosDataSet();

            if (ds == null)
            {
                return(false);
            }

            DsServicioRecorridos.DatosRow dr = ds.Datos.FindByServicioTransporteIDServicioRecorridoIDAgenciaParadaID(this.ServicioTransporteID, this.ServicioRecorridoID, this.AgenciaParadaID);
            if (dr == null)
            {
                return(false);
            }

            this.ParadaDescrip = dr.ParadaDescrip;
            this.ParadaCodigo  = dr.ParadaCodigo;
            this.ParadaOrden   = dr.ParadaOrden;
            this.MinutosEspera = dr.MinutosEspera;
            this.HoraPartida   = dr.HoraPartida;
            return(true);
        }
Пример #9
0
        private void BindGrid(int currentPage)
        {
            try
            {
                SisPackController.AdministrarGrillas.Configurar(this.dtgParadas, "ParadaCodigo", this.CantidadOpciones);

                if (Session["dtgParadas"] == null)
                {
                    IServicioTransporte servicio = ServicioTransporteFactory.GetServicioTransporte();
                    servicio.ServicioTransporteID = Utiles.Validaciones.obtieneEntero(this.ddlServicios.SelectedValue);
                    servicio.Consultar();

                    IServicioRecorrido recorrido = ServicioRecorridoFactory.GetServicioRecorrido();
                    this.dsParadas = recorrido.GetServicioRecorridosConsultaByServicioDataSet(servicio.ServicioTransporteDescrip);
                }
                else
                {
                    this.dsParadas = (DsServicioRecorridos)Session["dtgParadas"];
                    foreach (DataGridItem item in this.dtgParadas.Items)
                    {
                        DsServicioRecorridos.DatosRow dr = (DsServicioRecorridos.DatosRow) this.dsParadas.Datos.Rows[item.DataSetIndex];

                        CheckBox chk = (CheckBox)item.FindControl("chkAsignar");
                        dr.Seleccionado = chk.Checked;
                    }
                }
                // actualizo la grilla
                Session["dtgParadas"]       = this.dsParadas;
                dtgParadas.DataSource       = this.dsParadas;
                dtgParadas.CurrentPageIndex = currentPage;
                dtgParadas.DataBind();
            }
            catch (Exception ex)
            {
                ManejaErrores(ex);
            }
        }
Пример #10
0
        private void butGuardar_Click(object sender, System.EventArgs e)
        {
            try
            {
                DsServicioRecorridos dsParadasSeleccionadas = new DsServicioRecorridos();

                ArrayList colAgencias = new ArrayList();
                // obtengo las agencias seleccionadas
                foreach (DataGridItem item in this.dtgParadas.Items)
                {
                    CheckBox chk = (CheckBox)item.FindControl("chkAsignar");

                    if (chk.Checked)
                    {
                        IAgenciaParada agenciaParad = AgenciaParadaFactory.GetAgenciaParada();
                        agenciaParad.AgenciaParadaID = Utiles.Validaciones.obtieneEntero(((Label)item.Cells[0].FindControl("lblAgenciaParadaID")).Text);
                        agenciaParad.Consultar();
                        colAgencias.Add(agenciaParad.AgenciaID);
                        //colAgencias.Add(Utiles.Validaciones.obtieneEntero(((Label)item.Cells[0].FindControl("lblAgenciaParadaID")).Text));
                    }
                }

                // recupero el resto de los valores y grabo los datos en la base
                IPromocionServicioTransporte promo = PromocionServicioTransporteFactory.GetPromocionServicioTransporte();
                promo.FechaInicioVigencia = Utiles.Fechas.FormatFechaDDMMYYYY(this.txtFechaDesde.Text);
                promo.FechaFinVigencia    = Utiles.Fechas.FormatFechaDDMMYYYY(this.txtFechaHasta.Text);

                //Paradas Destino y Origen
                IAgenciaParada agenciaParada = AgenciaParadaFactory.GetAgenciaParada();
                agenciaParada.AgenciaParadaID = Convert.ToInt32(this.ddlOrigen.SelectedValue);
                agenciaParada.Consultar();
                promo.AgenciaOrigenID = agenciaParada.AgenciaID;

                agenciaParada.AgenciaParadaID = Convert.ToInt32(this.ddlDestino.SelectedValue);
                agenciaParada.Consultar();
                promo.AgenciaDestinoID = agenciaParada.AgenciaID;

                /*promo.AgenciaOrigenID = Utiles.Validaciones.obtieneEntero(this.ddlOrigen.SelectedValue);
                 * promo.AgenciaDestinoID = Utiles.Validaciones.obtieneEntero(this.ddlDestino.SelectedValue);*/

                promo.UnidadVentaID = Utiles.Validaciones.obtieneEntero(this.txtServicioSelec.Text);
                //promo.UnidadVentaID = 0; // no es por unidad de venta, solo por servicios

                promo.Nombre = this.txtNombre.Text;
                promo.PorcentajeBonificacion = Utiles.Validaciones.obtieneDouble(this.txtPorcentajeBonificacion.Text);

                promo.ServicioTransporteID = Utiles.Validaciones.obtieneEntero(this.ddlServicios.SelectedValue);

                promo.PromocionServicioTransporteID = Utiles.Validaciones.obtieneEntero(this.txtPromocionServicioTransporteID.Text);

                promo.Agencias = colAgencias;

                promo.Guardar();

                Page.RegisterStartupScript("muestraMensaje", SisPackController.GenerarJavaScripts.MostrarMensaje("Los datos se guardaron correctamente.", "PromocionesConsul.aspx"));
            }
            catch (Exception ex)
            {
                ManejaErrores(ex);
            }
            finally
            {
                this.tblDatosPromo.Visible = true;
            }
        }
Пример #11
0
        private void Editar()
        {
            try
            {
                this.trUVentaCompleta.Visible    = false;
                this.trUVentaDescrip.Visible     = true;
                this.butVolver.Visible           = true;
                this.butCancelar.Visible         = false;
                this.butConsultarParadas.Visible = false;

                //this.ddlOrigen.Enabled = false;
                //this.ddlDestino.Enabled = false;
                this.ddlOrigen.Visible    = false;
                this.ddlDestino.Visible   = false;
                this.lblOrigen.Visible    = false;
                this.lblDestino.Visible   = false;
                this.ddlServicios.Enabled = false;

                this.butGuardar.Enabled = true;

                IPromocionServicioTransporte promo = PromocionServicioTransporteFactory.GetPromocionServicioTransporte();
                promo.PromocionServicioTransporteID = Utiles.Validaciones.obtieneEntero(this.txtPromocionServicioTransporteID.Text);
                promo.Consultar();


                /*this.ddlOrigen.SelectedValue = promo.AgenciaOrigenID.ToString();
                 * this.ddlDestino.SelectedValue = promo.AgenciaDestinoID.ToString();*/

                IAgencia agencia = AgenciaFactory.GetAgencia();
                agencia.AgenciaID = promo.AgenciaOrigenID;
                IAgenciaParada agenciaParada = AgenciaParadaFactory.GetAgenciaParada();
                agenciaParada.AgenciaParadaID = agencia.GetAgenciaParada();
                agenciaParada.Consultar();
                this.ddlOrigen.SelectedValue = agenciaParada.ParadaCodigo;
                //this.ddlOrigen.SelectedValue = Convert.ToString(agenciaParada.AgenciaParadaID);

                agencia.AgenciaID             = promo.AgenciaDestinoID;
                agenciaParada.AgenciaParadaID = agencia.GetAgenciaParada();
                agenciaParada.Consultar();
                this.ddlDestino.SelectedValue = agenciaParada.ParadaCodigo;
                //this.ddlDestino.SelectedValue = Convert.ToString(agenciaParada.AgenciaParadaID);


                //obtengo el servicio de transporte asociado a la promocion
                //this.LlenarComboServicio();
                IServicioTransporte servTransporte = ServicioTransporteFactory.GetServicioTransporte();
                servTransporte.ServicioTransporteID = promo.ServicioTransporteID;
                this.ddlServicios.DataSource        = servTransporte.GetServicioByIDDataSet();
                ddlServicios.DataValueField         = "ServicioTransporteID";
                ddlServicios.DataTextField          = "ServicioTransporteDescrip";
                ddlServicios.DataBind();

                //this.ddlServicios.SelectedValue = promo.ServicioTransporteID.ToString();

                //obtengo la unidad de venta
                IUnidadVenta uv = UnidadVentaFactory.GetUnidadVenta();
                uv.UnidadVentaID = promo.UnidadVentaID;
                uv.Consultar();
                this.lblUVentaDescrip.Text = uv.UnidadVentaDescrip;
                this.txtServicioSelec.Text = uv.UnidadVentaID.ToString();

                this.tblDatosPromo.Visible             = true;
                this.txtNombre.Text                    = promo.Nombre;
                this.txtNombre.Enabled                 = false;
                this.txtPorcentajeBonificacion.Text    = promo.PorcentajeBonificacion.ToString();
                this.txtPorcentajeBonificacion.Enabled = false;
                this.txtFechaDesde.Text                = promo.FechaInicioVigencia.ToShortDateString();
                this.txtFechaDesde.Enabled             = false;
                this.txtFechaHasta.Text                = promo.FechaFinVigencia.ToShortDateString();

                DateTime fechaActual = Utiles.Fechas.FormatFechaDDMMYYYY(DateTime.Now.ToShortDateString());
                if (!(promo.FechaInicioVigencia >= fechaActual && fechaActual <= promo.FechaFinVigencia))
                {
                    this.txtFechaHasta.Enabled = false;
                    this.dtgParadas.Enabled    = false;
                }

                //obtengo las agencias para las cuales se aplica esta promocion
                DsServicioRecorridos ds = promo.ObtenerAgenciasPromocion();

                Session["dtgParadas"] = ds;
                BindGridEditar(0);
            }
            catch (Exception ex)
            {
                ManejaErrores(ex);
            }
        }
Пример #12
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                DsServicioRecorridos ds = new DsServicioRecorridos();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "DatosDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }