public IActionResult Index(MasterType type) { return(View(new IndexModel { Type = type })); }
public ShrineMaster(MasterTitle specialty, MasterType type, ShrineBattleController controller) : base(GetAI(specialty), FightMode.Closest, 10, 1, .2, .1) { _Specialty = specialty; _Type = type; _Controller = controller; if (Female = Utility.RandomBool()) { Name = NameList.RandomName("female"); } else { Name = NameList.RandomName("male"); } SetBody(); Title = "the " + specialty; SetStr(250); SetDex(SpellCaster ? 150 : 200); SetInt(SpellCaster ? 1000 : 5000); SetHits(20000, 25000); if (AI == AIType.AI_Melee) { SetDamage(22, 30); } else if (!SpellCaster) { SetDamage(20, 28); } else { SetDamage(10, 20); } Fame = 48000; Karma = -48000; SetResists(); SetSkills(); EquipSpecialty(); _NextSpecial = DateTime.UtcNow; if (specialty == MasterTitle.Sampire) { Timer.DelayCall(TimeSpan.FromSeconds(1), () => { VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null); spell.Cast(); }); } }
/// <summary> /// Creates a new instance of the <see cref="GameStat.Collections.ServerCollection"/> class and queries a master server. /// </summary> /// <param name="type">One of the <see cref="GameStat.MasterType"/> values.</param> /// <param name="filter">One or more of the <see cref="GameStat.MasterFilter"/> values.</param> /// <param name="host">The hostname/ip to query.</param> /// <param name="port">The master server's query port.</param> /// <returns>A new <see cref="GameStat.Collections.ServerCollection"/> class initialized with server information, or <c>null</c> if the master server didn't return any.</returns> /// <exception cref="System.Net.Sockets.SocketException">An error occurred when attempting to access the master server.</exception> /// <exception cref="System.ArgumentOutOfRangeException">The given <paramref name="type"/> is not recognized by GameStat.</exception> /// <exception cref="System.ArgumentException">An invalid argument was given.</exception> /// <exception cref="System.NotImplementedException">Support for the given <paramref name="type"/> is not implemented yet.</exception> /// <exception cref="GameStat.CorruptPacketException">A currupt or unknown packet was recieved from the master server.</exception> /// <remarks> /// If <paramref name="host"/> is set to null, GameStat will try to guess it. If <paramref name="host"/> can not be guessed, an <see cref="System.ArgumentException"/> will be thrown. /// If <paramref name="port"/> is set to 0, GameStat will try to guess it. If <paramref name="port"/> can not be guessed, an <see cref="System.ArgumentException"/> will be thrown. /// </remarks> /// <example> /// This example queries the Counter-Strike master server and writes the resulting information to the console. /// <code lang="C#"> /// /// try { /// ServerCollection servers=ServerInfo.QueryMaster(MasterType.Counter-Strike, /// MasterFilter.NotFull|MasterFilter.NotEmpty|MasterFilter.NoPassword, null, 0); /// /// if(servers!=null) { /// foreach(Server s in servers) /// Console.WriteLine(s.Host+":"+s.Port.ToString()); /// } /// else Console.WriteLine("Master server didn't return any servers."); /// } /// catch(Exception ex) { /// Console.Error.WriteLine("An Exception Occured!"); /// Console.Error.WriteLine(ex.ToString()); /// } /// </code> /// </example> public static Collections.ServerCollection QueryMaster(MasterType type, MasterFilter filter, string host, ushort port) { IntPtr serversptr = GSQueryMaster((ushort)type, host, port, (ushort)filter); if (serversptr == IntPtr.Zero) { GSErrorCode err = GSLastError(); switch (err) { case GSErrorCode.Ok: return(null); case GSErrorCode.Winsock: case GSErrorCode.UnknownHost: case GSErrorCode.Connect: case GSErrorCode.Timeout: throw new System.Net.Sockets.SocketException(); case GSErrorCode.UnknownType: throw new ArgumentOutOfRangeException("type"); case GSErrorCode.Corrupt: throw new CorruptPacketException(); case GSErrorCode.UnknownPort: throw new ArgumentException(GSErrorString(err), "port"); case GSErrorCode.NotImplemented: throw new NotImplementedException(GSErrorString(err)); case GSErrorCode.InvalidParameter: throw new ArgumentException(GSErrorString(err)); } } Collections.ServerCollection sc = new Collections.ServerCollection(); for (IntPtr cur = serversptr; cur != IntPtr.Zero;) { GS_SERVER server = (GS_SERVER)Marshal.PtrToStructure(cur, typeof(GS_SERVER)); if (server.host != IntPtr.Zero) { Server s = new Server(); s.Host = Marshal.PtrToStringAnsi(server.host); s.Port = server.port; sc.Add(s); } cur = server.next; } GSFreeServers(serversptr); return(sc); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); reader.ReadInt(); _Specialty = (MasterTitle)reader.ReadInt(); _Type = (MasterType)reader.ReadInt(); _NextSpecial = DateTime.UtcNow; }
public Task <bool> DeleteMaster(Guid id, MasterType type) { if (type == Model.MasterType.EscalationCategory || type == Model.MasterType.ReinstateReason) { return(_apiClient.RequestMasterSdk.DeleteMaster(id)); } else { return(_apiClient.JobOrderMasterSdk.DeleteMaster(id)); } }
//TO CONTINUE public CharacterObjectType(ObjectTypeEnum objectType, uint objectId, uint id, uint linkId, float x, float y, float z, float angle, float angleX, short scale, string name, int count_data, ushort[] rIndexes_data, int[] values_data, byte count_buff, byte[] buffsns, int[] buffIds, int[] ticks, uint characterId, byte sex, int job, int authority, int serverId, string vipbar_name, short constellation, short city, byte hair_mesh, uint hair_color, byte head_mesh, uint option, uint teamId, string vendor_sentence, int slaughter, int kill_num, int fame, byte pk_mode, byte pk_name, int gray_time, int prot_cool_down_start, int issf_, int items_count, ItemType[] items, byte ext_param_count, byte[] index, int[] value, int title_count, int[] titles, int title_flag, byte title_count2, int[] titles2, int[] host_ids, KingdomType kingdom, MasterType master, MarriageType marriage, int show_count, int[] indexes_show, int vessel_refine_lv, int vessel_equip_index, bool vessel_is_equip, bool flag_data, FlagsDataType flagsData) : base(objectType, objectId, id, linkId, x, y, z, angle, angleX, scale, name, count_data, rIndexes_data, values_data, count_buff, buffsns, buffIds, ticks) { this.characterId = characterId; this.sex = sex; this.job = job; this.authority = authority; this.serverId = serverId; this.vipbar_name = vipbar_name; this.constellation = constellation; this.city = city; this.hair_mesh = hair_mesh; this.hair_color = hair_color; this.head_mesh = head_mesh; this.option = option; this.teamId = teamId; this.vendor_sentence = vendor_sentence; this.slaughter = slaughter; this.kill_num = kill_num; this.fame = fame; this.pk_mode = pk_mode; this.pk_name = pk_name; this.gray_time = gray_time; this.prot_cool_down_start = prot_cool_down_start; this.issf_ = issf_; this.items_count = items_count; this.items = items; this.ext_param_count = ext_param_count; this.index = index; this.value = value; this.title_count = title_count; this.titles = titles; this.title_flag = title_flag; this.title_count = title_count; this.titles2 = titles2; this.kingdom = kingdom; this.master = master; this.marriage = marriage; this.show_count = show_count; this.indexes_show = indexes_show; this.vessel_refine_lv = vessel_refine_lv; this.vessel_equip_index = vessel_equip_index; this.vessel_is_equip = vessel_is_equip; this.flag_data = flag_data; this.flagsData = flagsData; }
//----- method ----- public void Initialize(IMaster master) { if (initialized) { return; } changedRecords = new Dictionary <object, object>(); MasterType = master.GetType(); // レコード一覧取得. var methodInfo = MasterType.GetMethods().FirstOrDefault(x => x.Name == "GetAllRecords"); var allRecords = (IEnumerable)methodInfo.Invoke(master, null); Records = allRecords.Cast <object>().ToArray(); // レコードのプロパティ情報取得. propertyInfos = new Dictionary <string, PropertyInfo>(); var recordType = Reflection.GetElementTypeOfGenericEnumerable(allRecords); var properties = recordType.GetProperties(); foreach (var property in properties) { // setter, getter両方が実装されてない場合は対象外. if (!property.CanRead || !property.CanWrite) { continue; } // IgnoreMemberがついている場合は対象外. if (property.CustomAttributes.Any(x => x.AttributeType == typeof(IgnoreMemberAttribute))) { continue; } propertyInfos.Add(property.Name, property); } initialized = true; }
public MasterCollaborator() { Size = new SizeCollectionViewSource(); Size.SourceChanged += Size_SourceChanged; Quality = new QualityCollectionViewSource(); Quality.SourceChanged += Quality_SourceChanged; Material = new MaterialCollectionViewSource(); material.SourceChanged += material_SourceChanged; Finishing = new FinishingCollectionViewSource(); Finishing.SourceChanged += Finishing_SourceChanged; Stock = new StockCollectionViewSource(); Stock.SourceChanged += Stock_SourceChanged; Supplier = new SupplierCollectionViewSource(); supplier.SourceChanged += Supplier_SourceChanged; masterTypeSync = MasterType.All; Pull(); }
public async Task <IEnumerable <Master> > GetMasterList(MasterType type) { var param = new DynamicParameters(); param.Add("@Type", type); return(await SqlMapper.QueryAsync(_unitOfWork.Connection, "GetMaster", new[] { typeof(Master) }, obj => { return obj[0] as Master; }, param, commandType: System.Data.CommandType.StoredProcedure)); }
private void AddToDataToBindingSource(MasterType masterType, BindingSource source, ListBox listBox) { var universalMasterCreateForm = GlobalUtility.GetFormObject<UniversalMasterCreateForm>(FormConstants.UNIVERASAL_MASTER_CREATE_FORM); universalMasterCreateForm.IsNeedClosing = true; universalMasterCreateForm.MasterType = masterType; universalMasterCreateForm.ShowDialog(); object obj = universalMasterCreateForm.CreatedItem; if (obj != null) { int index = 0; switch (masterType) { case MasterType.PRODUCT_COLOR: foreach (ProductColor type in source) { if (type.ColorId.Equals(((ProductColor) obj).ColorId)) { listBox.SelectedIndex = index; return; } index++; } break; case MasterType.PRODUCT_SIZE: foreach (ProductSize type in source) { if (type.SizeId.Equals(((ProductSize) obj).SizeId)) { listBox.SelectedIndex = index; return; } index++; } break; } source.Add(obj); listBox.SelectedIndex = source.Count - 1; Refresh(); } }
public Task <IList <Model.Master> > GetMasterList(MasterType type) { if (type == Model.MasterType.EscalationCategory || type == Model.MasterType.ReinstateReason) { return(_apiClient.RequestMasterSdk.GetMasterList(type)); } else if (type == Model.MasterType.Offence || type == Model.MasterType.BreachCategory) { return(_apiClient.CaseMasterSdk.GetMasterList(type)); } else if (type == Model.MasterType.Bank) { return(_apiClient.FinanceMasterSdk.GetMasterList(type)); } else { return(_apiClient.JobOrderMasterSdk.GetMasterList(type)); } }
public async Task <IEnumerable <Master> > GetMasterList(MasterType type) { var mapper = new MasterMappers(); var param = new DynamicParameters(); param.Add("@Type", type); return(await SqlMapper.QueryAsync(_unitOfWork.Connection, "GetMaster", new[] { typeof(Master) }, obj => { var history = obj[0] as Master; return mapper.Map(history); }, param, splitOn: "Type,ID,Value,ParentID,CreatedOn,ModifiedOn,IsDeleted", commandType: System.Data.CommandType.StoredProcedure)); }
public void BeginInvasion() { if (m_Active || Deleted) { return; } m_Active = true; List <Rectangle2D> SpawnZones = Defs[Shrine].ToList(); for (int i = 0; i < 3; i++) { Rectangle2D spawnrec = SpawnZones[Utility.Random(SpawnZones.Count)]; SpawnZones.Remove(spawnrec); Point3D p = Point3D.Zero; do { p = Map.GetRandomSpawnPoint(spawnrec); }while (p == Point3D.Zero || !Map.CanSpawnMobile(p)); List <Point3D> points = new List <Point3D>(); Misc.Geometry.Circle2D(p, Map, 4, (pnt, map) => { if (Map.CanSpawnMobile(pnt.X, pnt.Y, pnt.Z)) { points.Add(pnt); } }); if (points.Count == 0) { points.Add(p); } MasterType type = (MasterType)Utility.Random(9); List <BaseCreature> list = new List <BaseCreature>(); for (int s = 0; s < 10; s++) { BaseCreature bc = Activator.CreateInstance(_SpawnTable[(int)type][Utility.Random(_SpawnTable[(int)type].Length)]) as BaseCreature; bc.Kills = 100; if (bc.FightMode == FightMode.Evil) { bc.FightMode = FightMode.Aggressor; } list.Add(bc); Point3D point = points[Utility.Random(points.Count)]; SpawnMobile(bc, point); } ShrineMaster capt = new ShrineMaster(type, this); capt.Blessed = true; capt._Controller = this; Spawn[capt] = list; SpawnMobile(capt, p); } }
void Finishing_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Finishing; Pull(); }
/// <summary> /// Creates a new instance of the <see cref="GameStat.Collections.ServerCollection"/> class and queries a master server. /// </summary> /// <param name="type">One of the <see cref="GameStat.MasterType"/> values.</param> /// <returns>A new <see cref="GameStat.Collections.ServerCollection"/> class initialized with server information, or <c>null</c> if the master server didn't return any.</returns> /// <exception cref="System.Net.Sockets.SocketException">An error occurred when attempting to access the master server.</exception> /// <exception cref="System.ArgumentOutOfRangeException">The given <paramref name="type"/> is not recognized by GameStat.</exception> /// <exception cref="System.ArgumentException">An invalid argument was given.</exception> /// <exception cref="System.NotImplementedException">Support for the given <paramref name="type"/> is not implemented yet.</exception> /// <exception cref="GameStat.CorruptPacketException">A currupt or unknown packet was recieved from the master server.</exception> /// <example> /// This example queries the Counter-Strike master server and writes the resulting information to the console. /// <code lang="C#"> /// /// try { /// ServerCollection servers=ServerInfo.QueryMaster(MasterType.Counter-Strike); /// /// if(servers!=null) { /// foreach(Server s in servers) /// Console.WriteLine(s.Host+":"+s.Port.ToString()); /// } /// else Console.WriteLine("Master server didn't return any servers."); /// } /// catch(Exception ex) { /// Console.Error.WriteLine("An Exception Occured!"); /// Console.Error.WriteLine(ex.ToString()); /// } /// </code> /// </example> public static Collections.ServerCollection QueryMaster(MasterType type) { return(QueryMaster(type, MasterFilter.None, null, 0)); }
/// <summary> /// Creates a new instance of the <see cref="GameStat.Collections.ServerCollection"/> class and queries a master server. /// </summary> /// <param name="type">One of the <see cref="GameStat.MasterType"/> values.</param> /// <param name="filter">One or more of the <see cref="GameStat.MasterFilter"/> values.</param> /// <param name="host">The hostname/ip to query.</param> /// <returns>A new <see cref="GameStat.Collections.ServerCollection"/> class initialized with server information, or <c>null</c> if the master server didn't return any.</returns> /// <exception cref="System.Net.Sockets.SocketException">An error occurred when attempting to access the master server.</exception> /// <exception cref="System.ArgumentOutOfRangeException">The given <paramref name="type"/> is not recognized by GameStat.</exception> /// <exception cref="System.ArgumentException">An invalid argument was given.</exception> /// <exception cref="System.NotImplementedException">Support for the given <paramref name="type"/> is not implemented yet.</exception> /// <exception cref="GameStat.CorruptPacketException">A currupt or unknown packet was recieved from the master server.</exception> /// <remarks> /// If <paramref name="host"/> is set to null, GameStat will try to guess it. If <paramref name="host"/> can not be guessed, an <see cref="System.ArgumentException"/> will be thrown. /// </remarks> /// <example> /// This example queries the Counter-Strike master server and writes the resulting information to the console. /// <code lang="C#"> /// /// try { /// ServerCollection servers=ServerInfo.QueryMaster(MasterType.Counter-Strike, /// MasterFilter.NotFull|MasterFilter.NotEmpty|MasterFilter.NoPassword, null); /// /// if(servers!=null) { /// foreach(Server s in servers) /// Console.WriteLine(s.Host+":"+s.Port.ToString()); /// } /// else Console.WriteLine("Master server didn't return any servers."); /// } /// catch(Exception ex) { /// Console.Error.WriteLine("An Exception Occured!"); /// Console.Error.WriteLine(ex.ToString()); /// } /// </code> /// </example> public static Collections.ServerCollection QueryMaster(MasterType type, MasterFilter filter, string host) { return(QueryMaster(type, filter, host, 0)); }
void material_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Material; Pull(); }
void Size_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Size; Pull(); }
void Quality_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Quality; Pull(); }
private void Supplier_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Supplier; Pull(); }
public async Task <IEnumerable <Master> > Get(MasterType type) { return(await _masterService.GetMaster(type)); }
public async Task <IEnumerable <Master> > GetMaster(MasterType type) { return(await Execute(new GetMasterCommand(type))); }
public async Task <IList <Master> > GetRequest(MasterType type) { return(await _masterService.GetMasterList(type)); }
public async Task <bool> DeleteRequest(Guid id, MasterType type) { var result = await _masterService.DeleteMaster(id, type); return(result); }
public bool showMaster(MasterType MasterType) { bool _result = false; try { LGRentalMgntSystem.Forms.frmAssetList frmAssetMasterList = null; switch (MasterType) { case MasterType.CompanyType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.CompanyType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.MaterialType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.MaterialType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.Designation: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.Designation; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.AssetType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.AssetType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.AssetType1: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.AssetType1; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.PartyType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.PartyType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.VehicleType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.VehicleType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.ColourType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.ColourType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.DensityType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.DensityType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.AssetMainType: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.AssetMainType; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } case MasterType.Make: { if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } frmAssetMasterList = new LGRentalMgntSystem.Forms.frmAssetList(); frmAssetMasterList.MasterType = MasterType.Make; frmAssetMasterList.ShowDialog(); if (frmAssetMasterList != null) { frmAssetMasterList.Dispose(); frmAssetMasterList = null; } break; } } } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } return(_result); }
private void Stock_SourceChanged(object sender, EventArgs e) { masterTypeSync = MasterType.Stock; Pull(); }
public GetMasterCommand(MasterType type) { _type = type; }
private void SetSelectedValuedForCombo(MasterType masterType, ComboBox cbb1, object obj) { if (obj != null) { int index = 0; switch (masterType) { case MasterType.PRODUCT_TYPE: foreach (ProductType type in cbb1.Items) { if (type.TypeId.Equals(((ProductType)obj).TypeId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PRODUCT_SIZE: foreach (ProductSize type in cbb1.Items) { if (type.SizeId.Equals(((ProductSize)obj).SizeId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PRODUCT_COLOR: foreach (ProductColor type in cbb1.Items) { if (type.ColorId.Equals(((ProductColor)obj).ColorId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.COUNTRY: foreach (Country type in cbb1.Items) { if (type.CountryId.Equals(((Country)obj).CountryId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.DISTRIBUTOR: foreach (Distributor type in cbb1.Items) { if (type.DistributorId.Equals(((Distributor)obj).DistributorId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.MANUFACTURER: foreach (Manufacturer type in cbb1.Items) { if (type.ManufacturerId.Equals(((Manufacturer)obj).ManufacturerId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PACKAGER: foreach (Packager type in cbb1.Items) { if (type.PackagerId.Equals(((Packager)obj).PackagerId)) { cbb1.SelectedIndex = index; return; } index++; } break; } Refresh(); } }
public ShrineMaster(MasterType type, ShrineBattleController controller) : this(RandomSpecialty(), type, controller) { }
private void AddToDataToComboBox(MasterType masterType, ComboBox cbb1, BindingSource s) { var universalMasterCreateForm = GlobalUtility.GetFormObject<UniversalMasterCreateForm>(FormConstants.UNIVERASAL_MASTER_CREATE_FORM); universalMasterCreateForm.IsNeedClosing = true; universalMasterCreateForm.MasterType = masterType; universalMasterCreateForm.ShowDialog(); object obj = universalMasterCreateForm.CreatedItem; if (obj != null) { int index = 0; switch (masterType) { case MasterType.PRODUCT_TYPE: foreach (ProductType type in cbb1.Items) { if (type.TypeId.Equals(((ProductType)obj).TypeId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PRODUCT_SIZE: foreach (ProductSize type in cbb1.Items) { if (type.SizeId.Equals(((ProductSize)obj).SizeId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PRODUCT_COLOR: foreach (ProductColor type in cbb1.Items) { if (type.ColorId.Equals(((ProductColor)obj).ColorId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.COUNTRY: foreach (Country type in cbb1.Items) { if (type.CountryId.Equals(((Country)obj).CountryId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.DISTRIBUTOR: foreach (Distributor type in cbb1.Items) { if (type.DistributorId.Equals(((Distributor)obj).DistributorId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.MANUFACTURER: foreach (Manufacturer type in cbb1.Items) { if (type.ManufacturerId.Equals(((Manufacturer)obj).ManufacturerId)) { cbb1.SelectedIndex = index; return; } index++; } break; case MasterType.PACKAGER: foreach (Packager type in cbb1.Items) { if (type.PackagerId.Equals(((Packager)obj).PackagerId)) { cbb1.SelectedIndex = index; return; } index++; } break; } s.Add(obj); cbb1.SelectedIndex = s.Count - 1; Refresh(); } }