public ListingItem ReplaceItem(int day, string locality, Time start, Time end, Time lunchStart, Time lunchEnd, Time otherHours) { if (!_items.ContainsKey(day)) { return(AddItem(day, locality, start, end, lunchStart, lunchEnd, otherHours)); } ListingItem oldItem = GetItemByDay(day); ReplaceItemHandler handler = OnReplacedListingItem; if (handler != null) { handler(this, new ListingItemArgs(oldItem)); } ListingItem newItem = new ListingItem(this, day, locality, start, end, lunchStart, lunchEnd, otherHours); WorkedHours += newItem.TimeSetting.WorkedHours - oldItem.TimeSetting.WorkedHours; LunchHours += newItem.TimeSetting.LunchHours - oldItem.TimeSetting.LunchHours; OtherHours += newItem.TimeSetting.OtherHours - oldItem.TimeSetting.OtherHours; TotalWorkedHours += newItem.TimeSetting.TotalWorkedHours - oldItem.TimeSetting.TotalWorkedHours; _items[day] = newItem; Localities.Add(locality); return(newItem); }
public ListingItem ReplaceItem(int day, string locality, Time start, Time end, Time lunchStart, Time lunchEnd, Time otherHours) { if (!_items.ContainsKey(day)) { return(AddItem(day, locality, start, end, lunchStart, lunchEnd, otherHours)); } ListingItem oldItem = GetItemByDay(day); ListingItem newItem = new ListingItem(this, day, locality, start, end, lunchStart, lunchEnd, otherHours); WorkedHours += newItem.TimeSetting.WorkedHours - oldItem.TimeSetting.WorkedHours; LunchHours += newItem.TimeSetting.LunchHours - oldItem.TimeSetting.LunchHours; OtherHours += newItem.TimeSetting.OtherHours - oldItem.TimeSetting.OtherHours; TotalWorkedHours += newItem.TimeSetting.TotalWorkedHours - oldItem.TimeSetting.TotalWorkedHours; _items[day] = newItem; if (!string.IsNullOrEmpty(newItem.Locality)) { Localities.Add(locality); } return(newItem); }
public Plugin() { _serviceProvider = new ServiceProvider(); _applicationPath = IOServices.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Doena Soft", "AddByDvdDiscId"); _settingsFile = IOServices.Path.Combine(_applicationPath, "AddByDvdDiscId.xml"); _errorFile = IOServices.Path.Combine(Environment.GetEnvironmentVariable("TEMP"), "AddByDvdDiscId.xml"); _pluginVersion = System.Reflection.Assembly.GetAssembly(GetType()).GetName().Version; var localities = Localities.Deserialize(); _serviceProvider.Localities = localities?.Locality; }
private void BuildLocalities() { var list = Builder <Locality> .CreateListOfSize(5).Build(); list.Add(Builder <Locality> .CreateNew().With(x => x.Suburb, "DUNCRAIG") .With(x => x.AustralianState, AustralianState.WA).With(x => x.Postcode, "6023").Build()); list.Add(Builder <Locality> .CreateNew().With(x => x.Suburb, "GYMEA") .With(x => x.AustralianState, AustralianState.NSW).With(x => x.Postcode, "2227").Build()); list.Add(Builder <Locality> .CreateNew().With(x => x.Suburb, "KARINGAL") .With(x => x.AustralianState, AustralianState.VIC).With(x => x.Postcode, "3199").Build()); list.Add(Builder <Locality> .CreateNew().With(x => x.Suburb, "Toowoomba") .With(x => x.AustralianState, AustralianState.QLD).With(x => x.Postcode, "4419").Build()); foreach (var locality in list) { Localities.Save(locality); } }
public ListingItem AddItem(int day, string locality, Time start, Time end, Time lunchStart, Time lunchEnd, Time otherHours) { if (_items.ContainsKey(day)) { throw new ListingItemAlreadyExistsException(); } ListingItem newItem = new ListingItem(this, day, locality, start, end, lunchStart, lunchEnd, otherHours); _items.Add(day, newItem); WorkedDays++; WorkedHours += newItem.TimeSetting.WorkedHours; LunchHours += newItem.TimeSetting.LunchHours; OtherHours += newItem.TimeSetting.OtherHours; TotalWorkedHours += newItem.TimeSetting.TotalWorkedHours; Localities.Add(locality); return(newItem); }
void RefreshLocalities() { if (District != null) { Localities = new ObservableCollection <Locality>( (from local in Session.DataModel.Localities where local.DistrictId == District.Id orderby local.Name select local)); } else { Localities = new ObservableCollection <Locality>(); } if (!Localities.Contains(Locality)) { Locality = null; } }
protected void LoadEntities() { Addresses.Load(); Cathedras.Load(); Citizenships.Load(); CommandPermissions.Load(); Commands.Load(); Countries.Load(); Directions.Load(); DisciplineCycles.Load(); Disciplines.Load(); Districts.Load(); EducationCompetences.Load(); EducationForms.Load(); EducationLevels.Load(); EducationPlanCompoments.Load(); EducationPlanGraphics.Load(); EducationPlanItems.Load(); EducationPlans.Load(); EducationProgramTypes.Load(); EducationStandartTypes.Load(); Faculties.Load(); FinanceSources.Load(); Genders.Load(); Groups.Load(); IdentityDocuments.Load(); IdentityOrganizations.Load(); IdentityTypes.Load(); InterfaceElements.Load(); InterfacePermissions.Load(); Localities.Load(); Persons.Load(); Regions.Load(); Roles.Load(); Streets.Load(); StudentStates.Load(); Students.Load(); Teachers.Load(); Towns.Load(); Users.Load(); }
public async Task <IActionResult> LocCreate([Bind("LocalityName", "AreaId")] Localities localities) { Users Iuser = db.Users.FirstOrDefault(u => u.Name == User.Identity.Name); if (Iuser == null || Iuser.Group < 1) { return(RedirectToAction("Login", "Account")); } else { if (ModelState.IsValid) { db.Add(localities); await db.SaveChangesAsync(); Log.Info($"[Locality:Create][User:{User.Identity.Name}]", localities.LocalityName, localities.AreaId); return(RedirectToAction(nameof(LocIndex))); } return(View(localities)); } }
public async Task <IActionResult> LocEdit(int id, [Bind("LocalityId,LocalityName,AreaId")] Localities localities) { Users Iuser = db.Users.FirstOrDefault(u => u.Name == User.Identity.Name); if (Iuser == null || Iuser.Group < 1) { return(RedirectToAction("Login", "Account")); } else { if (id != localities.LocalityId) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(localities); await db.SaveChangesAsync(); Log.Info($"[Locality:Edit][User:{User.Identity.Name}]", localities.LocalityId, localities.LocalityName, localities.AreaId); } catch (DbUpdateConcurrencyException) { if (!LocalitiesExists(localities.LocalityId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(LocIndex))); } return(View(localities)); } }
protected void fillGrid() { ArrayList mBEList = BackEndObjects.MainBusinessEntity.getMainBusinessEntityListbyNameWithAddrDetailsDB(TextBox_Search_Contact.Text, Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); if (mBEList == null || mBEList.Count == 0) { Label_Status_Search.Visible = true; Label_Status_Search.ForeColor = System.Drawing.Color.Red; Label_Status_Search.Text = "No company found for the given id"; GridView1.Visible = false; } else { DataTable dt = new DataTable(); dt.Columns.Add("Name"); dt.Columns.Add("Country"); dt.Columns.Add("State"); dt.Columns.Add("City"); dt.Columns.Add("Locality"); dt.Columns.Add("Street Name"); dt.Columns.Add("Mob"); dt.Columns.Add("Email"); dt.Columns.Add("Contact Exists?"); dt.Columns.Add("localId"); dt.Columns.Add("ContactEntId"); for (int i = 0; i < mBEList.Count; i++) { //MainBusinessEntity mBEObj = BackEndObjects.MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(TextBox_Search_Contact.Text); MainBusinessEntity mBEObj = (MainBusinessEntity)mBEList[i]; AddressDetails mBEAddr = mBEObj.getAddressDetails(); Contacts contactObj = Contacts. getContactDetailsforContactEntityDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), mBEObj.getEntityId()); Label_Status_Search.Visible = false; BackEndObjects.Localities localObj = null; BackEndObjects.City cityObj = null; BackEndObjects.State stateObj = null; BackEndObjects.Country countryObj = null; if (mBEAddr.getLocalityId() != null && !mBEAddr.getLocalityId().Equals("")) { localObj = Localities.getLocalitybyIdDB(mBEAddr.getLocalityId()); cityObj = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(mBEAddr.getLocalityId()); stateObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityObj.getCityId()); countryObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateObj.getStateId()); //Session[SessionFactory.CREATE_CONTACT_LOCALITY_ID] = localObj.getLocalityId(); //Session[SessionFactory.CREATE_CONTACT_ADDRESS_LINE1] = mBEAddr.getAddrLine1(); } dt.Rows.Add(); dt.Rows[i]["Name"] = mBEObj.getEntityName(); if (mBEAddr.getLocalityId() != null && !mBEAddr.getLocalityId().Equals("")) { dt.Rows[i]["Country"] = countryObj.getCountryName(); dt.Rows[i]["State"] = stateObj.getStateName(); dt.Rows[i]["City"] = cityObj.getCityName(); dt.Rows[i]["Locality"] = localObj.getLocalityName(); dt.Rows[i]["Street Name"] = mBEAddr.getAddrLine1(); dt.Rows[i]["localId"] = mBEAddr.getLocalityId(); dt.Rows[i]["ContactEntId"] = mBEAddr.getMainBusinessId(); } else { dt.Rows[i]["Country"] = "N/A"; dt.Rows[i]["State"] = "N/A"; dt.Rows[i]["City"] = "N/A"; dt.Rows[i]["Locality"] = "N/A"; dt.Rows[i]["Street Name"] = "N/A"; dt.Rows[i]["localId"] = ""; dt.Rows[i]["ContactEntId"] = mBEObj.getEntityId(); } dt.Rows[i]["Mob"] = mBEObj.getPhNo(); dt.Rows[i]["Email"] = mBEObj.getEmailId(); dt.Rows[i]["Contact Exists?"] = ((contactObj.getContactEntityId() != null && !contactObj.getContactEntityId().Equals("")) ? "Y" : "N"); } GridView1.DataSource = dt; GridView1.DataBind(); GridView1.Visible = true; GridView1.Columns[10].Visible = false; GridView1.Columns[11].Visible = false; Session[SessionFactory.CREATE_CONTACT_DATA_GRID] = dt; } }
public IEnumerable <Locality> GetLocalities(int RegionId) => Localities.Where(l => l.RegionId == RegionId);
public async Task SeedProfiles() { if (!Profiles.Any()) { var user = await this.Users.FirstAsync(u => u.Email == "*****@*****.**"); if (user != null) { var locality = Localities.FirstOrDefault(l => l.Name == "București, sector 2"); var profile = new Profile() { Id = user.Id, BirthDate = new DateTime(1975, 3, 14), FirstName = "Răzvan Daniel", LastName = "Ștefănescu", PhoneNo = "+40726767769", }; var address1 = new Address() { Profile = profile, Contact = "Răzvan Ștefănescu", IsDefault = true, Locality = locality, Text = "Șos. Ștefan cel Mare nr. 48, bl. 35A, sc. A, et. 2, ap. 7", Latitude = 44.4525947, Longitude = 26.1141650 }; var address2 = new Address() { Profile = profile, Contact = "Răzvan Ștefănescu", IsDefault = true, Locality = locality, Text = "Bd. Dimitrie Pompeiu nr. 6E, et. 5", Latitude = 44.4811764, Longitude = 26.1188864, }; Addresses.AddRange(address1, address2); Profiles.Add(profile); } user = await this.Users.FirstAsync(u => u.Email == "*****@*****.**"); if (user != null) { var profile = new Profile() { Id = user.Id, BirthDate = new DateTime(1990, 4, 14), FirstName = "Petru Mihail", LastName = "Marincea", PhoneNo = "++40754025905", }; var locality = Localities.FirstOrDefault(l => l.Name == "București, sector 3"); var address1 = new Address() { Profile = profile, Contact = "Mihai Marincea", IsDefault = true, Locality = locality, Text = "Str. Vlad Județul nr. 8, bl. V11", Latitude = 44.4196964, Longitude = 26.1276043, }; locality = Localities.FirstOrDefault(l => l.Name == "București, sector 2"); var address2 = new Address() { Profile = profile, Contact = "Mihai Marincea", IsDefault = true, Locality = locality, Text = "Bd. Dimitrie Pompeiu nr. 6E, et. 5", Latitude = 44.4811764, Longitude = 26.1188864, }; Addresses.AddRange(address1, address2); Profiles.Add(profile); } } }