Example #1
0
        public Object Get([FromHeader] string Authorization)
        {
            //CountryDatabase.connect();
            //return Ok(CountryDatabase.getAllCountryCode());


            string response = OAuth2Server.ValidateAccessToken(Authorization);

            if (response.Equals("Valid"))
            {
                CountryDatabase.connect();
                return(Ok(CountryDatabase.getAllCountryCode()));//new string[] { "value1", "value2" };}
            }
            else if (response.Equals("Missing access_token"))
            {
                errorModel err = new errorModel();
                err.error         = new error();
                err.error.status  = 401;
                err.error.message = "Missing access_token";
                return(Ok(err));
            }
            else if (response.Equals("Expired access_token"))
            {
                HttpContext.Response.StatusCode = 401;
                errorModel err = new errorModel();
                err.error         = new error();
                err.error.message = "Expired access_token";
                err.error.status  = 401;
                return(err);
            }
            else
            {
                return(Unauthorized());
            }
        }
Example #2
0
    private void Start()
    {
        uimanager = FindObjectOfType <UIManager> ();
        GPS.Initialize();
        countryDatabase = GetComponent <CountryDatabase> ();

        countryDatabase.databaseReady += OnDatabaseReady;
    }
Example #3
0
 public IActionResult GetSearch([FromQuery] string search)
 {
     if (search == null)
     {
         search = "";
     }
     CountryDatabase.connect();
     return(Ok(CountryDatabase.getCountryCodeByName(search)));
 }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                countryId = int.Parse(Country.SelectedValue);
            }

            CountryDatabase countryDatabase = new CountryDatabase();

            Country.DataSource     = countryDatabase.getAllCountry();
            Country.DataTextField  = "country";
            Country.DataValueField = "id";
            Country.DataBind();
            Country.SelectedValue = countryId.ToString();
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ContinentDatabase continentDatabase = new ContinentDatabase();

            ContinentList.DataSource     = continentDatabase.getAllContinent();
            ContinentList.DataTextField  = "title";
            ContinentList.DataValueField = "id";
            ContinentList.DataBind();
            loadTable();

            if (Request.QueryString["id"] != null)
            {
                id = int.Parse(Request.QueryString["id"]);
                AddCountry.Text = "Update Country";
                CountryDatabase countryDatbase = new CountryDatabase();
                CountryModel    countryModel   = countryDatbase.getCountry(id);
                ContinentList.Items.FindByValue(countryModel.ContinentId.ToString());
                //countryTxtbox.Text = countryModel.Name;
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CountryDatabase   countryDatabase   = new CountryDatabase();
            ContainerDatabase containerDatabase = new ContainerDatabase();

            Container.DataSource     = containerDatabase.getAllContainer();
            Container.DataTextField  = "container_number";
            Container.DataValueField = "id";
            Container.DataBind();

            DepartureCountry.DataSource     = countryDatabase.getAllCountry();
            DepartureCountry.DataTextField  = "country";
            DepartureCountry.DataValueField = "id";
            DepartureCountry.DataBind();



            ArrivalCountry.DataSource     = countryDatabase.getAllCountry();
            ArrivalCountry.DataTextField  = "country";
            ArrivalCountry.DataValueField = "id";
            ArrivalCountry.DataBind();

            loadTable();

            if (Request.QueryString["id"] != null)
            {
                ScheduleDatabase scheduleDatabase = new ScheduleDatabase();
                if (scheduleDatabase.updateShippingStatus(int.Parse(Request.QueryString["id"]), 2))
                {
                    if (scheduleDatabase.updateContainerStatus(int.Parse(Request.QueryString["container-id"]), 0))
                    {
                        loadTable();
                    }
                }
            }
        }
Example #7
0
 public Country()
 {
     countryDatabase = new CountryDatabase();
 }
Example #8
0
 public ArrayList findCountry(string city)
 {
     return(CountryDatabase.getAllCountryCode(city));
 }
Example #9
0
 public ArrayList getCities(string name)
 {
     return(CountryDatabase.getCities(name));
 }
Example #10
0
 //[Route("/api/getHighest/{id}")]//route for different url
 public ArrayList GetHighest([FromQuery] int num) //get num from ?num=X where x is num
 {
     return(CountryDatabase.getHighest(num));
 }