private void SaveDataToDataBase(RegionEntity re) { string message; if (re.Id == 0) { re.CountryId = int.Parse(ddlCountry.SelectedValue); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewRegion(re); } } else { using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdateRegion(re); } } ProcessDatabaseReply(message, UpdateRegionSuccess, AdminMappingEnum.OpsRegion, lblMessage); if (message == string.Empty) { ToggleEnableForValidators(false); } }
protected void btnDelete_Click(object sender, EventArgs e) { string message; var areaIdToDelete = int.Parse(hfAreaId.Value); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.DeleteArea(areaIdToDelete); } ProcessDatabaseReply(message, UpdateAreaDeleted, AdminMappingEnum.OpsArea, lblMessage); }
protected void btnDelete_Click(object sender, EventArgs e) { string message; var locationGroupIdToDelete = int.Parse(hfLocationGroupId.Value); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.DeleteLocationGroup(locationGroupIdToDelete); } ProcessDatabaseReply(message, UpdateLocationGroupDeleted, AdminMappingEnum.CmsLocationGroup, lblMessage); }
protected void btnDelete_Click(object sender, EventArgs e) { string message; var regionIdToDelete = int.Parse(hfRegionId.Value); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.DeleteRegion(regionIdToDelete); } ProcessDatabaseReply(message, UpdateRegionDeleted, AdminMappingEnum.OpsRegion, lblMessage); if (message == string.Empty) { ToggleEnableForValidators(false); } }
private void SaveDataToDataBase(CountryEntity ce) { string message; if (ce.Id == 0) { using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewCountry(ce); } } else { using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdateCountry(ce); } } ProcessDatabaseReply(message, UpdateCountrySuccess, AdminMappingEnum.Country, lblMessage); }
private void SaveDataToDataBase(CarSegmentEntity cse) { string message; if (cse.Id == 0) { cse.CountryId = int.Parse(ddlCountry.SelectedValue); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewCarSegment(cse); } } else { using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdateCarSegment(cse); } } ProcessDatabaseReply(message, UpdateCarSegmentSuccess, AdminMappingEnum.CarSegment, lblMessage); }
private void SaveDataToDataBase(LocationGroupEntity lge) { string message; if (lge.Id == 0) { //lge.CountryId = int.Parse(ddlCountry.SelectedValue); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewLocationGroup(lge); } } else { lge.Id = int.Parse(hfLocationGroupId.Value); using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdateLocationGroup(lge); } } ProcessDatabaseReply(message, UpdateLocationGroupSuccess, AdminMappingEnum.CmsLocationGroup, lblMessage); }
private void SaveDataToDataBase(PoolEntity pe) { string message; if (pe.Id == 0) { pe.CountryId = int.Parse(ddlCountry.SelectedValue); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewPool(pe); } } else { using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdatePool(pe); } } ProcessDatabaseReply(message, UpdatePoolSuccess, AdminMappingEnum.CmsPool, lblMessage); }
private void SaveDataToDataBase(AreaEntity ae) { string message; if (ae.Id == 0) { ae.CountryId = int.Parse(ddlCountry.SelectedValue); using (var dataAccess = new MappingDeleteAndCreate()) { message = dataAccess.CreateNewArea(ae); } } else { ae.Id = int.Parse(hfAreaId.Value); using (var dataAccess = new MappingSingleUpdate()) { message = dataAccess.UpdateArea(ae); } } ProcessDatabaseReply(message, UpdateAreaSuccess, AdminMappingEnum.OpsArea, lblMessage); }