Esempio n. 1
0
        public override void Init(ClientUI.UserObjectEventArgs args)
        {
            if (!args.data.ContainsKey("PERSON_INFO") || !(args.data["PERSON_INFO"] is Database.FullPersonInfo))
            {
                MessageBox.Show("Args doesn't contain PERSON_INFO", "ATMPinCode::Init ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            info = (Database.FullPersonInfo)(args.data["PERSON_INFO"]);
        }
Esempio n. 2
0
        public void setId(UInt64 id)
        {
            if (id == 0)
            {
                fullPersonInfo = new Database.FullPersonInfo();
                this.idBox.Text = "";
                this.nameBox.Text = "";
                genderBox.SelectedIndex = 0;
                genomeBox.SelectedIndex = 0;
            }
            else
            {
                this.Enabled = true;
                fullPersonInfo = getDatabase().getPersonInfo(id);

                this.idBox.Text = Convert.ToString(fullPersonInfo.id);
                this.nameBox.Text = fullPersonInfo.name;

                switch (fullPersonInfo.gender)
                {
                    case Database.FullPersonInfo.Gender.Female:
                        genderBox.SelectedIndex = 2;
                        break;
                    case Database.FullPersonInfo.Gender.Male:
                        genderBox.SelectedIndex = 1;
                        break;
                    case Database.FullPersonInfo.Gender.Unknown:
                        genderBox.SelectedIndex = 0;
                        break;
                }

                switch (fullPersonInfo.genome)
                {
                    case Database.FullPersonInfo.Genome.Android:
                        genomeBox.SelectedIndex = 1;
                        break;
                    case Database.FullPersonInfo.Genome.Human:
                        genomeBox.SelectedIndex = 0;
                        break;
                }

            }
            bindingSource.DataSource = fullPersonInfo.properties;
            propertiesGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
            propertiesGridView.Columns[2].Width = propertiesGridView.Width * 4 / 5;
            propertiesGridView.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells);
        }