private void GetTravel(int TravelID)
        {
            if (TravelID > 0)
            {
                ReferenceWSTravel.IwcfTravelsClient travelClient = new ReferenceWSTravel.IwcfTravelsClient();
                Travel travel = travelClient.FindTravel(TravelID);
                travelClient.Close();

                if (travel != null)
                {
                    Response.Write("<script>window.onload = function() {"
                                   + "showMsg('Se encontrĂ³ correctamente este viaje ', 'success', 2000);"
                                   + "}</script>");
                    HabilitarBotones();
                }
                else
                {
                    Response.Write("<script>window.onload = function() {"
                                   + "showMsg('No se encontrĂ³ este viaje ', 'warning', 2000);"
                                   + "}</script>");
                    DesHabilitarBotones();
                }
            }
            else
            {
                Response.Write("<script>window.onload = function() {"
                               + "showMsg('Error al insertar el Id del Viaje', 'warning', 2000);"
                               + "}</script>");
                DesHabilitarBotones();
            }
        }
Example #2
0
        protected void BtnBuscarT_click(object sender, EventArgs e)
        {
            ReferenceWSTravel.IwcfTravelsClient travelClient = new ReferenceWSTravel.IwcfTravelsClient();
            Travel travel = travelClient.FindTravel(Convert.ToInt32(TxtTravelID.Text));

            travelClient.Close();

            if (travel != null)
            {
                TxtUserID.Text      = travel.UserID;
                TxtVehicleID.Text   = travel.VehicleID;
                TxtContidionID.Text = travel.ConditionID.ToString();
                TxtCreated_at.Text  = travel.created_at.ToString("dd/MM/yyyy");

                //ReferenceWSLocation.IwcfLocationsClient locationClient = new ReferenceWSLocation.IwcfLocationsClient();
                LogLocations locationClient = new LogLocations();
                DataTable    dt             = locationClient.ListLocationsTravelID(travel.TravelID);
                travelClient.Close();

                GridViewLocationsTravelID.DataSource = dt;
                GridViewLocationsTravelID.DataBind();

                Response.Write("<script>window.onload = function() {showMsg('El viaje se ha encuentrado correctamente', 'success', 2000);}</script>");
            }
            else
            {
                Response.Write("<script>window.onload = function() {showMsg('El viaje " + TxtTravelID.Text + " no se encuentra', 'warning', 2000);}</script>");
                LimpiarTexto();
            }
        }
Example #3
0
        private void GetTravel(string TravelID)
        {
            if (TravelID != "")
            {
                ReferenceWSTravel.IwcfTravelsClient travelClient = new ReferenceWSTravel.IwcfTravelsClient();
                Travel travel = travelClient.FindTravel(Convert.ToInt32(TravelID));
                travelClient.Close();

                if (travel != null)
                {
                    Session["CurrentTravel"]       = travel;
                    inputUserID.Text               = travel.UserID;
                    inputVehicleID.Text            = travel.VehicleID;
                    inputConditionID.SelectedValue = travel.ConditionID.ToString();


                    Response.Write("<script>window.onload = function() {"
                                   + "showMsg('El viaje ha sido encontrado', 'success', 3000);"
                                   + "}</script>");
                    HabilitarBotones();
                }
                else
                {
                    Response.Write("<script>window.onload = function() {"
                                   + "showMsg('El viaje no ha sido encontrado', 'warning', 2000);"
                                   + "}</script>");
                    DesHabilitarBotones();
                }
            }
            else
            {
                Response.Write("<script>window.onload = function() {"
                               + "showMsg('Error con el ID del viaje', 'warning', 2000);"
                               + "}</script>");
                DesHabilitarBotones();
            }
        }