public ActionResult DeleteConfirmed(int id)
        {
            Nationalities nationalities = db.Nationalities.Find(id);

            db.Nationalities.Remove(nationalities);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "NationalityID,Nationality")] Nationalities nationalities)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nationalities).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nationalities));
 }
 public ActionResult Edit([Bind(Include = "Id,Nationality,RegisterDate,IsActive")] Nationalities nationalities)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nationalities).State = EntityState.Modified;
         db.SaveChanges();
         TempData["successNationalityEdit"] = "*Uyruk kaydı başarıyla güncellenmiştir.";
         return(RedirectToAction("Index"));
     }
     return(View(nationalities));
 }
        public ActionResult Create([Bind(Include = "NationalityID,Nationality")] Nationalities nationalities)
        {
            if (ModelState.IsValid)
            {
                db.Nationalities.Add(nationalities);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nationalities));
        }
 public ActionResult Create([Bind(Include = "Id,Nationality,RegisterDate,IsActive")] Nationalities nationalities)
 {
     if (ModelState.IsValid)
     {
         nationalities.RegisterDate = DateTime.Now;
         nationalities.IsActive     = true;
         db.Nationalities.Add(nationalities);
         db.SaveChanges();
         TempData["successNationalityRegister"] = "*Uyruk kaydı başarıyla tamamlanmıştır.";
         return(RedirectToAction("Index"));
     }
     return(View(nationalities));
 }
        // GET: Nationality/Edit
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index", "Nationality"));
            }
            Nationalities nationalities = db.Nationalities.Find(id);

            if (nationalities == null)
            {
                return(RedirectToAction("Error", "Account"));
            }
            return(View(nationalities));
        }
 public static Nationalities ModelToEnity(this NationalitiesModel model, bool virtualActive = false)
 {
     Nationalities entity = new Nationalities()
     {
        CountryName = model.CountryName,
        Name = model.Name,
        Id = model.Id
     };
     if (virtualActive)
     {
         entity.Customers = model.Customers;
     }
     return entity;
 }
        // GET: Nationalities/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Nationalities nationalities = db.Nationalities.Find(id);

            if (nationalities == null)
            {
                return(HttpNotFound());
            }
            return(View(nationalities));
        }
예제 #9
0
        public IndividualItem(ConsolidatedList consolidated, XElement xelem) : this()
        {
            if (consolidated != null)
            {
                ConsolidatedList = consolidated;
                ConsListId       = consolidated.Id;
            }
            ;
            if (xelem != null && xelem.Name.LocalName == "INDIVIDUAL")
            {
                FillCommonInfo(xelem);

                SecondName  = xelem.Element(S("SECOND_NAME"))?.Value;
                ThirdName   = xelem.Element(S("THIRD_NAME"))?.Value;
                FourthName  = xelem.Element(S("FOURTH_NAME"))?.Value;
                Gender      = xelem.Element(S("GENDER"))?.Value;
                Nationality = xelem.Element(S("NATIONALITY2"))?.Value;
                SubmittedBy = xelem.Element(S("SUBMITTED_BY"))?.Value;


                Aliases   = xelem.Elements(S("INDIVIDUAL_ALIAS")).Select(s => new IndividualAlias(this, s)).Where(w => w.IsCorrect()).ToList();
                DOBs      = xelem.Elements(S("INDIVIDUAL_DATE_OF_BIRTH")).Select(s => new IndividualDOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                POBs      = xelem.Elements(S("INDIVIDUAL_PLACE_OF_BIRTH")).Select(s => new IndividualPOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Docs      = xelem.Elements(S("INDIVIDUAL_DOCUMENT")).Select(s => new IndividualDoc(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Addresses = xelem.Elements(S("INDIVIDUAL_ADDRESS")).Select(s => new Address(this, s)).Where(w => w != null && w.IsCorrect()).ToList();


                var titles        = xelem.Element(S("TITLE"));
                var designations  = xelem.Element(S("DESIGNATION"));
                var nationalities = xelem.Element(S("NATIONALITY"));

                if (titles != null)
                {
                    Titles.AddRange(titles.Elements().Select(s => new Title(this, s)).Where(w => w != null).ToList());
                }
                if (designations != null)
                {
                    Designations.AddRange(designations.Elements().Select(s => new Designation(this, s)).Where(w => w != null).ToList());
                }
                if (nationalities != null)
                {
                    Nationalities.AddRange(nationalities.Elements().Select(s => new Nationality(this, s)).Where(w => w != null).ToList());
                }


                FillLastDayUpdates(xelem.Element(S("LAST_DAY_UPDATED")));
            }
            ;
        }
예제 #10
0
        private void LoadNationalityData(object obj)
        {
            var selected = Nationalities.Where((x => x.IsSelected == true)).ToArray();
            var entries  = this.AppLogic.GetUserByNationality(selected);

            NationalitiesChart = new LineChart()
            {
                Entries = entries
            };
            NationalitiesPointChart = new PointChart()
            {
                Entries = entries
            };
            Navigation.PushNonAwaited <NationalityChartPage>();
        }
예제 #11
0
        public static Nationalities ModelToEnity(this NationalitiesModel model, bool virtualActive = false)
        {
            Nationalities entity = new Nationalities()
            {
                CountryName = model.CountryName,
                Name        = model.Name,
                Id          = model.Id
            };

            if (virtualActive)
            {
                entity.Customers = model.Customers;
            }
            return(entity);
        }
예제 #12
0
        public static NationalitiesModel EntityToModel(this Nationalities entity, bool virtualActive = false)
        {
            NationalitiesModel model = new NationalitiesModel()
            {
                CountryName = entity.CountryName,
                Name        = entity.Name,
                Id          = entity.Id
            };

            if (virtualActive)
            {
                model.Customers = entity.Customers;
            }

            return(model);
        }
예제 #13
0
        private void ReleaseResources()
        {
            Nationalities?.Dispose();
            Users?.Dispose();

            if (GenderChart != null)
            {
                GenderChart = null;
            }
            if (NationalitiesChart != null)
            {
                NationalitiesChart = null;
            }
            if (AgeChart != null)
            {
                AgeChart = null;
            }
        }
예제 #14
0
 public Musician(int id, string name, Nationalities nationality)
 {
     Id          = id;
     Name        = name;
     Nationality = nationality;
 }
예제 #15
0
 /// <summary>
 /// Gets the nationality of the manager
 /// </summary>
 /// <param name="culture">The culture.</param>
 /// <returns>Return a nationality of the manager</returns>
 public string GetNationality(CultureInfo culture)
 {
     return(Nationalities == null || !Nationalities.ContainsKey(culture)
         ? null
         : Nationalities[culture]);
 }