public void Ajouter() { windows.Produit window = new windows.Produit(null, user); window.ShowDialog(); if (window.DialogResult.HasValue && window.DialogResult == true) { //Sauvegarde PRODUIT ProToAdd = (PRODUIT)window.DataContext; ProToAdd.Image = window.lien(); ((App)App.Current).entity.PRODUIT.Add(ProToAdd); ((App)App.Current).entity.SaveChanges(); windows.Zones windows = new windows.Zones(); windows.ShowDialog(); if (windows.DialogResult.HasValue && windows.DialogResult == true) { ZONE ZoneToAdd = (ZONE)windows.DataContext; ZoneToAdd.PRO_Id = ProToAdd.Id; ZoneToAdd.PAG_Id = pgId; ((App)App.Current).entity.ZONE.Add(ZoneToAdd); ((App)App.Current).entity.SaveChanges(); } } else { //On rafraichit l'entity pour éviter les erreurs de données "fantomes" mal déliées ((App)App.Current).entity = new LISA_DIGITALEntities(); } DataContext = null; RefreshDatas(); }
protected void btnSave_Click(object sender, EventArgs e) { var obj = new ZONE(); obj.ZONE_CODE = popTxtZoneCode.Text; obj.ZONE_NAME = popTxtZoneName.Text; var cmd = new ZoneService(obj); if (flag.Text.Equals("Add")) { obj.Action = ActionEnum.Create; obj.CREATE_DATE = DateTime.Now; obj.CREATE_EMPLOYEE_ID = 0; obj.UPDATE_DATE = DateTime.Now; obj.UPDATE_EMPLOYEE_ID = 0; obj.SYE_DEL = true; cmd.Add(); } else { obj.Action = ActionEnum.Update; obj.ZONE_ID = Convert.ToInt32(ViewState["zoneID"].ToString()); obj.UPDATE_DATE = DateTime.Now; obj.UPDATE_EMPLOYEE_ID = 0; obj.SYE_DEL = true; cmd.Edit(); } flag.Text = "Add"; ViewState["zoneID"] = null; Response.Redirect("SearchZone.aspx"); }
private void btnOK_Click(object sender, EventArgs e) { if (option == "Add") { ZONE rm = new ZONE(); rm.zoneName = txtTenkhu.Text; rm.zoneId = txtMakhu.Text; if (BUS_ZoneData.Instance.BUS_CHECKZONE(rm) == 0) { MessageBox.Show("ID khu đã bị trùng! Vui lòng thay đổi"); } else { BUS_ZoneData.Instance.BUS_SETZONE(rm); MessageBox.Show("Thêm thành công!"); } } else { txtMakhu.Text = zoneid; ZONE rm2 = new ZONE(); rm2.zoneId = txtMakhu.Text; rm2.zoneName = txtTenkhu.Text; BUS_ZoneData.Instance.BUS_UPDATEZONE(rm2); MessageBox.Show("Cập nhập thành công!"); } refresh(); this.Dispose(); }
public List <ZONE> GetALL(ZONE item) { using (var ctx = new SPWEntities()) { var list = ctx.ZONE.Where(x => x.ZONE_CODE.Contains(item.ZONE_CODE)).ToList(); return(list); } }
/// <summary> /// Setup function, initializes variables for the city creation /// </summary> void Setup() { // Starting position position = Vector3.zero; // Starting zone zone = ZONE.inner_zone; //Initialize map map = new Dictionary <Vector3, Building>(); }
public ZONE ZoneToEntity(Zone item) { ZONE newZone = new ZONE() { IdZone = item.IdZone, NameZone = item.NameZone, DescriptionZone = item.DescriptionZone, ColorZone = item.ColorZone }; return(newZone); }
public Zone ZoneToObject(ZONE item) { Zone newTypeVehicle = new Zone() { IdZone = item.IdZone, NameZone = item.NameZone, DescriptionZone = item.DescriptionZone, ColorZone = item.ColorZone }; return(newTypeVehicle); }
private void setZONE() { if (option == "Edit") { ZONE s = new ZONE(); s = BUS_ZoneData.Instance.BUS_getZoneByIDZone(zoneid); txtMakhu.Text = s.zoneId; txtTenkhu.Text = s.zoneName; txtMakhu.Enabled = false; this.Text = "Chỉnh sửa khu vực"; } }
public Zones(ZONE ZoneAmodifier = null) { InitializeComponent(); if (ZoneAmodifier == null) { this.DataContext = new ZONE(); } else { this.DataContext = ZoneAmodifier; } }
private void creer_Click(object sender, RoutedEventArgs e) { ZONE CE = new ZONE() { CooX = Int32.Parse(COOX.Text.ToString()), CooY = Int32.Parse(COOY.Text.ToString()), Height = Int32.Parse(heightZone.Text.ToString()), Width = Int32.Parse(WidhtZone.Text.ToString()), PRO_Id = Int32.Parse(prod.Text.ToString()), PAG_Id = Int32.Parse(page.Text.ToString()) }; db.ZONE.Add(CE); db.SaveChanges(); this.Close(); }
public int CheckTransportLevel(ZONE _type) { switch (_type) { case ZONE.CENTER: if (m_CentralTiles.Count < 1) { return(0); } return(m_CentralTiles[0].m_PublicTransportLevel); case ZONE.WEST: if (m_WestTiles.Count < 1) { return(0); } return(m_WestTiles[0].m_PublicTransportLevel); case ZONE.EAST: if (m_EastTiles.Count < 1) { return(0); } return(m_EastTiles[0].m_PublicTransportLevel); case ZONE.NORTH: if (m_NorthTiles.Count < 1) { return(0); } return(m_NorthTiles[0].m_PublicTransportLevel); case ZONE.SOUTH: if (m_SouthTiles.Count < 1) { return(0); } return(m_SouthTiles[0].m_PublicTransportLevel); default: if (m_CentralTiles.Count < 1) { return(0); } return(m_CentralTiles[0].m_PublicTransportLevel); } }
/// <summary> /// Instantiate a new random building from the provided list /// </summary> /// <param name="position">The position for the new building</param> /// <param name="buildings">The list with available building in this zone</param> /// <param name="randomRotation">Boolean flag on whether to give a random rotation</param> public void AddBuilding(int index, Vector3Int position) { if (InZoneLimits(position.x, position.z, inner_zone_dimensions)) { zone = ZONE.inner_zone; } else if (InZoneLimits(position.x, position.z, middle_zone_dimensions)) { zone = ZONE.middle_zone; } else { zone = ZONE.outer_zone; } Transform parent; switch (zone) { case ZONE.inner_zone: parent = inner_zone_parent.transform; break; case ZONE.middle_zone: parent = middle_zone_parent.transform; break; case ZONE.outer_zone: parent = outer_zone_parent.transform; break; default: parent = transform; break; } created_building = Instantiate( building_prefabs[index], position, quaternion, parent); created_script = created_building.AddComponent <Building>(); created_script.SetBuildingType(index); map.Add(position, created_script); }
public override void CollectObservations() { // Add current zone observation currentZone = city.GetZone(); AddVectorObs((int)currentZone); // Add neighbor observations neighbors = city.GetNeighbors(position); foreach (int neighbor in neighbors) { AddVectorObs(neighbor); } // Add diagonal neighbor observations diagonal_neighbors = city.GetDiagonals(position); foreach (int neighbor in diagonal_neighbors) { AddVectorObs(neighbor); } }
// Use this for initialization void Start() { m_AllTiles = FindObjectsOfType <TileController>(); m_NorthTiles = new List <TileController>(); m_CentralTiles = new List <TileController>(); m_WestTiles = new List <TileController>(); m_EastTiles = new List <TileController>(); m_SouthTiles = new List <TileController>(); for (int i = 0; i < m_AllTiles.Length; i++) { m_AllTiles[i].EffectsObject = EffectsContainer; m_AllTiles[i].PlusParticleObject = PlusParticle; m_AllTiles[i].SmokeParticle = SmokeParticle; ZONE zone = m_AllTiles[i].m_Zone; //MeshRenderer[] renderers = transform.parent.GetComponentsInChildren<MeshRenderer>(); if (zone == ZONE.NORTH) { m_NorthTiles.Add(m_AllTiles[i]); } else if (zone == ZONE.CENTER) { m_CentralTiles.Add(m_AllTiles[i]); } else if (zone == ZONE.EAST) { m_EastTiles.Add(m_AllTiles[i]); } else if (zone == ZONE.WEST) { m_WestTiles.Add(m_AllTiles[i]); } else { m_SouthTiles.Add(m_AllTiles[i]); } } }
private void InitialDataPopup() { var cmdEmp = new EmployeeService(); foreach (var item in cmdEmp.GetALLInclude()) { ddlSell.Items.Add(new ListItem(("แผนก " + item.DEPARTMENT.DEPARTMENT_NAME + " ชื่อ " + item.EMPLOYEE_NAME + " " + item.EMPLOYEE_SURNAME), item.EMPLOYEE_ID.ToString())); } if (ViewState["zoneID"] != null) { var cmd = new ZoneService(); _zone = cmd.Select(Convert.ToInt32(ViewState["zoneID"].ToString())); if (_zone != null) { popTxtZoneCode.Text = _zone.ZONE_CODE; popTxtZoneName.Text = _zone.ZONE_NAME; flag.Text = "Edit"; } } }
public List <TileController> GetTiles(ZONE _type) { switch (_type) { case ZONE.CENTER: return(m_CentralTiles); case ZONE.WEST: return(m_WestTiles); case ZONE.EAST: return(m_EastTiles); case ZONE.NORTH: return(m_NorthTiles); case ZONE.SOUTH: return(m_SouthTiles); default: return(m_CentralTiles); } }
public void SendRubbishTruck(ZONE _type) { List <TileController> tiles; switch (_type) { case ZONE.CENTER: tiles = m_CentralTiles; break; case ZONE.WEST: tiles = m_WestTiles; break; case ZONE.EAST: tiles = m_EastTiles; break; case ZONE.NORTH: tiles = m_NorthTiles; break; case ZONE.SOUTH: tiles = m_SouthTiles; break; default: tiles = m_CentralTiles; break; } foreach (TileController tile in tiles) { tile.m_bRubbishTruckSent = true; } }
public void StartPublicTransport(ZONE _type) { List <TileController> tiles; switch (_type) { case ZONE.CENTER: tiles = m_CentralTiles; break; case ZONE.WEST: tiles = m_WestTiles; break; case ZONE.EAST: tiles = m_EastTiles; break; case ZONE.NORTH: tiles = m_NorthTiles; break; case ZONE.SOUTH: tiles = m_SouthTiles; break; default: tiles = m_CentralTiles; break; } foreach (TileController tile in tiles) { tile.m_PublicTransportLevel++; } }
public ZoneService(ZONE item) { _item = item; }
public int BUS_CHECKZONE(ZONE zn) { return(DAL_ZoneData.Instance.DAL_CheckZone(zn)); }
public void BUS_UPDATEZONE(ZONE zn2) { DAL_ZoneData.Instance.DAL_UpdateZone(zn2); }
public void BUS_SETZONE(ZONE zn) { DAL_ZoneData.Instance.DAL_SetZone(zn); }