Esempio n. 1
0
            public override DataTable Clone()
            {
                CityDataTable cln = ((CityDataTable)(base.Clone()));

                cln.InitVars();
                return(cln);
            }
Esempio n. 2
0
        public CityDataTable GetCities(string name, int page, int pageSize) //admin
        {
            name = name ?? "";
            var cities = new List <City>();

            if (page > 0 && pageSize > 0)
            {
                cities = _cityRepository.GetAllQueryable()
                         .Where(x => x.Deleted == false)
                         .Where(x => x.Name.ToLower().Contains(name.ToLower()))
                         .OrderBy(x => x.Name)
                         .Skip((page - 1) * pageSize).Take(pageSize).ToList();
            }
            else
            {
                cities = _cityRepository.GetAllQueryable()
                         .Where(x => x.Deleted == false)
                         .Where(x => x.Name.ToLower().Contains(name.ToLower()))
                         .OrderBy(x => x.Name).ToList();
            }

            var totalCities = _cityRepository.GetAllQueryable()
                              .Where(x => x.Deleted == false)
                              .Where(x => x.Name.ToLower().Contains(name.ToLower())).Count();

            var cityRowViewModels = _mapper.Map <List <City>, List <CityRowViewModel> >(cities);
            var cityDataTable     = new CityDataTable()
            {
                Data  = cityRowViewModels,
                Total = totalCities
            };

            return(cityDataTable);
        }
Esempio n. 3
0
        public void AddCity(CityDataTable cityDataTable)
        {
            City city = new City()
            {
                Name = cityDataTable.Name
            };

            drivingSchoolEntities.City.Add(city);
            drivingSchoolEntities.SaveChanges();
        }
Esempio n. 4
0
 private void InitClass()
 {
     this.DataSetName        = "AddressDictionary";
     this.Prefix             = "";
     this.Namespace          = "http://tempuri.org/Dataset1.xsd";
     this.Locale             = new System.Globalization.CultureInfo("en-US");
     this.CaseSensitive      = false;
     this.EnforceConstraints = true;
     this.tableStreetSuffix  = new StreetSuffixDataTable();
     this.Tables.Add(this.tableStreetSuffix);
     this.tableCountry = new CountryDataTable();
     this.Tables.Add(this.tableCountry);
     this.tableCity = new CityDataTable();
     this.Tables.Add(this.tableCity);
     this.tableStateProvince = new StateProvinceDataTable();
     this.Tables.Add(this.tableStateProvince);
 }
Esempio n. 5
0
 internal void InitVars()
 {
     this.tableStreetSuffix = ((StreetSuffixDataTable)(this.Tables["StreetSuffix"]));
     if ((this.tableStreetSuffix != null))
     {
         this.tableStreetSuffix.InitVars();
     }
     this.tableCountry = ((CountryDataTable)(this.Tables["Country"]));
     if ((this.tableCountry != null))
     {
         this.tableCountry.InitVars();
     }
     this.tableCity = ((CityDataTable)(this.Tables["City"]));
     if ((this.tableCity != null))
     {
         this.tableCity.InitVars();
     }
     this.tableStateProvince = ((StateProvinceDataTable)(this.Tables["StateProvince"]));
     if ((this.tableStateProvince != null))
     {
         this.tableStateProvince.InitVars();
     }
 }
Esempio n. 6
0
 private void InitClass() {
     this.DataSetName = "Countries";
     this.Prefix = "";
     this.EnforceConstraints = true;
     this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
     this.tableCountry = new CountryDataTable();
     base.Tables.Add(this.tableCountry);
     this.tableRegion = new RegionDataTable();
     base.Tables.Add(this.tableRegion);
     this.tableCity = new CityDataTable();
     base.Tables.Add(this.tableCity);
     global::System.Data.ForeignKeyConstraint fkc;
     fkc = new global::System.Data.ForeignKeyConstraint("Country_Region", new global::System.Data.DataColumn[] {
                 this.tableCountry.Country_IdColumn}, new global::System.Data.DataColumn[] {
                 this.tableRegion.Country_IdColumn});
     this.tableRegion.Constraints.Add(fkc);
     fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = global::System.Data.Rule.Cascade;
     fkc.UpdateRule = global::System.Data.Rule.Cascade;
     fkc = new global::System.Data.ForeignKeyConstraint("Region_City", new global::System.Data.DataColumn[] {
                 this.tableRegion.Region_IdColumn}, new global::System.Data.DataColumn[] {
                 this.tableCity.Region_IdColumn});
     this.tableCity.Constraints.Add(fkc);
     fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = global::System.Data.Rule.Cascade;
     fkc.UpdateRule = global::System.Data.Rule.Cascade;
     this.relationCountry_Region = new global::System.Data.DataRelation("Country_Region", new global::System.Data.DataColumn[] {
                 this.tableCountry.Country_IdColumn}, new global::System.Data.DataColumn[] {
                 this.tableRegion.Country_IdColumn}, false);
     this.relationCountry_Region.Nested = true;
     this.Relations.Add(this.relationCountry_Region);
     this.relationRegion_City = new global::System.Data.DataRelation("Region_City", new global::System.Data.DataColumn[] {
                 this.tableRegion.Region_IdColumn}, new global::System.Data.DataColumn[] {
                 this.tableCity.Region_IdColumn}, false);
     this.relationRegion_City.Nested = true;
     this.Relations.Add(this.relationRegion_City);
 }
Esempio n. 7
0
 internal void InitVars(bool initTable) {
     this.tableCountry = ((CountryDataTable)(base.Tables["Country"]));
     if ((initTable == true)) {
         if ((this.tableCountry != null)) {
             this.tableCountry.InitVars();
         }
     }
     this.tableRegion = ((RegionDataTable)(base.Tables["Region"]));
     if ((initTable == true)) {
         if ((this.tableRegion != null)) {
             this.tableRegion.InitVars();
         }
     }
     this.tableCity = ((CityDataTable)(base.Tables["City"]));
     if ((initTable == true)) {
         if ((this.tableCity != null)) {
             this.tableCity.InitVars();
         }
     }
     this.relationCountry_Region = this.Relations["Country_Region"];
     this.relationRegion_City = this.Relations["Region_City"];
 }
Esempio n. 8
0
 internal CityRow(global::System.Data.DataRowBuilder rb) : 
         base(rb) {
     this.tableCity = ((CityDataTable)(this.Table));
 }
Esempio n. 9
0
 internal CityRow(DataRowBuilder rb) :
     base(rb)
 {
     this.tableCity = ((CityDataTable)(this.Table));
 }
Esempio n. 10
0
 public void AddCity(CityDataTable cityDataTable)
 {
     cityDbService.AddCity(cityDataTable);
 }
Esempio n. 11
0
 private void InitClass() {
     this.DataSetName = "dsWT";
     this.Prefix = "";
     this.Namespace = "http://tempuri.org/dsWT.xsd";
     this.EnforceConstraints = true;
     this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     this.tableCountry = new CountryDataTable();
     base.Tables.Add(this.tableCountry);
     this.tableState = new StateDataTable();
     base.Tables.Add(this.tableState);
     this.tableContinent = new ContinentDataTable();
     base.Tables.Add(this.tableContinent);
     this.tableTimezone = new TimezoneDataTable();
     base.Tables.Add(this.tableTimezone);
     this.tableCity = new CityDataTable();
     base.Tables.Add(this.tableCity);
     System.Data.ForeignKeyConstraint fkc;
     fkc = new System.Data.ForeignKeyConstraint("FK_Continent_Country_Continent_ID", new System.Data.DataColumn[] {
                 this.tableContinent.Continent_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCountry.Continent_IDColumn});
     this.tableCountry.Constraints.Add(fkc);
     fkc.AcceptRejectRule = System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = System.Data.Rule.Cascade;
     fkc.UpdateRule = System.Data.Rule.Cascade;
     fkc = new System.Data.ForeignKeyConstraint("FK_Country_State_Country_ID", new System.Data.DataColumn[] {
                 this.tableCountry.Country_IDColumn}, new System.Data.DataColumn[] {
                 this.tableState.Country_IDColumn});
     this.tableState.Constraints.Add(fkc);
     fkc.AcceptRejectRule = System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = System.Data.Rule.Cascade;
     fkc.UpdateRule = System.Data.Rule.Cascade;
     fkc = new System.Data.ForeignKeyConstraint("FK_Timezone_City_Timezone_ID", new System.Data.DataColumn[] {
                 this.tableTimezone.Timezone_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCity.Timezone_IDColumn});
     this.tableCity.Constraints.Add(fkc);
     fkc.AcceptRejectRule = System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = System.Data.Rule.Cascade;
     fkc.UpdateRule = System.Data.Rule.Cascade;
     fkc = new System.Data.ForeignKeyConstraint("FK_State_City_State_ID", new System.Data.DataColumn[] {
                 this.tableState.State_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCity.State_IDColumn});
     this.tableCity.Constraints.Add(fkc);
     fkc.AcceptRejectRule = System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = System.Data.Rule.Cascade;
     fkc.UpdateRule = System.Data.Rule.Cascade;
     this.relationFK_Continent_Country_Continent_ID = new System.Data.DataRelation("FK_Continent_Country_Continent_ID", new System.Data.DataColumn[] {
                 this.tableContinent.Continent_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCountry.Continent_IDColumn}, false);
     this.Relations.Add(this.relationFK_Continent_Country_Continent_ID);
     this.relationFK_Country_State_Country_ID = new System.Data.DataRelation("FK_Country_State_Country_ID", new System.Data.DataColumn[] {
                 this.tableCountry.Country_IDColumn}, new System.Data.DataColumn[] {
                 this.tableState.Country_IDColumn}, false);
     this.Relations.Add(this.relationFK_Country_State_Country_ID);
     this.relationFK_Timezone_City_Timezone_ID = new System.Data.DataRelation("FK_Timezone_City_Timezone_ID", new System.Data.DataColumn[] {
                 this.tableTimezone.Timezone_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCity.Timezone_IDColumn}, false);
     this.Relations.Add(this.relationFK_Timezone_City_Timezone_ID);
     this.relationFK_State_City_State_ID = new System.Data.DataRelation("FK_State_City_State_ID", new System.Data.DataColumn[] {
                 this.tableState.State_IDColumn}, new System.Data.DataColumn[] {
                 this.tableCity.State_IDColumn}, false);
     this.Relations.Add(this.relationFK_State_City_State_ID);
 }
Esempio n. 12
0
 internal void InitVars(bool initTable) {
     this.tableCountry = ((CountryDataTable)(base.Tables["Country"]));
     if ((initTable == true)) {
         if ((this.tableCountry != null)) {
             this.tableCountry.InitVars();
         }
     }
     this.tableState = ((StateDataTable)(base.Tables["State"]));
     if ((initTable == true)) {
         if ((this.tableState != null)) {
             this.tableState.InitVars();
         }
     }
     this.tableContinent = ((ContinentDataTable)(base.Tables["Continent"]));
     if ((initTable == true)) {
         if ((this.tableContinent != null)) {
             this.tableContinent.InitVars();
         }
     }
     this.tableTimezone = ((TimezoneDataTable)(base.Tables["Timezone"]));
     if ((initTable == true)) {
         if ((this.tableTimezone != null)) {
             this.tableTimezone.InitVars();
         }
     }
     this.tableCity = ((CityDataTable)(base.Tables["City"]));
     if ((initTable == true)) {
         if ((this.tableCity != null)) {
             this.tableCity.InitVars();
         }
     }
     this.relationFK_Continent_Country_Continent_ID = this.Relations["FK_Continent_Country_Continent_ID"];
     this.relationFK_Country_State_Country_ID = this.Relations["FK_Country_State_Country_ID"];
     this.relationFK_Timezone_City_Timezone_ID = this.Relations["FK_Timezone_City_Timezone_ID"];
     this.relationFK_State_City_State_ID = this.Relations["FK_State_City_State_ID"];
 }
Esempio n. 13
0
 private void InitClass() {
     this.DataSetName = "VCFDataSet";
     this.Prefix = "";
     this.Namespace = "http://tempuri.org/VCFDataSet.xsd";
     this.EnforceConstraints = true;
     this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     this.tableCity = new CityDataTable();
     base.Tables.Add(this.tableCity);
     this.tableDonation = new DonationDataTable();
     base.Tables.Add(this.tableDonation);
     this.tableUser = new UserDataTable();
     base.Tables.Add(this.tableUser);
     this.tableProject = new ProjectDataTable();
     base.Tables.Add(this.tableProject);
     this.tableDistribution = new DistributionDataTable();
     base.Tables.Add(this.tableDistribution);
     this.tableV_Distribution_Project = new V_Distribution_ProjectDataTable();
     base.Tables.Add(this.tableV_Distribution_Project);
     this.tableV_User_Distribution_Project = new V_User_Distribution_ProjectDataTable();
     base.Tables.Add(this.tableV_User_Distribution_Project);
     this.tableV_FormatedUser = new V_FormatedUserDataTable();
     base.Tables.Add(this.tableV_FormatedUser);
     this.tableUserRelationShip = new UserRelationShipDataTable();
     base.Tables.Add(this.tableUserRelationShip);
     this.tableV_ProjectNameAndID = new V_ProjectNameAndIDDataTable();
     base.Tables.Add(this.tableV_ProjectNameAndID);
     this.relationFK_User_User = new System.Data.DataRelation("FK_User_User", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableUser.FatherUserIDColumn}, false);
     this.Relations.Add(this.relationFK_User_User);
     this.relationFK_Donation_User = new System.Data.DataRelation("FK_Donation_User", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableDonation.DonationUserIDColumn}, false);
     this.Relations.Add(this.relationFK_Donation_User);
     this.relationFK_Donation_Project = new System.Data.DataRelation("FK_Donation_Project", new System.Data.DataColumn[] {
                 this.tableProject.ProjectIDColumn}, new System.Data.DataColumn[] {
                 this.tableDonation.ProjectIDColumn}, false);
     this.Relations.Add(this.relationFK_Donation_Project);
     this.relationFK_Project_Project = new System.Data.DataRelation("FK_Project_Project", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableProject.ManagerIDColumn}, false);
     this.Relations.Add(this.relationFK_Project_Project);
     this.relationFK_Distribution_Project = new System.Data.DataRelation("FK_Distribution_Project", new System.Data.DataColumn[] {
                 this.tableProject.ProjectIDColumn}, new System.Data.DataColumn[] {
                 this.tableDistribution.ProjectIDColumn}, false);
     this.Relations.Add(this.relationFK_Distribution_Project);
     this.relationFK_Distribution_User = new System.Data.DataRelation("FK_Distribution_User", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableDistribution.FromUserIDColumn}, false);
     this.Relations.Add(this.relationFK_Distribution_User);
     this.relationFK_Distribution_User1 = new System.Data.DataRelation("FK_Distribution_User1", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableDistribution.ToUserIDColumn}, false);
     this.Relations.Add(this.relationFK_Distribution_User1);
     this.relationFK_UserRelationShip_Project = new System.Data.DataRelation("FK_UserRelationShip_Project", new System.Data.DataColumn[] {
                 this.tableProject.ProjectIDColumn}, new System.Data.DataColumn[] {
                 this.tableUserRelationShip.ProjectIDColumn}, false);
     this.Relations.Add(this.relationFK_UserRelationShip_Project);
     this.relationFK_UserRelationShip_User = new System.Data.DataRelation("FK_UserRelationShip_User", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableUserRelationShip.SuperiorUserIDColumn}, false);
     this.Relations.Add(this.relationFK_UserRelationShip_User);
     this.relationFK_UserRelationShip_User1 = new System.Data.DataRelation("FK_UserRelationShip_User1", new System.Data.DataColumn[] {
                 this.tableUser.UserIDColumn}, new System.Data.DataColumn[] {
                 this.tableUserRelationShip.InferiorUserIDColumn}, false);
     this.Relations.Add(this.relationFK_UserRelationShip_User1);
 }
Esempio n. 14
0
 internal void InitVars(bool initTable) {
     this.tableCity = ((CityDataTable)(base.Tables["City"]));
     if ((initTable == true)) {
         if ((this.tableCity != null)) {
             this.tableCity.InitVars();
         }
     }
     this.tableDonation = ((DonationDataTable)(base.Tables["Donation"]));
     if ((initTable == true)) {
         if ((this.tableDonation != null)) {
             this.tableDonation.InitVars();
         }
     }
     this.tableUser = ((UserDataTable)(base.Tables["User"]));
     if ((initTable == true)) {
         if ((this.tableUser != null)) {
             this.tableUser.InitVars();
         }
     }
     this.tableProject = ((ProjectDataTable)(base.Tables["Project"]));
     if ((initTable == true)) {
         if ((this.tableProject != null)) {
             this.tableProject.InitVars();
         }
     }
     this.tableDistribution = ((DistributionDataTable)(base.Tables["Distribution"]));
     if ((initTable == true)) {
         if ((this.tableDistribution != null)) {
             this.tableDistribution.InitVars();
         }
     }
     this.tableV_Distribution_Project = ((V_Distribution_ProjectDataTable)(base.Tables["V_Distribution_Project"]));
     if ((initTable == true)) {
         if ((this.tableV_Distribution_Project != null)) {
             this.tableV_Distribution_Project.InitVars();
         }
     }
     this.tableV_User_Distribution_Project = ((V_User_Distribution_ProjectDataTable)(base.Tables["V_User_Distribution_Project"]));
     if ((initTable == true)) {
         if ((this.tableV_User_Distribution_Project != null)) {
             this.tableV_User_Distribution_Project.InitVars();
         }
     }
     this.tableV_FormatedUser = ((V_FormatedUserDataTable)(base.Tables["V_FormatedUser"]));
     if ((initTable == true)) {
         if ((this.tableV_FormatedUser != null)) {
             this.tableV_FormatedUser.InitVars();
         }
     }
     this.tableUserRelationShip = ((UserRelationShipDataTable)(base.Tables["UserRelationShip"]));
     if ((initTable == true)) {
         if ((this.tableUserRelationShip != null)) {
             this.tableUserRelationShip.InitVars();
         }
     }
     this.tableV_ProjectNameAndID = ((V_ProjectNameAndIDDataTable)(base.Tables["V_ProjectNameAndID"]));
     if ((initTable == true)) {
         if ((this.tableV_ProjectNameAndID != null)) {
             this.tableV_ProjectNameAndID.InitVars();
         }
     }
     this.relationFK_User_User = this.Relations["FK_User_User"];
     this.relationFK_Donation_User = this.Relations["FK_Donation_User"];
     this.relationFK_Donation_Project = this.Relations["FK_Donation_Project"];
     this.relationFK_Project_Project = this.Relations["FK_Project_Project"];
     this.relationFK_Distribution_Project = this.Relations["FK_Distribution_Project"];
     this.relationFK_Distribution_User = this.Relations["FK_Distribution_User"];
     this.relationFK_Distribution_User1 = this.Relations["FK_Distribution_User1"];
     this.relationFK_UserRelationShip_Project = this.Relations["FK_UserRelationShip_Project"];
     this.relationFK_UserRelationShip_User = this.Relations["FK_UserRelationShip_User"];
     this.relationFK_UserRelationShip_User1 = this.Relations["FK_UserRelationShip_User1"];
 }