public void DeleteLocationFailed() { int numberOfOldLocations = LocationDB.GetLocations(active).Count; LocationDB.DeleteLocation(100); Assert.AreEqual(numberOfOldLocations, LocationDB.GetLocations(active).Count); }
public void getLocationID(string locationName) { locationDB = new LocationDB(); location = new Location(); location.setName(locationName); locationDB.selectLocationIDbyName(location); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["user"] == null) { pnlBeforeLogin.Visible = true; } else { pnlAfterLogin.Visible = true; string[] fullName = MemberDB.getMemberbyEmail(Session["user"].ToString()).Name.Split(' '); lblUsername.Text = " " + fullName[0]; } ddlCategory.DataSource = CategoryDB.getAllCategory(); ddlCategory.DataBind(); ddlLocation.DataSource = LocationDB.getAllLocation(); ddlLocation.DataBind(); ddlLocation.Items.Insert(0, new ListItem("Singapore", "")); } }
public void DeleteL(Location l) { LocationDB db = new LocationDB(); db.Delete(l); db.SaveChanges(); }
protected void btnSubmit_Click(object sender, EventArgs e) { Item newItem = new Item(); newItem.CategoryName = CategoryDB.getCategorybyName("Services"); newItem.Deposit = Convert.ToDecimal(tbxRefundableDeposit.Text); newItem.Location = LocationDB.getLocationbyID(ddlMRTLocation.SelectedValue); newItem.PricePerDay = Convert.ToDecimal(tbxPricePerDay); newItem.PricePerWeek = Convert.ToDecimal(tbxPricePerWeek); newItem.PricePerMonth = Convert.ToDecimal(tbxPricePerMonth); newItem.Renter = MemberDB.getMemberbyEmail(Session["user"].ToString()); newItem.Description = tbxDescription.InnerText; newItem.PostedDate = DateTime.Now; newItem.ItemID = Utility.convertIdentitytoPK("ITM", ItemDB.addItem(newItem)); List <string> tags = Utility.findHashTags(tbxDescription.InnerText); if (tags.Count > 0) { foreach (string t in tags) { if (!TagDB.isTagPresent(t)) { TagDB.addTag(t); } ItemTagDB.addItemTag(newItem, t); } } }
public void DeleteLocationSuccess() { int id = LocationDB.GetLocations(active)[0].Id; LocationDB.DeleteLocation(id); Assert.AreEqual(LocationDB.GetLocation(id).Active, false); }
public void GetLocationSuccess() { int id = LocationDB.GetLocations(active)[0].Id; Location location = LocationDB.GetLocation(id); Assert.IsNotNull(location); }
public string getLocationName(int ID) { locationDB = new LocationDB(); location = new Location(); location.setID(ID); locationDB.selectLocationName(location); return(location.getName()); }
public int getEmployeeLocationID(string locationName) { locationDB = new LocationDB(); location = new Location(); location.setName(locationName); locationDB.selectLocationIDbyName(location); return(location.getID()); }
public int getLocationWorkHours(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectWorkHours(location); return(location.getWorkHours()); }
public string getEndDate(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectEndDate(location); return(location.getEndDate()); }
public string getLocationAddress(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectAddress(location); return(location.getAddress()); }
public double getManagerSalary(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectManagerSalary(location); return(location.getManagerSalary()); }
public LocationList Lby_Person(Person p) { LocationDB db = new LocationDB(); LocationList l = new LocationList(); l = db.Locationby_person(p); return(l); }
public int getSupervisorNumbers() { locationDB = new LocationDB(); locationDB.selectSupervisorNumbers(location); int supervisorNumbers = location.getSupervisorNumbers(); return(supervisorNumbers); }
public LocationList SelectAllL() { LocationDB db = new LocationDB(); LocationList l = new LocationList(); l = db.SelectAll(); return(l); }
public int getManagerNumbers() { locationDB = new LocationDB(); locationDB.selectManagerNumbers(location); int managerNumbers = location.getManagerNumbers(); return(managerNumbers); }
public int getSecurityNumbers() { locationDB = new LocationDB(); locationDB.selectSecurityNumbers(location); int securityNumbers = location.getSecurityNumbers(); return(securityNumbers); }
void AddAllLocations() { var setup = new GeofenceSetup(); foreach (Location location in LocationDB.GetLocations().Where(l => l.Active)) { setup.Monitor(location); } }
public void GetLocationReturnsNull() { using (var context = new Entity.p0storeContext(options)){ LocationDB _locationDB = new LocationDB(context); var location = _locationDB.GetLocation(new Model.Location("non existing store", "123 doesnt exist")); Assert.Null(location); } }
public void GetLocationFailed() { int id = 100; Location location = LocationDB.GetLocation(id); Assert.IsNull(location); //Assert.IsNull(LocationDB.GetLocation(id)); }
public int getLocationSecurityNumbers(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectSecurityNumbers(location); int securityNumbers = location.getSecurityNumbers(); return(securityNumbers); }
public int getLocationSupervisorNumbers(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectSupervisorNumbers(location); int supervisorNumbers = location.getSupervisorNumbers(); return(supervisorNumbers); }
public int getLocationManagerNumbers(string locationName) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); locationDB.selectManagerNumbers(location); int managerNumbers = location.getManagerNumbers(); return(managerNumbers); }
public void GetLocationReturnsLocation() { using (var context = new Entity.p0storeContext(options)){ LocationDB _locationDB = new LocationDB(context); var location = _locationDB.GetLocation(new Model.Location("cool store", "123 cool st Baltimore MD")); int locationID = location.LocationID; Assert.Equal(1, locationID); } }
public void GetAllLocationsShouldReturnAllLocation() { using (var context = new Entity.p0storeContext(options)){ LocationDB _locationDB = new LocationDB(context); var customers = _locationDB.GetAllLocations(); int count = customers.Count; Assert.Equal(1, count); } }
public void updateLocationCost(string locationName, double securitySalary, double supervisorSalary, double managerSalary) { location = new Location(); locationDB = new LocationDB(); location.setName(locationName); location.setSecuritySalary(securitySalary); location.setSupervisorSalary(supervisorSalary); location.setManagerSalary(managerSalary); locationDB.updateLocation(location); }
public void AddLocationWorks() { using (var context = new Entity.p0storeContext(options)){ LocationDB _locationDB = new LocationDB(context); _locationDB.AddLocation(new Model.Location("new location", "123 new location")); } using (var assertContext = new Entity.p0storeContext(options)){ var location = assertContext.Locations.FirstOrDefault(loca => loca.LocationName == "new location" && loca.LocationAddress == "123 new location"); Assert.NotNull(location); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlCategory.DataSource = CategoryDB.getAllCategory(); ddlCategory.DataBind(); ddlLocation.DataSource = LocationDB.getAllLocation(); ddlLocation.DataBind(); ddlLocation.Items.Insert(0, new ListItem("Singapore", "")); } }
public void UpdateLocationFailed() { int id = 100; Location location = new Location { Longitude = 32.43543m, Latitude = 14.32456m, Active = true }; Location updatedLocation = LocationDB.UpdateLocation(location, id); Assert.IsNull(updatedLocation); }