Ejemplo n.º 1
0
        /// <summary>
        /// Metodo para Consultar Ciudades
        /// </summary>

        public DataTable ConsultarCity(string scodcountry, string scoddpto, string scodcity, string snamecity)
        {
            DataTable dt      = oConn.ejecutarDataTable("UP_WEBSIGE_SEARCHCITY", scodcountry, scoddpto, scodcity, snamecity);
            ECity     oescity = new ECity();

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        oescity.codcountry     = dt.Rows[i]["cod_country"].ToString().Trim();
                        oescity.coddpto        = dt.Rows[i]["cod_dpto"].ToString().Trim();
                        oescity.codCity        = dt.Rows[i]["cod_City"].ToString().Trim();
                        oescity.NameCity       = dt.Rows[i]["Name_City"].ToString().Trim();
                        oescity.CityStatus     = Convert.ToBoolean(dt.Rows[i]["City_Status"].ToString().Trim());
                        oescity.CityCreateBy   = dt.Rows[i]["City_CreateBy"].ToString().Trim();
                        oescity.CityDateBy     = Convert.ToDateTime(dt.Rows[i]["City_DateBy"].ToString().Trim());
                        oescity.CityModiBy     = dt.Rows[i]["City_ModiBy"].ToString().Trim();
                        oescity.CityDateModiBy = Convert.ToDateTime(dt.Rows[i]["City_DateModiBy"].ToString().Trim());
                    }
                }
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Metodo para Actualizar Ciudades
        /// </summary>
        public ECity ActualizarCity(string scodcity, string scodpto, string scodcountry, string snamecity,
                                    bool bCitystatus, string sCityModiBy, DateTime tCityModiDateBy)
        {
            DCity odacity = new DCity();
            ECity oeacity = odacity.ActualizarCity(scodcity, scodpto, scodcountry, snamecity, bCitystatus, sCityModiBy, tCityModiDateBy);

            odacity = null;
            return(oeacity);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Metodo para registrar Ciudades
        /// </summary>
        public ECity RegisterCity(string scodcity, string scodpto, string scodcountry, string snamecity,
                                  bool bCitystatus, string sCityCreateBy, DateTime tCityDateBy, string sCityModiBy, DateTime tCityModiDateBy)
        {
            DCity odrcity = new DCity();
            ECity oercity = odrcity.RegisterCity(scodcity, scodpto, scodcountry, snamecity, bCitystatus, sCityCreateBy, tCityDateBy,
                                                 sCityModiBy, tCityModiDateBy);

            odrcity = null;
            return(oercity);
        }
Ejemplo n.º 4
0
        private string GetRequestUrl(string sProviderId, string sCityId)
        {
            string    sUrl      = "";
            EProvider oProvider = db.GetProvider(sProviderId);
            ECity     oCity     = db.GetCity(sCityId);

            if (oProvider != null && oCity != null)
            {
                sUrl = ForecastProviderFactory.BuildRequestUrl(oProvider, oCity);
            }
            return(sUrl);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Metodo para Actualizar Ciudades
        /// </summary>
        public ECity ActualizarCity(string scodcity, string scodpto, string scodcountry, string snamecity,
                                    bool bCitystatus, string sCityModiBy, DateTime tCityModiDateBy)
        {
            DataTable dt      = oConn.ejecutarDataTable("UP_WEBSIGE_ACTUALIZACITY", scodcity, scodpto, scodcountry, snamecity, bCitystatus, sCityModiBy, tCityModiDateBy);
            ECity     oeacity = new ECity();

            oeacity.codCity        = scodcity;
            oeacity.coddpto        = scodpto;
            oeacity.codcountry     = scodcountry;
            oeacity.CityStatus     = bCitystatus;
            oeacity.CityModiBy     = sCityModiBy;
            oeacity.CityDateModiBy = tCityModiDateBy;
            return(oeacity);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Metodo para registrar Ciudades
        /// </summary>
        public ECity RegisterCity(string scodcity, string scodpto, string scodcountry, string snamecity,
                                  bool bCitystatus, string sCityCreateBy, DateTime tCityDateBy, string sCityModiBy, DateTime tCityModiDateBy)
        {
            DataTable dt = oConn.ejecutarDataTable("UP_WEBSIGE_REGISTERCITY", scodcity, scodpto, scodcountry, snamecity, bCitystatus, sCityCreateBy,
                                                   tCityDateBy, sCityModiBy, tCityModiDateBy);
            ECity oecity = new ECity();

            oecity.codCity        = scodcity;
            oecity.coddpto        = scodpto;
            oecity.codcountry     = scodcountry;
            oecity.CityStatus     = bCitystatus;
            oecity.CityCreateBy   = sCityCreateBy;
            oecity.CityDateBy     = tCityDateBy;
            oecity.CityModiBy     = sCityModiBy;
            oecity.CityDateModiBy = tCityModiDateBy;
            return(oecity);
        }
        static public string BuildRequestUrl(EProvider oProvider, ECity oCity)
        {
            IForecastExtension oExtension = null;

            switch (oProvider.Id)
            {
            case "1":
                oExtension = new ForecastIOExtension();
                break;

            case "2":
                oExtension = new WeatherUndergroundExtension();
                break;

            default:
                oExtension = new ForecastIOExtension();
                break;
            }
            return(oExtension.GetForecastRequest(oProvider, oCity));
        }
Ejemplo n.º 8
0
 public string GetForecastRequest(EProvider oProvider, ECity oCity)
 {
     return(String.Format(oProvider.Url, oProvider.Key, oCity.Latitude, oCity.Longitude));
 }
Ejemplo n.º 9
0
    protected void iBtnSaveMultipleCity_Click(object sender, ImageClickEventArgs e)
    {
        hfCityName.Value = hfCityName.Value.Substring(0, hfCityName.Value.Length - 1);
        hfStateID.Value  = hfStateID.Value.Substring(0, hfStateID.Value.Length - 1);
        char[] split = new char[1];
        split[0] = ',';
        string[] CityName = hfCityName.Value.Split(split);
        string[] StateID  = hfStateID.Value.Split(split);

        Int64 returnresult;

        //CityService objCityService = new CityService();
        //HealthYes.Web.UI.CityService.ECity[] objCity = new HealthYes.Web.UI.CityService.ECity[CityName.Length];

        ECity[] objCity = new ECity[CityName.Length];

        for (int count = 0; count < CityName.Length; count++)
        {
            objCity[count]             = new ECity();
            objCity[count].Description = "";
            objCity[count].Name        = CityName[count];
            //objCity[count].State = new HealthYes.Web.UI.CityService.EState();
            objCity[count].State         = new EState();
            objCity[count].State.StateID = Convert.ToInt32(StateID[count]);
            //objCity[count].Zipcode = new HealthYes.Web.UI.CityService.EZip();
            objCity[count].Zipcode         = new EZip();
            objCity[count].Zipcode.ZipCode = txtMZipCode.Text;

            //objCity[count].Country = new HealthYes.Web.UI.CityService.ECountry();
            objCity[count].Country = new ECountry();
            if (ViewState["CountryID"] != null)
            {
                objCity[count].Country.CountryID = Convert.ToInt32(ViewState["CountryID"]);
            }
            else
            {
                objCity[count].Country.CountryID = 68;
            }
        }

        //objCityService.AddMultipleCities(objCity, "1", "1","1", out returnresult, out temp);

        MasterDAL masterDAL = new MasterDAL();

        returnresult = 0;
        foreach (ECity City in objCity)
        {
            returnresult = masterDAL.SaveCity(City, Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }

        errordiv.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());

        if (Request.QueryString["searchtext"] != null)
        {
            SearchCity(Request.QueryString["searchtext"].ToString());
        }
        else
        {
            GetCity();
        }
    }
Ejemplo n.º 10
0
    /// <summary>
    /// this method is used for adding new and updating the information regarding the city which is
    /// called on clicking save button.
    /// </summary>
    private void UpdateCity()
    {
        Int64 returnresult = 0;

        //CityService service = new CityService();

        string ZipCode = txtZip.Text;

        //HealthYes.Web.UI.CityService.ECity city = new HealthYes.Web.UI.CityService.ECity();
        var city = new ECity();

        city.Description = txtDescription.Text;
        city.Name        = txtName.Text;

        //city.State = new HealthYes.Web.UI.CityService.EState();
        //city.Zipcode = new HealthYes.Web.UI.CityService.EZip();

        city.State   = new EState();
        city.Zipcode = new EZip();

        if (ViewState["stateid"] != null)
        {
            city.State.StateID = Convert.ToInt32(ViewState["stateid"]);
        }

        //HealthYes.Web.UI.CityService.ECountry country = new HealthYes.Web.UI.CityService.ECountry();
        ECountry country = new ECountry();

        country.CountryID = Convert.ToInt32(ddlcountry.SelectedValue);
        city.Active       = true;
        city.Country      = country;

        city.Zipcode.ZipCode = ZipCode;

        MasterDAL masterDAL = new MasterDAL();

        if (hfCityID.Value.ToString().Equals(""))
        {
            city.Zipcode.ZipID = 0;
            //service.AddCity(city, "1", "1", "1", out returnresult, out temp);

            returnresult = masterDAL.SaveCity(city, Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }
        else
        {
            city.Zipcode.ZipID =
                Convert.ToInt32(
                    ((DataTable)(ViewState["DSGRID"])).Rows[grdCity.Rows[Convert.ToInt32(hfCityID.Value)].DataItemIndex
                    ]["ZipId"]);
            city.CityID =
                Convert.ToInt32(
                    ((DataTable)(ViewState["DSGRID"])).Rows[grdCity.Rows[Convert.ToInt32(hfCityID.Value)].DataItemIndex
                    ]["CityID"]);

            returnresult = masterDAL.SaveCity(city, Convert.ToInt32(EOperationMode.Update));
            if (returnresult == 0)
            {
                returnresult = 9999991;
            }

            //service.UpdateCity(city, "1", "1", "1", out returnresult, out temp);
            hfCityID.Value = "";
        }

        errordiv.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());

        if (Request.QueryString["searchtext"] != null)
        {
            SearchCity(Request.QueryString["searchtext"].ToString());
        }
        else
        {
            GetCity();
        }
        //GetCity();
    }
 public string GetForecastRequest(EProvider oProvider, ECity oCity)
 {
     return(String.Format(oProvider.Url, oProvider.Key, oCity.Country, oCity.Name));
 }