private void MoveAnimation() { if (m_AnimationStep >= m_RouteList.Count - 1) { GameLogic.Default.MoveOver(); return; } LocationControl locCtrl1 = m_LocationControls.First(p => p.LocationIndex == m_RouteList[m_AnimationStep]); LocationControl locCtrl2 = m_LocationControls.First(p => p.LocationIndex == m_RouteList[m_AnimationStep + 1]); m_AnimationStep++; DoubleAnimation da1 = new DoubleAnimation((double)locCtrl1.GetValue(Canvas.LeftProperty), (double)locCtrl2.GetValue(Canvas.LeftProperty), new Duration(new TimeSpan(0, 0, 0, 0, 300))); DoubleAnimation da2 = new DoubleAnimation((double)locCtrl1.GetValue(Canvas.TopProperty), (double)locCtrl2.GetValue(Canvas.TopProperty), new Duration(new TimeSpan(0, 0, 0, 0, 300))); Storyboard.SetTargetProperty(da1, new PropertyPath(Canvas.LeftProperty)); Storyboard.SetTargetProperty(da2, new PropertyPath(Canvas.TopProperty)); Storyboard sb = new Storyboard(); sb.Completed += Sb_Completed; sb.Children.Add(da1); sb.Children.Add(da2); sb.Begin(m_PlayerUIDic[GameLogic.Default.CurrentPlayer]); }
public void fillListViewForEvaluation(ListView listView, string sourceName, string dateFrom, string dateTo) { listView.Items.Clear(); locationControl = new LocationControl(); sourceControl = new SourceControl(); employee = new Employee(); employeeDB = new EmployeeDB(); connection = new DBConnection(); int sourceID = sourceControl.selectID(sourceName); employee.setSourceID(sourceID); employee.setDateFrom(dateFrom); employee.setDateTo(dateTo); SqlDataReader reader = employeeDB.fillListViewRelatedToSource(employee); while (reader.Read()) { ListViewItem lvi = new ListViewItem(reader["ID"].ToString()); lvi.SubItems.Add(reader["name"].ToString()); lvi.SubItems.Add(reader["position"].ToString()); int locationID = int.Parse(reader["locationID"].ToString()); string locationName = locationControl.getLocationName(locationID); lvi.SubItems.Add(locationName); listView.Items.Add(lvi); } connection.close(); }
private void UITestForm_Load(object sender, EventArgs e) { testWelcomeControl = new WelcomeControl(); testWelcomeControl.Dock = DockStyle.Fill; testLocationControl = new LocationControl(); testLocationControl.Dock = DockStyle.Fill; testTeamControl = new TeamControl(); testTeamControl.Dock = DockStyle.Fill; testStructureControl = new StructureControl(); testStructureControl.Dock = DockStyle.Fill; testHistoryControl = new HistoryControl(); testHistoryControl.Dock = DockStyle.Fill; testMethodologyControl = new MethodologyControl(); testMethodologyControl.Dock = DockStyle.Fill; activeControlPanel.Controls.Add(testWelcomeControl); welcomeTabButton.BackColor = Color.DarkGray; progress = 1; this.data = new Data.Unit(); }
public void TestLoationIsWithin() { var control = LocationControl.GetInstance(); Assert.IsTrue(control.IsWithin("Aalborg", "Denmark")); Assert.IsTrue(control.IsWithin("Aalborg", "Aalborg")); }
public void TestAddDeleteLocation() { var control = LocationControl.GetInstance(); control.RegisterLocation("Unit Test City", LocationType.City); control.DeleteLocation("Unit Test City"); }
// Use this for initialization void Start() { if (location == null) { location = inicialLocation; } transform.position = new Vector3(posX, posY, -2); }
void OnTriggerEnter2D(Collider2D col) { stop = true; transform.position = new Vector3(col.transform.position.x, col.transform.position.y, -2); location = col.gameObject.GetComponent <LocationControl> (); posX = col.transform.position.x; posY = col.transform.position.y; }
public double getTotal(string locationName) { locationControl = new LocationControl(); locationEquips = new LocationEquips(); locationEquipsDB = new LocationEquipsDB(); int ID = locationControl.getID(locationName); locationEquips.setLocationID(ID); locationEquipsDB.getTotal(locationEquips); return(locationEquips.getTotal()); }
public int getID(string locationName) { locationControl = new LocationControl(); locationEquips = new LocationEquips(); locationEquipsDB = new LocationEquipsDB(); int ID = locationControl.getID(locationName); locationEquips.setLocationID(ID); locationEquipsDB.selectID(locationEquips); return(locationEquips.getID()); }
public int availableManagerInLocation(string locationName) { locationControl = new LocationControl(); employee = new Employee(); employeeDB = new EmployeeDB(); int locationID = locationControl.getEmployeeLocationID(locationName); employee.setLocationID(locationID); employeeDB.countManagerInLocation(employee); return(locationControl.getManagerNumbers() - employee.getNumberOfEmployee()); }
public string getLocationName(int ID) { employee = new Employee(); employeeDB = new EmployeeDB(); locationControl = new LocationControl(); employee.setID(ID); employeeDB.selectLocationID(employee); int locationID = employee.getLocationID(); return(locationControl.getLocationName(locationID)); }
public void update(double total, string locationName) { locationControl = new LocationControl(); locationClothes = new LocationClothes(); locationClothesDB = new LocationClothesDB(); int ID = locationControl.getID(locationName); locationClothes.setLocationID(ID); locationClothes.setTotal(total); locationClothesDB.updateTotal(locationClothes); }
public double getTotal(string locationName) { locationControl = new LocationControl(); locationClothes = new LocationClothes(); locationClothesDB = new LocationClothesDB(); int ID = locationControl.getID(locationName); locationClothes.setLocationID(ID); locationClothesDB.selectTotal(locationClothes); return(locationClothes.getTotal()); }
public void insert(int month, int year, string locationName) { locationControl = new LocationControl(); attendance = new Attendance(); attendanceDB = new AttendanceDB(); int locationID = locationControl.getID(locationName); attendance.setMonth(month); attendance.setYear(year); attendance.setLocationID(locationID); attendanceDB.insert(attendance); }
public void insert(double total, string locationName) { locationControl = new LocationControl(); locationEquips = new LocationEquips(); locationEquipsDB = new LocationEquipsDB(); locationControl.getLocationID(locationName); int ID = locationControl.getID(locationName); locationEquips.setLocationID(ID); locationEquips.setTotal(total); locationEquipsDB.insert(locationEquips); }
public bool checkIfLocationHasEquips(string locationName) { locationControl = new LocationControl(); locationEquips = new LocationEquips(); locationEquipsDB = new LocationEquipsDB(); int ID = locationControl.getID(locationName); locationEquips.setLocationID(ID); bool check = locationEquipsDB.checkIfLocationHasDevices(locationEquips); return(check); }
public bool checkIfLocationHasClothes(string locationName) { locationControl = new LocationControl(); locationClothes = new LocationClothes(); locationClothesDB = new LocationClothesDB(); int ID = locationControl.getID(locationName); locationClothes.setLocationID(ID); bool check = locationClothesDB.checkIfLocationHasClothes(locationClothes); return(check); }
public void TestNestedLocations() { var control = LocationControl.GetInstance(); control.RegisterLocation("Unit Test Country", LocationType.Country); control.RegisterLocation("Unit Test City 1", LocationType.City, "Unit Test Country"); control.RegisterLocation("Unit Test City 2", LocationType.City, "Unit Test Country"); control.DeleteLocation("Unit Test City 1"); control.DeleteLocation("Unit Test City 2"); control.DeleteLocation("Unit Test Country"); }
public int getID(int month, int year, string locationName) { locationControl = new LocationControl(); attendance = new Attendance(); attendanceDB = new AttendanceDB(); int locationID = locationControl.getID(locationName); attendance.setMonth(month); attendance.setYear(year); attendance.setLocationID(locationID); attendanceDB.selectID(attendance); return(attendance.getID()); }
public bool checkIfLocationAttendanceSubmitted(int month, int year, string locationName) { locationControl = new LocationControl(); attendance = new Attendance(); attendanceDB = new AttendanceDB(); int locationID = locationControl.getID(locationName); attendance.setMonth(month); attendance.setYear(year); attendance.setLocationID(locationID); bool flag = attendanceDB.checkIfLocationAttendanceSubmitted(attendance); return(flag); }
public void fillDataGridViewLocationAttendance(DataGridView dataGridView, string locationName, int month, int year) { locationControl = new LocationControl(); attendance = new Attendance(); attendanceDB = new AttendanceDB(); int locationID = locationControl.getID(locationName); attendance.setLocationID(locationID); attendance.setMonth(month); attendance.setYear(year); SqlDataAdapter adapter = attendanceDB.fillDataGridViewLocationAttendance(attendance); DataTable dataTable = new DataTable(); adapter.Fill(dataTable); dataGridView.DataSource = dataTable; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string ids = Request.QueryString["id"] + ""; int id = 0; if (string.IsNullOrEmpty(ids) || !int.TryParse(ids, out id) || id <= 0) { Response.Redirect("/Default.aspx"); } articles = bllArticles.GetModel(id); if (articles == null) { Response.Redirect("/Default.aspx"); } bllArticles.UpdateClick(id); currentCategory = bllCategory.GetModel(articles.parentId); if (currentCategory != null) { LeftNavControl.navParentID = currentCategory.parentID; LeftNavControl.navCode = currentCategory.codeNo; LocationControl.currentCategory = currentCategory; parentCategory = bllCategory.GetModel(currentCategory.parentID); if (parentCategory != null) { LocationControl.parentCategory = parentCategory; LeftNavControl.navTitle = parentCategory.title; Page.Title = articles.title + "-" + currentCategory.title + "-" + parentCategory.title; activeNav = LocationControl.GetNavName(); } else { LeftNavControl.navTitle = currentCategory.title; Page.Title = articles.title + "-" + currentCategory.title; } } else { Response.Redirect("~/"); } } }
public void insertEmployee(string nationalID, string employeeName, string date, string position, double salary, string locationName, string sourceName) { employee = new Employee(); employeeDB = new EmployeeDB(); locationControl = new LocationControl(); sourceControl = new SourceControl(); employee.setNationalID(nationalID); employee.setName(employeeName); employee.setEmployDate(date); employee.setPosition(position); employee.setSalary(salary); int locationID = locationControl.getEmployeeLocationID(locationName); int sourceID = sourceControl.selectID(sourceName); employee.setLocationID(locationID); employee.setSourceID(sourceID); employeeDB.insertEmployee(employee); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string code = Request.QueryString["code"] + ""; if (string.IsNullOrEmpty(code)) { code = "zxjj"; } if (code.Equals("zxly")) { Response.Redirect("Message.aspx"); } currentCategory = bllCategory.GetModel(code); if (currentCategory != null) { LocationControl.currentCategory = currentCategory; LeftNavControl.navParentID = currentCategory.parentID; LeftNavControl.navCode = code; parentCategory = bllCategory.GetModel(currentCategory.parentID); if (parentCategory != null) { //set nav LocationControl.parentCategory = parentCategory; activeNav = LocationControl.GetNavName(); LeftNavControl.navTitle = parentCategory.title; Page.Title = currentCategory.title + "-" + parentCategory.title; } else { LeftNavControl.navTitle = currentCategory.title; Page.Title = currentCategory.title; } } else { Response.Redirect("~/"); } } }
private void InitPlayerLocaton() { m_PlayerUIDic = new Dictionary <Player, Label>(); foreach (var player in GameLogic.Default.Players) { Label label = new Label(); label.Padding = new Thickness(3); label.FontSize = 24; label.Content = player.Role.Name; label.Background = player.Role.Color; Location loc = GameLogic.Default.Map.LocationCollection.First(p => p.Index == player.Location.Index); LocationControl locCtrl = m_LocationControls.First(p => p.Location == player.Location); label.SetValue(Canvas.LeftProperty, locCtrl.GetValue(Canvas.LeftProperty)); label.SetValue(Canvas.TopProperty, locCtrl.GetValue(Canvas.TopProperty)); m_MapCanvas.Children.Add(label); m_PlayerUIDic.Add(player, label); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string code = Request.QueryString["code"] + ""; if (string.IsNullOrEmpty(code)) { code = "zxjj"; } currentCategory = bllCategory.GetModel(code); if (currentCategory != null) { LeftNavControl.navParentID = currentCategory.parentID; LeftNavControl.navCode = code; LocationControl.currentCategory = currentCategory; parentCategory = bllCategory.GetModel(currentCategory.parentID); if (parentCategory != null) { //set nav LocationControl.parentCategory = parentCategory; activeNav = LocationControl.GetNavName(); LeftNavControl.navTitle = parentCategory.title; Page.Title = currentCategory.title + "-" + parentCategory.title; } else { LeftNavControl.navTitle = currentCategory.title; Page.Title = currentCategory.title; } rptSubCategory.DataSource = bllCategory.GetNextNodeByCode(currentCategory.codeNo); rptSubCategory.DataBind(); } else { Response.Redirect("~/"); } } }
private void InitData() { string code = Request.QueryString["code"] + ""; if (string.IsNullOrEmpty(code)) { code = "zxly"; } currentCategory = bllCategory.GetModel(code); if (currentCategory != null) { LocationControl.currentCategory = currentCategory; LeftNavControl.navParentID = currentCategory.parentID; LeftNavControl.navCode = code; parentCategory = bllCategory.GetModel(currentCategory.parentID); if (parentCategory != null) { //set nav LocationControl.parentCategory = parentCategory; activeNav = LocationControl.GetNavName(); LeftNavControl.navTitle = parentCategory.title; Page.Title = currentCategory.title + "-" + parentCategory.title; } else { LeftNavControl.navTitle = currentCategory.title; Page.Title = currentCategory.title; } } else { Response.Redirect("~/"); } }
public TestMapWindow() { InitializeComponent(); //主路数据 int mainLocCount = 60; Collection <Location> collectionMain = new Collection <Location>(); for (int i = 0; i < mainLocCount; i++) { collectionMain.Add(new Location() { Index = i }); } for (int i = 0; i < mainLocCount; i++) { int forwardIndex = i + 1 > mainLocCount - 1 ? 0 : i + 1; int backwardIndex = i - 1 < 0 ? mainLocCount - 1 : i - 1; Location forward = collectionMain.First(p => p.Index == forwardIndex); Location backward = collectionMain.First(p => p.Index == backwardIndex); collectionMain.First(p => p.Index == i).RoadInfos.Add(new RoadInfo() { RoadIndex = 0, ForwardLocation = forward, BackwardLocation = backward }); } LocationCollection = collectionMain; //主路图形绑定 for (int i = 0; i < mainLocCount; i++) { LocationControl locCtrl = new LocationControl(); Binding binding = new Binding("Index"); binding.Source = LocationCollection[i]; locCtrl.SetBinding(LocationControl.LocationIndexProperty, binding); if (i < 20) { locCtrl.SetValue(Canvas.LeftProperty, 200.0 + i * 100.0); locCtrl.SetValue(Canvas.TopProperty, 200.0); } else if (i < 30) { locCtrl.SetValue(Canvas.LeftProperty, 2100.0); locCtrl.SetValue(Canvas.TopProperty, 300.0 + (i - 20) * 100.0); } else if (i < 50) { locCtrl.SetValue(Canvas.LeftProperty, 2100.0 - (i - 30) * 100.0); locCtrl.SetValue(Canvas.TopProperty, 1300.0); } else { locCtrl.SetValue(Canvas.LeftProperty, 200.0); locCtrl.SetValue(Canvas.TopProperty, 1200.0 - (i - 50) * 100.0); } canvas.Children.Add(locCtrl); } //支路数据 int subLocCount = 10; Collection <Location> collectionSub = new Collection <Location>(); for (int i = mainLocCount; i < mainLocCount + subLocCount; i++) { collectionSub.Add(new Location() { Index = i }); } foreach (var item in collectionSub) { LocationCollection.Add(item); } for (int i = mainLocCount; i < mainLocCount + subLocCount; i++) { int forwardIndex = i + 1 > mainLocCount + subLocCount - 1 ? 39 : i + 1; //三岔口39 int backwardIndex = i - 1 < mainLocCount ? 10 : i - 1; //三岔口10 Location forward = LocationCollection.First(p => p.Index == forwardIndex); Location backward = LocationCollection.First(p => p.Index == backwardIndex); collectionSub.First(p => p.Index == i).RoadInfos.Add(new RoadInfo() { RoadIndex = 1,//支线 ForwardLocation = forward, BackwardLocation = backward }); } //三岔路特殊处理 LocationCollection[10].RoadInfos.Add(new RoadInfo() { RoadIndex = 1,//支线 ForwardLocation = collectionSub[0], BackwardLocation = null }); LocationCollection[39].RoadInfos.Add(new RoadInfo() { RoadIndex = 1,//支线 ForwardLocation = null, BackwardLocation = collectionSub[subLocCount - 1] }); //支路图形绑定 for (int i = 0; i < subLocCount; i++) { LocationControl locCtrl = new LocationControl(); Binding binding = new Binding("Index"); binding.Source = collectionSub[i]; locCtrl.SetBinding(LocationControl.LocationIndexProperty, binding); locCtrl.SetValue(Canvas.LeftProperty, 1200.0); locCtrl.SetValue(Canvas.TopProperty, 300.0 + i * 100.0); canvas.Children.Add(locCtrl); } }
private void AddContact_Click(object sender, EventArgs e) { // object added to contact BusinessContact businessContact = new BusinessContact(); if (App._reverseGeocode.Address.StreetNumber != null) { businessContact.WorkAddressStreet = App._reverseGeocode.Address.StreetNumber; } if (App._reverseGeocode.Address.StreetName != null) { businessContact.WorkAddressStreet += " " + App._reverseGeocode.Address.StreetName; } if (App._reverseGeocode.Address.City != null) { businessContact.WorkAddressCity = App._reverseGeocode.Address.City; } if (App._reverseGeocode.Address.State != null) { businessContact.WorkAddressState = App._reverseGeocode.Address.State; } if (App._reverseGeocode.Address.Zip != null) { businessContact.WorkAddressZipCode = App._reverseGeocode.Address.Zip; } foreach (UIElement ui in LocationControlStackPanel.Children) { if (ui.GetType() == typeof(LocationControl)) { LocationControl cityGridInfo = ui as LocationControl; try { if (cityGridInfo.CityGridLocation.name != null) { businessContact.Company = cityGridInfo.CityGridLocation.name; } if (cityGridInfo.CityGridLocation.address.address != null) { businessContact.WorkAddressStreet = cityGridInfo.CityGridLocation.address.address; } if (cityGridInfo.CityGridLocation.address.city != null) { businessContact.WorkAddressCity = cityGridInfo.CityGridLocation.address.city; } if (cityGridInfo.CityGridLocation.address.state != null) { businessContact.WorkAddressState = cityGridInfo.CityGridLocation.address.state; } if (cityGridInfo.CityGridLocation.address.postal_code != null) { businessContact.WorkAddressZipCode = cityGridInfo.CityGridLocation.address.postal_code; } businessContact.WorkAddressCountry = "country"; if (cityGridInfo.CityGridLocation.phone_number != null) { businessContact.WorkPhone = cityGridInfo.CityGridLocation.phone_number; } if (cityGridInfo.CityGridLocation.website != null) { businessContact.Website = cityGridInfo.CityGridLocation.website; } businessContact.WorkEmail = "workEmail"; if (cityGridInfo.CityGridLocation.sample_categories != null) { businessContact.Notes = cityGridInfo.CityGridLocation.sample_categories; } } catch (Exception x) { Debug.WriteLine("AddContact_Click ERROR: " + x.ToString()); MessageBox.Show("Error adding contact"); } } } AddContact addContact = new AddContact(businessContact); }
protected override bool Satisfies(Sim actor, Sim target, ToiletStall obj, bool isAutonomous, ref GreyedOutTooltipCallback callback) { return(LocationControl.TestAccessible(obj, actor) && LocationControl.TestAccessible(obj, target)); }
/// <summary> /// Initialise the controls. /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { base.OnInit(e); TableHeaderRow rowHeader = new TableHeaderRow(); rowHeader.Cells.Add(NewCell(_panelName)); rowHeader.Cells.Add(NewCell(_panelUrl)); rowHeader.Cells.Add(NewCell(_panelMatchExpression)); TableCell cellFiltersLabel = new TableCell(); cellFiltersLabel.ColumnSpan = 2; cellFiltersLabel.Controls.Add(_panelFilters); cellFiltersLabel.Controls.Add(_customValidatorUniqueName); rowHeader.Cells.Add(cellFiltersLabel); Rows.Add(rowHeader); _customValidatorUniqueName.ControlToValidate = ID; _customValidatorUniqueName.Display = ValidatorDisplay.None; _customValidatorUniqueName.ValidationGroup = VALIDATION_GROUP; foreach (LocationData item in _data) { // Add the location row. LocationControl locationRow = new LocationControl( item, _parent, WebProvider.ActiveProvider.DataSet.Properties); // Add the filters associated with the location to the next row. Rows.Add(locationRow); TableRow rowFilters = new TableRow(); TableCell cellFilters = new TableCell(); rowFilters.Cells.Add(cellFilters); cellFilters.ColumnSpan = 6; Rows.Add(rowFilters); cellFilters.Controls.Add(locationRow.TableFilters); } _customValidatorUniqueName.ServerValidate += new ServerValidateEventHandler(_customValidatorUniqueName_ServerValidate); }