private void btnLogin(object sender, EventArgs e) { if (ConnectionXML.Load_xml(CUserType.Text, TUserName.Text, TUserPassword.Text) == false) { MessageBox.Show("Error"); TUserName.Text = ""; TUserPassword.Text = ""; //this.ActiveControl = TUserName; TUserName.Select(); } else if (CUserType.Text == "Receptionist") { this.Hide(); Receptionist f2 = new Receptionist(); f2.ShowDialog(); } else if (CUserType.Text == "Doctor") { this.Hide(); Doctor f2 = new Doctor(); f2.ShowDialog(); } else { this.Hide(); Admin f2 = new Admin(); f2.ShowDialog(); } }
private void diagram_ConnectionManipulationCompleted_1(object sender, ManipulationRoutedEventArgs e) { ChooseConnectionType win = new ChooseConnectionType(); if (win.ShowDialog() == true) { var ConnectionContents = new ConnectionXML(); Window wind = null; switch (win.SelectedIndex) { case ConnectionTypes.eDecision: wind = new DecisionSettings(ConnectionContents); break; case ConnectionTypes.eChance: wind = new ChanceSettings(ConnectionContents); break; case ConnectionTypes.eBattle: wind = new BattleSettings(ConnectionContents); break; case ConnectionTypes.eCondition: wind = new ConditionSettings(ConnectionContents); break; case ConnectionTypes.eChanceRollback: { wind = new RollBackSettings(ConnectionContents); break; } case ConnectionTypes.eInventoryCondition: throw new ArgumentOutOfRangeException(); break; default: throw new ArgumentOutOfRangeException(); } ConnectionContents.Type = win.SelectedIndex; this.IgnoreSelection = true; if (wind != null && wind.ShowDialog() == true) { e.Connection.TargetCapType = CapType.Arrow1Filled; e.Connection.Content = ConnectionContents; return; } // this.IgnoreSelection = false; } this.diagram.RemoveConnection(e.Connection); }
public DecisionSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; if (this.connection.Decision == null) { this.connection.Decision = new Decision(); this.connection.Decision.Text = "Continue"; } this.txtText.Text = this.connection.Decision.Text; this.connection.Type = ConnectionTypes.eDecision; }
public ChanceSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; if (this.connection.Chance == null) { this.connection.Chance = new Chance(); this.connection.Chance.Text = "Опитай шанса си"; } this.txtProbability.Text = this.connection.Chance.Probability.ToString(); this.txtText.Text = this.connection.Chance.Text; this.connection.Type = ConnectionTypes.eChance; }
public BattleSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; if (this.connection.Battle == null) { this.connection.Battle = new Battle(); this.connection.Battle.Text = "Бий се!"; } else { this.txtHealth.Text = this.connection.Battle.EnemyHealth.ToString(); this.txtStrength.Text = this.connection.Battle.EnemyStrength.ToString(); this.txtLose.Text = this.connection.Battle.Lose.ToString(); } this.txtText.Text = this.connection.Battle.Text; }
private void btnSaveAddUser_Click(object sender, EventArgs e) { AddUser addNewUser = new AddUser(); string userType = string.Empty; if (rbReceptionist.Checked == true) { userType = "Receptionist"; string tmp = addNewUser.addRecep(txtRecName.Text, txtRecMobile.Text, txtRecAdress.Text, txtRecEmail.Text, txtRecPhone.Text); if (!tmp.Equals("Done")) { label4.Text = tmp; } } else if (rbDoctor.Checked == true) { userType = "Doctor"; } else if (rbAdmin.Checked == true) { userType = "Admin"; } else { label4.Text = "You should to select User Type"; return; } if (!string.IsNullOrWhiteSpace(txtUserName.Text) && !string.IsNullOrWhiteSpace(txtUserPassword.Text)) { if (ConnectionXML.addUser(userType, txtUserName.Text, txtUserPassword.Text)) { clear(); SystemSounds.Asterisk.Play(); } else { SystemSounds.Hand.Play(); MessageBox.Show("Big Error", "Error"); } } else { label4.Text = "You should to fill user name and password fields"; return; } }
public RollBackSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; //this.connection.Type = ConnectionTypes.eCondition; if (this.connection.ChanceRollback == null) { this.connection.ChanceRollback = new GameClasses.ChanceRollBack(); this.connection.ChanceRollback.Predicates = new List <Predicate>(); } else { this.txtText.Text = this.connection.ChanceRollback.Text; } this.dgPredicates.ItemsSource = this.connection.ChanceRollback.Predicates; var lstItems = new List <ItemStrings>(); lstItems.AddRange(Globals.GameElements.Items); lstItems.AddRange(Globals.GameElements.Stats); lstItems.AddRange(Globals.GameElements.Skills); this.dgcmbPredicateName.ItemsSource = lstItems; List <PredicateTypeList> Dict = new List <PredicateTypeList>(); Dict.Add(new PredicateTypeList { Key = PredicateTypes.eInventory, Value = "Inventory" }); Dict.Add(new PredicateTypeList { Key = PredicateTypes.eStat, Value = "Stat" }); Dict.Add(new PredicateTypeList { Key = PredicateTypes.eSkill, Value = "Skill" }); this.dgcmbPredicateType.ItemsSource = Dict; }