Exemplo n.º 1
0
        public ActionResult CountryLast()
        {
            var            users     = objReligion.GetCountrys();
            CountryDetails obj       = new CountryDetails();
            int            pageindex = Convert.ToInt32(Session["pageindex"]);

            pageindex++;
            obj.Status = true;
            if (users != null)
            {
                Session["pageindex"] = pageindex;
                if ((users.Count() % PageSize) == 0)
                {
                    obj.CountryList = users.OrderBy(p => p.CountryId).Skip(users.Count() - 2).Take(PageSize);
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    int rem = users.Count() % PageSize;
                    obj.CountryList = users.OrderBy(p => p.CountryId).Skip(users.Count() - rem).Take(PageSize);
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(CountryFirst());
            }
        }
Exemplo n.º 2
0
        public ActionResult Update(tblCountry model)
        {
            var            countries = objReligion.GetCountrys();
            var            test      = countries.Where(p => p.CountryName.ToUpper() == model.CountryName.ToUpper()).FirstOrDefault();
            CountryDetails obj       = new CountryDetails();

            if (test != null)
            {
                obj.Status       = false;
                obj.ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.AlreadyExist : "हि माहिती आधीपासून उपलब्ध आहे.";
            }
            else
            {
                obj.Status       = true;
                obj.ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.UpdateSuccess : "माहितीमध्ये बदल करण्यात आला आहे.";
                objReligion.Update(model);
            }
            int pageindex = 0;
            var filter    = countries.OrderBy(p => p.CountryId).Skip(pageindex * PageSize).Take(PageSize);

            Session["users"]     = countries;
            Session["pageindex"] = 0;
            obj.CountryList      = filter;
            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        /// <summary>
        /// GetShippingCost
        /// Calls [usp_select_Country_ShippingCost]
        /// </summary>
        public override CountryDetails GetShippingCost(System.Int32?countryId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_Country_ShippingCost", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@CountryId", SqlDbType.Int).Value = countryId;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd, CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    //return GetCountryFromReader(reader);
                    CountryDetails obj = new CountryDetails();
                    obj.ShippingCost = GetReaderValue_NullableDouble(reader, "ShippingCost", null);
                    return(obj);
                }
                else
                {
                    return(null);
                }
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Country", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 4
0
        public ActionResult CountryPrev()
        {
            IQueryable <tblCountry> users = (IQueryable <tblCountry>)Session["users"];

            if (users != null)
            {
                int pageindex = Convert.ToInt32(Session["pageindex"]);
                if (pageindex > 0)
                {
                    pageindex--;
                    var filter = users.OrderBy(p => p.CountryId).Skip(pageindex * PageSize).Take(PageSize);
                    Session["pageindex"] = pageindex;
                    CountryDetails obj = new CountryDetails()
                    {
                        Status       = true,
                        ErrorMessage = "",
                        CountryList  = filter,
                    };
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    CountryDetails obj = new CountryDetails()
                    {
                        Status       = false,
                        ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.InvalidUserNamePassword : "******",
                    };
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(CountryFirst());
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// DropDownForClient
        /// Calls [usp_dropdown_Country_for_Client]
        /// </summary>
        public override List <CountryDetails> DropDownForClient(System.Int32?clientId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_dropdown_Country_for_Client", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId;
                cn.Open();
                DbDataReader          reader = ExecuteReader(cmd);
                List <CountryDetails> lst    = new List <CountryDetails>();
                while (reader.Read())
                {
                    CountryDetails obj = new CountryDetails();
                    obj.CountryId   = GetReaderValue_Int32(reader, "CountryId", 0);
                    obj.CountryName = GetReaderValue_String(reader, "CountryName", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Countrys", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 6
0
        public ActionResult Details(string id, int?year)
        {
            var statistics = new PopulationStatistics();
            var details    = new CountryDetails();

            var availableYears =
                statistics.GetAvailableYearsForCountry(id);

            details.Name           = id;
            details.AvailableYears =
                availableYears.Select(availableYear =>
                                      new SelectListItem
            {
                Text  = availableYear.ToString(),
                Value = availableYear.ToString()
            });

            var selectedYear = year ?? availableYears.First();

            details.MalePopulation   = statistics.GetMalePopulation(id, selectedYear);
            details.FemalePopulation = statistics.GetFemalePopulation(id, selectedYear);
            details.TotalPopulation  = details.MalePopulation + details.FemalePopulation;

            return(View(details));
        }
Exemplo n.º 7
0
        public void EditCountry(CountryDetails countryDetails)
        {
            var country = _countryRepository.GetById(countryDetails.Id);

            country.Name = countryDetails.Name;
            _countryRepository.Update(country);
        }
Exemplo n.º 8
0
        public List <CountryModel> GetCountryData()
        {
            var countryDetail = new CountryDetails();
            var countryData   = countryDetail.GetCountryData();

            return(countryData);
        }
        // GET api/countries/slug
        public CountryDetails Get(string slug)
        {
            CountryDetails countryDetailsObj = new CountryDetails();

            var countryData = db.CountryData.FirstOrDefault(c => c.Slug == slug);

            countryDetailsObj.CountryCode    = countryData.CountryCode;
            countryDetailsObj.Name           = countryData.Country;
            countryDetailsObj.LastUpdate     = countryData.LastUpdate;
            countryDetailsObj.NewCases       = countryData.NewConfirmed;
            countryDetailsObj.NewDeaths      = countryData.NewDeaths;
            countryDetailsObj.NewRecovered   = countryData.NewRecovered;
            countryDetailsObj.TotalCases     = countryData.TotalConfirmed;
            countryDetailsObj.TotalDeaths    = countryData.TotalDeaths;
            countryDetailsObj.TotalRecovered = countryData.TotalRecovered;

            var growthRate = db.GrowthRates.FirstOrDefault(c => c.Country == countryDetailsObj.CountryCode);

            countryDetailsObj.NewCasePercentage      = growthRate.NewCasePercentage;
            countryDetailsObj.NewDeathPercentage     = growthRate.NewDeathPercentage;
            countryDetailsObj.NewRecoveredPercentage = growthRate.NewRecoveredPercentage;

            countryDetailsObj.countryTimelineData = db.CountryTimeLines.Where(c => c.CountryCode == countryDetailsObj.CountryCode).ToList();

            return(countryDetailsObj);
        }
Exemplo n.º 10
0
        public ActionResult Search(string prefix)
        {
            var countries = objReligion.GetCountrys().Where(p => p.CountryName.ToUpper() == prefix.ToUpper());
            int pageindex = 0;
            var filter    = countries.OrderBy(p => p.CountryId).Skip(pageindex * PageSize).Take(PageSize);

            Session["users"]     = countries;
            Session["pageindex"] = 0;
            if (filter.Count() > 0)
            {
                CountryDetails obj = new CountryDetails()
                {
                    Status      = true,
                    CountryList = filter
                };
                return(Json(obj, JsonRequestBehavior.AllowGet));
            }
            else
            {
                CountryDetails obj = new CountryDetails()
                {
                    Status       = false,
                    ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.NoMoreInformationAvail : "आणखी माहिती उपलब्ध नाही"
                };
                return(Json(obj, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 11
0
        public CountryDetails CreateCountry(CountryDetails country)
        {
            var newCountry = Mapper.Map <Data.Entities.Football.Country>(country);

            _countryDataService.Value.Create(newCountry);
            _unitOfWork.Value.SaveChanges();
            return(Mapper.Map <CountryDetails>(newCountry));
        }
Exemplo n.º 12
0
 /// <summary>
 /// The cmbCountry_SelectedValueChanged.
 /// </summary>
 /// <param name="sender">The sender<see cref="object"/>.</param>
 /// <param name="e">The e<see cref="EventArgs"/>.</param>
 private void cmbCountry_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cmbCountry.SelectedItem != null)
     {
         CountryDetails selectedCountry = (CountryDetails)cmbCountry.SelectedItem;
         LoadStateDetails(Convert.ToInt32(selectedCountry.CountryID));
     }
 }
Exemplo n.º 13
0
        public JsonResult GetAutoCountryList(string inputPrefix)
        {
            CountryDetails countryDetails = new CountryDetails();
            //Searching records from list using LINQ query
            var countryList = countryDetails.CountryListDetails.Where(x => x.CountryName.StartsWith(inputPrefix)).ToList();

            return(Json(countryList, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 14
0
        private void GetCountry()
        {
            CountryDetailsClient countryDetailsClient = new CountryDetailsClient();
            var countryData = countryDetailsClient.GetCountryData();

            foreach (var country in countryData)
            {
                CountryDetails.Add(new CountryInformationModel {
                    CountryId = country.CountryId, Name = country.Name
                });
            }
        }
Exemplo n.º 15
0
        public IActionResult AddCountryDetail(CountryDetails countryDetails)
        {
            if (countryDetails != null)
            {
                _CountryDetailsRepository.CreateCity(countryDetails);
                _CountryDetailsRepository.Create(countryDetails);
                return(Ok(countryDetails));
            }


            return(BadRequest());
        }
Exemplo n.º 16
0
        public IHttpActionResult Put(CountryDetails countryDetails)
        {
            var saved = _countryService.Value.UpdateCountry(countryDetails);

            if (saved != null)
            {
                return(Ok(saved));
            }
            else
            {
                return(BadRequest());
            }
        }
Exemplo n.º 17
0
        public CountryDetails UpdateCountry(CountryDetails countryDetails)
        {
            CountryDetails res       = null;
            var            dbCountry = _countryDataService.Value.Get(countryDetails.Id);

            if (dbCountry != null)
            {
                Mapper.Map(countryDetails, dbCountry);
                _unitOfWork.Value.SaveChanges();
                res = Mapper.Map <CountryDetails>(dbCountry);
            }
            return(res);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Get
        /// Calls [usp_select_Country]
        /// </summary>
        public override CountryDetails Get(System.Int32?countryId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_Country", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@CountryId", SqlDbType.Int).Value = countryId;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd, CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    //return GetCountryFromReader(reader);
                    CountryDetails obj = new CountryDetails();
                    obj.CountryId               = GetReaderValue_Int32(reader, "CountryId", 0);
                    obj.CountryName             = GetReaderValue_String(reader, "CountryName", "");
                    obj.Notes                   = GetReaderValue_String(reader, "Notes", "");
                    obj.TelephonePrefix         = GetReaderValue_String(reader, "TelephonePrefix", "");
                    obj.Duty                    = GetReaderValue_Boolean(reader, "Duty", false);
                    obj.TaxNo                   = GetReaderValue_NullableInt32(reader, "TaxNo", null);
                    obj.ShippingCost            = GetReaderValue_NullableDouble(reader, "ShippingCost", null);
                    obj.ClientNo                = GetReaderValue_Int32(reader, "ClientNo", 0);
                    obj.GlobalCountryNo         = GetReaderValue_NullableInt32(reader, "GlobalCountryNo", null);
                    obj.DeliveryLeadTimeAir     = GetReaderValue_NullableInt32(reader, "DeliveryLeadTimeAir", null);
                    obj.DeliveryLeadTimeSurface = GetReaderValue_NullableInt32(reader, "DeliveryLeadTimeSurface", null);
                    obj.IsPriorityForLists      = GetReaderValue_Boolean(reader, "IsPriorityForLists", false);
                    obj.Inactive                = GetReaderValue_Boolean(reader, "Inactive", false);
                    obj.UpdatedBy               = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP                    = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.TaxName                 = GetReaderValue_String(reader, "TaxName", "");
                    obj.ShipSurchargePer        = GetReaderValue_NullableDouble(reader, "ShippingSurchargePercent", null);
                    return(obj);
                }
                else
                {
                    return(null);
                }
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Country", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 19
0
        public IActionResult AddCountry(string country, string capital, int population, double area, string flag)
        {
            var dbModel = new CountryDetails()
            {
                CountryName = country,
                Capital     = capital,
                Population  = population,
                Area        = area,
                Flag        = flag
            };

            _webMazeContext.CountryDetails.Add(dbModel);
            _webMazeContext.SaveChanges();
            return(RedirectToAction("Index", "Countries"));
        }
Exemplo n.º 20
0
        public ActionResult CountryFirst()
        {
            IQueryable <tblCountry> users = (IQueryable <tblCountry>)Session["users"];
            int pageindex = 0;
            var filter    = users.OrderBy(p => p.CountryId).Skip(pageindex * PageSize).Take(PageSize);

            Session["users"]     = users;
            Session["pageindex"] = 0;
            CountryDetails obj = new CountryDetails()
            {
                Status      = true,
                CountryList = filter
            };

            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
        public DummyCountriesData()
        {
            countries = new List <Country> {
                new Country {
                    Name = "Country A", Code = "AAA", Flag = "Flag-A"
                },
                new Country {
                    Name = "Country B", Code = "BBB", Flag = "Flag-B"
                },
                new Country {
                    Name = "Country C", Code = "CCC", Flag = "Flag-C"
                },
                new Country {
                    Name = "Country D", Code = "DDD", Flag = "Flag-D"
                },
                new Country {
                    Name = "Country E", Code = "EEE", Flag = "Flag-E"
                }
            };

            countryDetails = new CountryDetails
            {
                Name       = "Country A",
                Code       = "AAA",
                Flag       = "Flag-A",
                Capital    = "Capital A",
                Population = 20000,
                Region     = "Region A",
                Subregion  = "Subregion A",
                Borders    = new string[2] {
                    "CCC", "DDD"
                },
                Timezones = new string[0]
            };

            borders = new List <Country>
            {
                new Country {
                    Name = "Country C", Code = "CCC", Flag = "Flag-C"
                },
                new Country {
                    Name = "Country D", Code = "DDD", Flag = "Flag-D"
                }
            };
        }
Exemplo n.º 22
0
 public static CountryDetails[] BindCountry()
 {
     List<CountryDetails> details = new List<CountryDetails>();
     string Query = "Select CountryName,CountryCode from M_Country Order By CountryName";
     DataSet ds = GetData(Query);
     DataTable dt = ds.Tables[0];
     {
         foreach (DataRow dtrow in dt.Rows)
         {
             CountryDetails country = new CountryDetails();
             //country.CountryId = Convert.ToInt32(dtrow["CountryCode"].ToString());
             country.CountryId = dtrow["CountryCode"].ToString();
             country.CountryName = dtrow["CountryName"].ToString();
             details.Add(country);
         }
     }
     return details.ToArray();
 }
Exemplo n.º 23
0
        static void Main(string[] args)
        {
            CountryDetails firstCountry = new CountryDetails {
                CountryCapital = "New Delhi", CountryCode = "IND", CountryName = "India"
            };
            CountryDetails secondCountry = new CountryDetails {
                CountryName = "Russia", CountryCode = "USSR", CountryCapital = "Moscow"
            };
            CountryDetails thirdCountry = new CountryDetails {
                CountryCapital = "Canberra", CountryCode = "AUS", CountryName = "Australia"
            };
            CountryDetails fourthCountry = new CountryDetails {
                CountryName = "New Zealand", CountryCode = "NZ", CountryCapital = "Wellington"
            };

            List <CountryDetails> lstCountry = new List <CountryDetails>();

            lstCountry.Add(firstCountry);
            lstCountry.Add(secondCountry);
            lstCountry.Add(thirdCountry);
            lstCountry.Add(fourthCountry);
            string doContinue = string.Empty;

            do
            {
                Console.WriteLine("Please enter the name of the country : ");
                string countryEntered = Console.ReadLine().ToUpper();

                CountryDetails countryToDisplay = lstCountry.Find(x => x.CountryCode == countryEntered);
                if (countryToDisplay == null)
                {
                    Console.WriteLine("The country is invalid");
                }
                else
                {
                    Console.WriteLine("The country name is : {0}, The country capital is {1}", countryToDisplay.CountryName, countryToDisplay.CountryCapital);
                }
                do
                {
                    Console.WriteLine("Do you want to continue : Enter Yes or No");
                    doContinue = Console.ReadLine().ToUpper();
                } while(doContinue != "NO" && doContinue != "YES");
            }while (doContinue == "YES");
        }
Exemplo n.º 24
0
    public static CountryDetails[] BindCountry()
    {
        DataTable             dt      = new DataTable();
        List <CountryDetails> details = new List <CountryDetails>();

        SqlFunction SqlFunc = new SqlFunction();
        string      str     = "";

        str = "Select ID As CountryID,CountryName From Country_Mast Order BY CountryName";
        dt  = SqlFunc.ExecuteDataTable(str);
        foreach (DataRow dtrow in dt.Rows)
        {
            CountryDetails country = new CountryDetails();
            country.CountryId   = Convert.ToInt32(dtrow["CountryId"].ToString());
            country.CountryName = dtrow["CountryName"].ToString();
            details.Add(country);
        }
        return(details.ToArray());
    }
Exemplo n.º 25
0
        /// <summary>
        /// The AssignDevoteeDetails.
        /// </summary>
        /// <returns>The <see cref="Devotee"/>.</returns>
        private Devotee AssignDevoteeDetails()
        {
            Devotee devotee = new Devotee();

            devotee.ReceiptNumber = Convert.ToInt32(txtReceiptNumber.Text);
            devotee.DevoteeName   = Convert.ToString(txtName.Text);
            devotee.Address       = Convert.ToString(txtAddress.Text);

            CountryDetails selCountry = (CountryDetails)cmbCountry.SelectedItem;

            devotee.CountryCode = Convert.ToInt32(selCountry.CountryID);
            devotee.Country     = Convert.ToString(selCountry.CountryName);

            StateDetails selState = (StateDetails)cmbState.SelectedItem;

            devotee.StateCode = Convert.ToInt32(selState.StateID);
            devotee.State     = Convert.ToString(selState.StateName);

            CityDetails selCity = (CityDetails)cmbCity.SelectedItem;

            devotee.CityCode = Convert.ToInt32(selCity.CityID);
            devotee.City     = Convert.ToString(selCity.CityName);

            devotee.Amount             = 500;
            devotee.ReceiptCreatedDate = DateTime.Now.Date;
            devotee.AnadhanamDate      = Convert.ToDateTime(dtAnadhanamDate.Value.Date);
            devotee.ContactNumber      = Convert.ToString(txtMobileNumber.Text);

            if (cmbPaymentMode.SelectedIndex == 1)
            {
                devotee.PaymentMode = PaymentMode.CHEQUE;
                devotee.ChequeNo    = Convert.ToString(txtChequeNumber.Text);
                devotee.ChequeDate  = Convert.ToDateTime(dtChequeDate.Value.Date);
                devotee.ChequeDrawn = Convert.ToString(txtDrawnOn.Text);
            }
            else
            {
                devotee.PaymentMode = PaymentMode.CASH;
            }

            return(devotee);
        }
Exemplo n.º 26
0
        public static List <CountryDetails> GetListOfCountryDetails(string filePath)
        {
            var            result = new List <CountryDetails>();
            List <string>  lines  = File.ReadAllLines(filePath).ToList();
            CountryDetails tempModel;

            foreach (var line in lines)
            {
                string[] entries = line.Split("|");
                tempModel = new CountryDetails()
                {
                    Name    = entries[0].Trim('\r', '\n', '\t').Replace(" ", string.Empty).ToLower(),
                    Capital = entries[1].Trim('\r', '\n', '\t').Replace(" ", string.Empty).ToLower(),
                };
                if (europeanCountries.Contains(tempModel.Name.ToLower()))
                {
                    result.Add(tempModel);
                }
            }
            return(result);
        }
Exemplo n.º 27
0
        private static Country PopulateFromDBDetailsObject(CountryDetails obj)
        {
            Country objNew = new Country();

            objNew.CountryId               = obj.CountryId;
            objNew.CountryName             = obj.CountryName;
            objNew.Notes                   = obj.Notes;
            objNew.TelephonePrefix         = obj.TelephonePrefix;
            objNew.Duty                    = obj.Duty;
            objNew.TaxNo                   = obj.TaxNo;
            objNew.ShippingCost            = obj.ShippingCost;
            objNew.ClientNo                = obj.ClientNo;
            objNew.GlobalCountryNo         = obj.GlobalCountryNo;
            objNew.DeliveryLeadTimeAir     = obj.DeliveryLeadTimeAir;
            objNew.DeliveryLeadTimeSurface = obj.DeliveryLeadTimeSurface;
            objNew.IsPriorityForLists      = obj.IsPriorityForLists;
            objNew.Inactive                = obj.Inactive;
            objNew.UpdatedBy               = obj.UpdatedBy;
            objNew.DLUP                    = obj.DLUP;
            objNew.TaxName                 = obj.TaxName;
            return(objNew);
        }
Exemplo n.º 28
0
        public ActionResult CountryNext()
        {
            IQueryable <tblCountry> users = (IQueryable <tblCountry>)Session["users"];

            if (users != null)
            {
                int pageindex = Convert.ToInt32(Session["pageindex"]);
                pageindex++;
                var filter = users.OrderBy(p => p.CountryId).Skip(pageindex * PageSize).Take(PageSize);
                if (filter.Count() > 0)
                {
                    Session["pageindex"] = pageindex;
                    CountryDetails obj = new CountryDetails()
                    {
                        Status       = true,
                        ErrorMessage = "",
                        CountryList  = filter
                    };
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                    //return Json(filter, JsonRequestBehavior.AllowGet);
                }
                else
                {
                    CountryDetails obj = new CountryDetails()
                    {
                        Status       = false,
                        ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.NoMoreInformationAvail : "आणखी माहिती उपलब्ध नाही"
                    };
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(CountryFirst());
            }
        }
Exemplo n.º 29
0
        public CircularChartViewModel()
        {
            DoughnutSeriesData = new ObservableCollection<StackedDoughnutModel>
            {
                new StackedDoughnutModel("Vehicle", 62.7, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Car.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Education",29.5, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Chart_Book.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Home", 85.2, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/House.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Personal", 45.6, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Personal.png", UriKind.RelativeOrAbsolute))
            };

            this.CountryDetails = new List<Populations>();
            CountryDetails.Add(new Populations() { Countries = "Uruguay", Count = 2807 });
            CountryDetails.Add(new Populations() { Countries = "Argentina", Count = 2577 });
            CountryDetails.Add(new Populations() { Countries = "USA", Count = 2473 });
            CountryDetails.Add(new Populations() { Countries = "Germany", Count = 2120 });
            CountryDetails.Add(new Populations() { Countries = "Netherlands", Count = 2071 });
            CountryDetails.Add(new Populations() { Countries = "Malta", Count = 960 });
            

            CompanyDetails = new List<CompanyDetail>();
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "Rolls Royce", CompanyTurnover = 750000 });
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "Benz", CompanyTurnover = 500000 });
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "Audi", CompanyTurnover = 450000 });
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "BMW", CompanyTurnover = 700000 });
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "Mahindra", CompanyTurnover = 350000 });
            CompanyDetails.Add(new CompanyDetail() { CompanyName = "Jaguar", CompanyTurnover = 650000 });

            Metric = new List<Metrics>();
            Metric.Add(new Metrics() { ResponseTime = 43, Utilization = 10 });
            Metric.Add(new Metrics() { ResponseTime = 20, Utilization = 20 });
            Metric.Add(new Metrics() { ResponseTime = 67, Utilization = 30 });
            Metric.Add(new Metrics() { ResponseTime = 52, Utilization = 40 });
            Metric.Add(new Metrics() { ResponseTime = 71, Utilization = 50 });
            Metric.Add(new Metrics() { ResponseTime = 30, Utilization = 60 });

            this.Population = new List<Populations>();
            Population.Add(new Populations() { Continent = "Asia", Countries = "China", States = "Taiwan", PopulationinContinents = 50.02, PopulationinCountries = 26.02, PopulationinStates = 18.02 });
            Population.Add(new Populations() { Continent = "Africa", Countries = "India", States = "Shandong", PopulationinContinents = 20.81, PopulationinCountries = 24, PopulationinStates = 8 });
            Population.Add(new Populations() { Continent = "Europe", Countries = "Nigeria", States = "UP", PopulationinContinents = 15.37, PopulationinCountries = 12.81, PopulationinStates = 14.5 });
            Population.Add(new Populations() { Countries = "Ethiopia", States = "Bihar", PopulationinCountries = 8, PopulationinStates = 9.5 });
            Population.Add(new Populations() { Countries = "Germany", States = "Kano", PopulationinCountries = 8.37, PopulationinStates = 7.81 });
            Population.Add(new Populations() { Countries = "Turkey", States = "Lagos", PopulationinCountries = 7, PopulationinStates = 5 });
            Population.Add(new Populations() { States = "Oromia", PopulationinStates = 5 });
            Population.Add(new Populations() { States = "Amhara", PopulationinStates = 3 });
            Population.Add(new Populations() { States = "Hessen", PopulationinStates = 5.37 });
            Population.Add(new Populations() { States = "Bayern", PopulationinStates = 3 });
            Population.Add(new Populations() { States = "Mugla", PopulationinStates = 4.5 });
            Population.Add(new Populations() { States = "Ankara", PopulationinStates = 2.5 });

            CustomBrush1 = new List<Brush>();
            CustomBrush2 = new List<Brush>();
            CustomBrush3 = new List<Brush>();

            List<Brush> chartColorModel = (Resources.ColorModelResource.Resource["CustomColor"] as ChartColorModel).CustomBrushes;
            SolidColorBrush interior1 = chartColorModel[0] as SolidColorBrush;
            SolidColorBrush interior2 = chartColorModel[1] as SolidColorBrush;
            SolidColorBrush interior3 = chartColorModel[2] as SolidColorBrush;

            CustomBrush1.Add(interior1);
            CustomBrush1.Add(interior2);
            CustomBrush1.Add(interior3);

            CustomBrush2.Add(interior1);
            CustomBrush2.Add(interior1);
            CustomBrush2.Add(interior2);
            CustomBrush2.Add(interior2);
            CustomBrush2.Add(interior3);
            CustomBrush2.Add(interior3);

            CustomBrush3.Add(interior1);
            CustomBrush3.Add(interior1);
            CustomBrush3.Add(interior1);
            CustomBrush3.Add(interior1);
            CustomBrush3.Add(interior2);
            CustomBrush3.Add(interior2);
            CustomBrush3.Add(interior2);
            CustomBrush3.Add(interior2);
            CustomBrush3.Add(interior3);
            CustomBrush3.Add(interior3);
            CustomBrush3.Add(interior3);
            CustomBrush3.Add(interior3);

        }
Exemplo n.º 30
0
        public PieChartViewModel()
        {
            DoughnutSeriesData = new ObservableCollection <StackedDoughnutModel>
            {
                new StackedDoughnutModel("Vehicle", 62.7, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Car.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Education", 29.5, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Chart_Book.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Home", 85.2, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/House.png", UriKind.RelativeOrAbsolute)),
                new StackedDoughnutModel("Personal", 45.6, new Uri("ms-appx:///Chart/Tutorials/ChartSamples/PieChart/Images/Personal.png", UriKind.RelativeOrAbsolute))
            };

            this.CountryDetails = new List <Populations>();
            CountryDetails.Add(new Populations()
            {
                Countries = "Uruguay", Count = 2807
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Argentina", Count = 2577
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "USA", Count = 2473
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Germany", Count = 2120
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Netherlands", Count = 2071
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Malta", Count = 960
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Maldives", Count = 941
            });
            CountryDetails.Add(new Populations()
            {
                Countries = "Monaco", Count = 908
            });

            CompanyDetails = new List <CompanyDetail>();
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Rolls Royce", CompanyTurnover = 750000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Benz", CompanyTurnover = 500000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Audi", CompanyTurnover = 450000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "BMW", CompanyTurnover = 700000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Mahindra", CompanyTurnover = 350000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Jaguar", CompanyTurnover = 650000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Hero Honda", CompanyTurnover = 250000
            });

            Metric = new List <Metrics>();
            Metric.Add(new Metrics()
            {
                ResponseTime = 43, Utilization = 32
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 20, Utilization = 34
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 67, Utilization = 41
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 52, Utilization = 42
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 71, Utilization = 48
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 30, Utilization = 45
            });

            this.Population = new List <Populations>();
            Population.Add(new Populations()
            {
                Continent = "Asia", Countries = "China", States = "Taiwan", PopulationinContinents = 50.02, PopulationinCountries = 26.02, PopulationinStates = 18.02
            });
            Population.Add(new Populations()
            {
                Continent = "Africa", Countries = "India", States = "Shandong", PopulationinContinents = 20.81, PopulationinCountries = 24, PopulationinStates = 8
            });
            Population.Add(new Populations()
            {
                Continent = "Europe", Countries = "Nigeria", States = "UP", PopulationinContinents = 15.37, PopulationinCountries = 12.81, PopulationinStates = 14.5
            });
            Population.Add(new Populations()
            {
                Countries = "Ethiopia", States = "Maharashtra", PopulationinCountries = 8, PopulationinStates = 9.5
            });
            Population.Add(new Populations()
            {
                Countries = "Germany", States = "Kano", PopulationinCountries = 8.37, PopulationinStates = 7.81
            });
            Population.Add(new Populations()
            {
                Countries = "Turkey", States = "Lagos", PopulationinCountries = 7, PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Oromia", PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Amhara", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Hessen", PopulationinStates = 5.37
            });
            Population.Add(new Populations()
            {
                States = "Bayern", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Istanbul", PopulationinStates = 4.5
            });
            Population.Add(new Populations()
            {
                States = "Ankara", PopulationinStates = 2.5
            });

            AdornmentsFac   = new ResourceFactory();
            AdornmentInfo   = new ChartAdornmentInfo();
            AdornmentInfo1  = new ChartAdornmentInfo();
            AdornmentInfo2  = new ChartAdornmentInfo();
            AdornmentInfo3  = new ChartAdornmentInfo();
            AdornmentInfo4  = new ChartAdornmentInfo();
            AdornmentInfo5  = new ChartAdornmentInfo();
            AdornmentInfo6  = new ChartAdornmentInfo();
            AdornmentInfo7  = new ChartAdornmentInfo();
            AdornmentInfo8  = new ChartAdornmentInfo();
            AdornmentInfo9  = new ChartAdornmentInfo();
            AdornmentInfo10 = new ChartAdornmentInfo();
            AdornmentInfo11 = new ChartAdornmentInfo();

            AdornmentInfo.HorizontalAlignment = HorizontalAlignment.Center;
            AdornmentInfo.VerticalAlignment   = VerticalAlignment.Center;
            AdornmentInfo.ShowConnectorLine   = true;
            AdornmentInfo.UseSeriesPalette    = true;
            AdornmentInfo.ConnectorHeight     = 30;
            AdornmentInfo.ShowLabel           = true;
            AdornmentInfo.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo.LabelTemplate       = AdornmentsFac.labelTemplate8;

            AdornmentInfo1.ShowLabel           = true;
            AdornmentInfo1.FontSize            = 10;
            AdornmentInfo1.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo1.LabelTemplate       = AdornmentsFac.labelTemplate21;

            AdornmentInfo2.ShowLabel           = true;
            AdornmentInfo2.FontSize            = 10;
            AdornmentInfo2.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo2.LabelTemplate       = AdornmentsFac.labelTemplate22;

            AdornmentInfo3.ShowLabel           = true;
            AdornmentInfo3.FontSize            = 10;
            AdornmentInfo3.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo3.LabelTemplate       = AdornmentsFac.labelTemplate23;

            AdornmentInfo4.ShowLabel           = true;
            AdornmentInfo4.SegmentLabelContent = LabelContent.Percentage;
            AdornmentInfo4.SegmentLabelFormat  = "##.#";
            AdornmentInfo4.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo4.HorizontalAlignment = HorizontalAlignment.Center;
            AdornmentInfo4.ConnectorHeight     = 30;
            AdornmentInfo4.VerticalAlignment   = VerticalAlignment.Center;
            AdornmentInfo4.ShowConnectorLine   = true;
            AdornmentInfo4.UseSeriesPalette    = true;

            AdornmentInfo5.ShowLabel        = true;
            AdornmentInfo5.UseSeriesPalette = true;

            AdornmentInfo6.ShowLabel           = true;
            AdornmentInfo6.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo6.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo6.LabelTemplate       = AdornmentsFac.labelTemplate21;

            AdornmentInfo7.ShowLabel           = true;
            AdornmentInfo7.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo7.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo7.LabelTemplate       = AdornmentsFac.labelTemplate22;

            AdornmentInfo8.ShowLabel           = true;
            AdornmentInfo8.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo8.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo8.LabelTemplate       = AdornmentsFac.labelTemplate23;

            AdornmentInfo9.ShowLabel         = true;
            AdornmentInfo9.ShowConnectorLine = true;
            AdornmentInfo9.UseSeriesPalette  = true;
            AdornmentInfo9.ConnectorHeight   = 17;

            AdornmentInfo10.ShowLabel = true;
            AdornmentInfo11.ShowLabel = true;
        }
Exemplo n.º 31
0
        /// <summary>
        /// The ValidateDevoteeDetails.
        /// </summary>
        /// <returns>The <see cref="bool"/>.</returns>
        internal bool ValidateDevoteeDetails()
        {
            bool blnSubmit = true;

            if (string.IsNullOrWhiteSpace(txtMobileNumber.Text) && txtMobileNumber.Text.Length <= 10)
            {
                blnSubmit = false;
                MessageBox.Show("Please enter valid mobile number !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            if (string.IsNullOrWhiteSpace(txtReceiptNumber.Text))
            {
                blnSubmit = false;
                MessageBox.Show("Please enter valid receipt number !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            if (string.IsNullOrWhiteSpace(txtName.Text))
            {
                blnSubmit = false;
                MessageBox.Show("Please enter valid devotee Name !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            if (string.IsNullOrWhiteSpace(txtAddress.Text))
            {
                blnSubmit = false;
                MessageBox.Show("Please enter valid devotee address !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            CountryDetails country = (CountryDetails)cmbCountry.SelectedItem;

            if (string.IsNullOrWhiteSpace(country.CountryName))
            {
                blnSubmit = false;
                MessageBox.Show("Please choose county details !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            StateDetails state = (StateDetails)cmbState.SelectedItem;

            if (string.IsNullOrWhiteSpace(state.StateName))
            {
                blnSubmit = false;
                MessageBox.Show("Please choose state details !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            CityDetails city = (CityDetails)cmbCity.SelectedItem;

            if (string.IsNullOrWhiteSpace(city.CityName))
            {
                blnSubmit = false;
                MessageBox.Show("Please choose city details !...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(blnSubmit);
            }

            if (dtAnadhanamDate.Value.Day == 1 && dtAnadhanamDate.Value.Month == 1)
            {
                blnSubmit = false;
                MessageBox.Show("Anadhanam cannot be made on this day,please choose other date !...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(blnSubmit);
            }
            else if (dtAnadhanamDate.Value.Date > DateTime.Now.AddMonths(4).Date)
            {
                blnSubmit = false;
                string strMessage = "Anadhanam date must not exceed more than 4 months (" + (DateTime.Now.AddMonths(4).Date).ToString("dd-MMM-yyyy") + ")!...";
                MessageBox.Show(strMessage, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(blnSubmit);
            }
            else if (dtAnadhanamDate.Value.Date < DateTime.Now.Date)
            {
                blnSubmit = false;
                MessageBox.Show("Anadhanam date must be Today or Above,You cannot select past date !...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(blnSubmit);
            }

            if (!string.IsNullOrWhiteSpace(Convert.ToString(cmbPaymentMode.Text.ToUpper())))
            {
                string strPaymentMode = Convert.ToString(cmbPaymentMode.Text.ToUpper());

                if (strPaymentMode == "CHEQUE")
                {
                    if (string.IsNullOrWhiteSpace(txtChequeNumber.Text))
                    {
                        blnSubmit = false;
                        MessageBox.Show("Please enter cheque number & proceed !...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(blnSubmit);
                    }

                    if (string.IsNullOrWhiteSpace(txtDrawnOn.Text))
                    {
                        blnSubmit = false;
                        MessageBox.Show("Please enter cheque drawn details & Proceed !...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(blnSubmit);
                    }
                }
            }
            else
            {
                blnSubmit = false;
                MessageBox.Show("Please Select Payment Mode!...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(blnSubmit);
            }

            return(blnSubmit);
        }