コード例 #1
0
        public void addDistrict(string dName)
        {
            if (dName.Length > 3)
            {
                District newD = new Model.District { Name = dName };
                if (uOW.DistrictRepo.All.Where(x => x.Name.Equals(newD.Name, StringComparison.InvariantCultureIgnoreCase)).Count() == 0)
                {

                    uOW.DistrictRepo.Insert(newD);
                    uOW.Save();
                }
            }
        }
コード例 #2
0
ファイル: DistrictManager.cs プロジェクト: CH033dotNET/Taxi
 private void SortCoordinates(District district)
 {
     district.Coordinates = district.Coordinates.OrderBy(c => c.Index).ToList();
 }
コード例 #3
0
ファイル: DistrictManager.cs プロジェクト: CH033dotNET/Taxi
 /// <summary>
 /// Manager method that is used to set specific district object to avialable state. 
 /// It changes object`s Deleted property to false.
 /// </summary>
 /// <param name="district"></param>
 /// <returns></returns>
 private District SetStateRestored(District district)
 {
     uOW.DistrictRepo.SetStateModified(district);
     district.Deleted = false;
     uOW.Save();
     return district;
 }
コード例 #4
0
ファイル: DistrictManager.cs プロジェクト: CH033dotNET/Taxi
 /// <summary>
 /// Private manager method that incapsulates all logic we need to set specific district entry to deleted state.
 /// </summary>
 /// <param name="district">Input paramater that represents object that we need to change.</param>
 /// <returns></returns>
 private District SetStateDeleted(District district)
 {
     uOW.DistrictRepo.SetStateModified(district);
     district.Deleted = true;
     district.ParentId = null;
     uOW.Save();
     return district;
 }
コード例 #5
0
ファイル: DistrictManager.cs プロジェクト: CH033dotNET/Taxi
 /// <summary>
 /// Private managaer method that incapsulates edititng logic. Used by edit method, 
 /// that changes specific district name property.
 /// </summary>
 /// <param name="oldDistrict">Input parameter that represents old district entry that we need to change.</param>
 /// <param name="inputDistrict">Input parameter that represents new district entry that we use to change old entry.</param>
 /// <returns></returns>
 private District SetDistrictStateModified(District oldDistrict, District inputDistrict)
 {
     oldDistrict.Name = inputDistrict.Name;
     oldDistrict.Coordinates = inputDistrict.Coordinates;
     uOW.DistrictRepo.SetStateModified(oldDistrict);
     uOW.Save();
     return oldDistrict;
 }
コード例 #6
0
 public ActionResult DeleteDistrict(District a)
 {
     districtManager.deleteById(a.Id);
     return RedirectToAction("DistrictEditor");
 }