partial void DeleteLocality(Locality instance);
/// <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(); }
partial void UpdateLocality(Locality instance);
partial void InsertLocality(Locality instance);
partial void DeleteLocality(Locality instance);
partial void UpdateLocality(Locality instance);
partial void InsertLocality(Locality instance);