Exemplo n.º 1
0
 partial void DeleteLocality(Locality instance);
Exemplo n.º 2
0
        /// <summary>
        /// InsertWardDetails for Locality
        /// </summary>
        /// <param name="zoneId"></param>
        /// <param name="wardNumber"></param>
        /// <param name="wardName"></param>
        /// <param name="localityPath"></param>
        public void InsertWard(string localityPath)
        {
            IList<LocalityPoint> localities = ReadLocality(localityPath);

            IList<Locality> localityList = new List<Locality>();

            foreach (var locality in localities)
            {
                var wards = context.Wards.Where(@w => @w.Number == locality.WardNumber);
                Guid wardId;

                if (wards.Count() > 1)
                {
                    wardId = wards.Where(@w => @w.Name.Contains(locality.SubWardNumber.ToString())).First().Id;
                }
                else
                {
                    wardId = wards.First().Id;
                }

                Locality loc = new Locality
                {
                    Id = Guid.NewGuid(),
                    Name = locality.DisplayName,
                    WardId = wardId
                };

                localityList.Add(loc);
            }

            context.Localities.InsertAllOnSubmit(localityList.AsEnumerable());
            SubmitData();
        }
Exemplo n.º 3
0
 partial void UpdateLocality(Locality instance);
Exemplo n.º 4
0
 partial void InsertLocality(Locality instance);
Exemplo n.º 5
0
 partial void DeleteLocality(Locality instance);
Exemplo n.º 6
0
 partial void UpdateLocality(Locality instance);
Exemplo n.º 7
0
 partial void InsertLocality(Locality instance);