protected void lnk_change_status_click(object sender, CommandEventArgs args) { try { int Id = 0; int.TryParse(args.CommandName, out Id); bool status = false; bool.TryParse(args.CommandArgument.ToString(), out status); Vigilante oV = new Vigilante(); oV.Id = Id; VigilanteMng oVMng = new VigilanteMng(); oVMng.O_Vigilante = oV; if (status) { oVMng.dlt(); } else { oVMng.reactive(); } ddlBodega_Changed(null, null); } catch (Exception e) { ((MstCasc)this.Master).setError = e.Message; } }
public long cobrar(Vehiculo vehiculo, Parqueadero parqueadero) { Vigilante vigilante = VigilanteImpl.getInstance(); long tiempoParqueadero = vigilante.calcularTiempoVehiculoParqueadero(vehiculo.getFechaIngreso(), vehiculo.getFechaSalida()); long[] diasHoras = vigilante.calcularDiasHoras(tiempoParqueadero); vehiculo.setDiasEnParqueadero(diasHoras[0]); vehiculo.setHorasEnParqueadero(diasHoras[1]); return(vigilante.cobrarParqueadero(vehiculo, parqueadero)); }
private void istVigilante(Vigilante oV) { try { VigilanteMng oVMng = new VigilanteMng(); oVMng.O_Vigilante = oV; oVMng.add(); } catch { throw; } }
private void fillVigilante(int IdBodega) { try { VigilanteMng oVMng = new VigilanteMng(); Vigilante oV = new Vigilante(); oV.Id_bodega = IdBodega; oVMng.O_Vigilante = oV; oVMng.fillLstByBodega(true); fillCatalog(oVMng.Lst); } catch (Exception e) { ((MstCasc)this.Master).setError = e.Message; } }
private Vigilante getFormValues() { Vigilante oV = new Vigilante(); int entero = 0; int.TryParse(hfId.Value, out entero); oV.Id = entero; entero = 0; int.TryParse(ddlBodega.SelectedValue, out entero); oV.Id_bodega = entero; entero = 0; oV.Nombre = txt_nombre.Text.Trim(); return(oV); }
private void fillForm() { int Id = 0; int.TryParse(hfId.Value, out Id); try { VigilanteMng oVMng = new VigilanteMng(); Vigilante oV = new Vigilante(); oV.Id = Id; oVMng.O_Vigilante = oV; oVMng.selById(); txt_nombre.Text = oV.Nombre; ddlBodega.SelectedValue = oV.Id_bodega.ToString(); } catch { throw; } }
// Methods private static IEnumerable <string> GetResults(Role role) { switch (role) { case Vigilante _: case Veteran _: case Mafioso _: // case Pirate _: case Ambusher _: return(new[] { Vigilante.GetName(), Veteran.GetName(), Mafioso.GetName(), Ambusher.GetName() }); case Medium _: case Janitor _: case Retributionist _: // case Necromancer _: case Trapper _: return(new[] { Medium.GetName(), Janitor.GetName(), Retributionist.GetName(), Trapper.GetName() }); case Survivor _: case VampireHunter _: case Amnesiac _: // case Medusa _: case Psychic _: return(new[] { Survivor.GetName(), VampireHunter.GetName(), Amnesiac.GetName(), Psychic.GetName() }); case Spy _: case Blackmailer _: case Jailor _: case GuardianAngel _: return(new[] { Spy.GetName(), Blackmailer.GetName(), Jailor.GetName(), GuardianAngel.GetName() }); case Sheriff _: case Executioner _: case Werewolf _: // case Poisoner _: return(new[] { Sheriff.GetName(), Executioner.GetName(), Werewolf.GetName() }); case Framer _: case Vampire _: case Jester _: // case HexMaster _: return(new[] { Framer.GetName(), Vampire.GetName(), Jester.GetName() }); case Lookout _: case Forger _: // case Juggernaut _: // case CovenLeader _: return(new[] { Lookout.GetName(), Forger.GetName() }); case Escort _: case Transporter _: case Consort _: case Hypnotist _: return(new[] { Escort.GetName(), Transporter.GetName(), Consort.GetName(), Hypnotist.GetName() }); case Doctor _: case Disguiser _: case SerialKiller _: // case PotionMaster _: return(new[] { Doctor.GetName(), Disguiser.GetName(), SerialKiller.GetName() }); case Investigator _: case Consigliere _: case Mayor _: case Tracker _: // case Plaguebearer _: return(new[] { Investigator.GetName(), Consigliere.GetName(), Mayor.GetName(), Tracker.GetName() }); case Bodyguard _: case Godfather _: case Arsonist _: case Crusader _: return(new[] { Bodyguard.GetName(), Godfather.GetName(), Arsonist.GetName(), Crusader.GetName() }); } return(new string[] { }); }
// Methods private static string GetResult(Role role) { switch (role) { case Investigator _: return($"{role.Owner.Data.PlayerName} gathers information about people. They must be an {Investigator.GetName()}."); case Lookout _: return($"{role.Owner.Data.PlayerName} watches who visits people at night. They must be a {Lookout.GetName()}."); case Psychic _: return($"{role.Owner.Data.PlayerName} has the sight. They must be a {Psychic.GetName()}."); case Sheriff _: return($"{role.Owner.Data.PlayerName} is a protector of the {Faction.Crew.Name}. They must be a {Sheriff.GetName()}."); case Spy _: return($"{role.Owner.Data.PlayerName} secretly watches who someone visits. They must be a {Spy.GetName()}."); case Tracker _: return($"{role.Owner.Data.PlayerName} is a skilled in the art of tracking. They must be a {Tracker.GetName()}."); case Jailor _: return($"{role.Owner.Data.PlayerName} detains people at night. They must be a {Jailor.GetName()}."); case VampireHunter _: return($"{role.Owner.Data.PlayerName} tracks Vampires. They must be a {VampireHunter.GetName()}!"); case Veteran _: return($"{role.Owner.Data.PlayerName} is a paranoid war hero. They must be a {Veteran.GetName()}."); case Vigilante _: return($"{role.Owner.Data.PlayerName} will bend the law to enact justice. They must be a {Vigilante.GetName()}."); case Bodyguard _: return($"{role.Owner.Data.PlayerName} is a trained protector. They must be a {Bodyguard.GetName()}."); case Doctor _: return($"{role.Owner.Data.PlayerName} is a professional surgeon. They must be a {Doctor.GetName()}."); case Crusader _: return($"{role.Owner.Data.PlayerName} is a divine protector. They must be a {Crusader.GetName()}."); case Trapper _: return($"{role.Owner.Data.PlayerName} is waiting for a big catch. They must be a {Trapper.GetName()}."); case Escort _: return($"{role.Owner.Data.PlayerName} is a beautiful person working for the {Faction.Crew.Name}. They must be an {Escort.GetName()}."); case Mayor _: return($"{role.Owner.Data.PlayerName} is the leader of the {Faction.Crew.Name}. They must be the {Mayor.GetName()}."); case Medium _: return($"{role.Owner.Data.PlayerName} speaks with the dead. They must be a {Medium.GetName()}."); case Retributionist _: return($"{role.Owner.Data.PlayerName} wields mystical powers. They must be a {Retributionist.GetName()}."); case Transporter _: return($"{role.Owner.Data.PlayerName} specializes in transportation. They must be a {Transporter.GetName()}."); case Disguiser _: return($"{role.Owner.Data.PlayerName} makes other people appear to be someone they're not. They must be a {Disguiser.GetName()}"); case Forger _: return($"{role.Owner.Data.PlayerName} is good at forging documents. They must be a {Forger.GetName()}."); case Framer _: return($"{role.Owner.Data.PlayerName} has a desire to deceive. They must be a {Framer.GetName()}!"); case Hypnotist _: return($"{role.Owner.Data.PlayerName} is skilled at disrupting others. They must be a {Hypnotist.GetName()}."); case Janitor _: return($"{role.Owner.Data.PlayerName} cleans up dead bodies. They must be a {Janitor.GetName()}."); case Ambusher _: return($"{role.Owner.Data.PlayerName} lies in wait. They must be an {Ambusher.GetName()}."); case Godfather _: return($"{role.Owner.Data.PlayerName} is the leader of the {Faction.Mafia.Name}. They must be the {Godfather.GetName()}."); case Mafioso _: return($"{role.Owner.Data.PlayerName} does the {Godfather.GetName()}'s dirty work. They must be a {Mafioso.GetName()}."); case Blackmailer _: return($"{role.Owner.Data.PlayerName} uses information to silence people. They must be a {Blackmailer.GetName()}."); case Consigliere _: return($"{role.Owner.Data.PlayerName} gathers information for the {Faction.Mafia.Name}. They must be a {Consigliere.GetName()}."); case Consort _: return($"{role.Owner.Data.PlayerName} is a beautiful person working for the {Faction.Mafia.Name}. They must be a {Consort.GetName()}."); case Amnesiac _: return($"{role.Owner.Data.PlayerName} does not remember their role. They must be an {Amnesiac.GetName()}."); case GuardianAngel _: return($"{role.Owner.Data.PlayerName} is watching over someone. They must be a {GuardianAngel.GetName()}."); case Survivor _: return($"{role.Owner.Data.PlayerName} simply wants to live. They must be a {Survivor.GetName()}."); case Vampire _: return($"{role.Owner.Data.PlayerName} drinks blood. They must be a {Vampire.GetName()}!"); case Executioner _: return($"{role.Owner.Data.PlayerName} wants someone to be lynched at any cost. They must be an {Executioner.GetName()}."); case Jester _: return($"{role.Owner.Data.PlayerName} wants to be lynched. They must be a {Jester.GetName()}."); case Witch _: return($"{role.Owner.Data.PlayerName} casts spells on people. They must be a {Witch.GetName()}."); case Arsonist _: return($"{role.Owner.Data.PlayerName} likes to watch things burn. They must be an {Arsonist.GetName()}."); case SerialKiller _: return($"{role.Owner.Data.PlayerName} wants to kill everyone. They must be a {SerialKiller.GetName()}"); case Werewolf _: return($"{role.Owner.Data.PlayerName} howls at the moon. They must be a {Werewolf.GetName()}."); default: return("No special role found."); } }