Esempio n. 1
0
        public Form2(Admin a)
        {
            count = 0;
            admin = a;
            LO    = o.read();
            LC    = c.read();
            LCT   = cT.read();
            InitializeComponent();
            DefaultImage = pictureBox1.Image;
            for (int i = 0; i < LO.Count; i++)
            {
                comboBox6.Items.Add(LO[i].O_id);
            }

            for (int i = 0; i < LC.Count; i++)
            {
                selectCmbo.Items.Add(LC[i].C_id);
            }

            for (int i = 0; i < LO.Count; i++)
            {
                if (LO[i].assigNum < 10)
                {
                    officerCmbo.Items.Add(LO[i].O_id);
                }
            }

            for (int i = 0; i < LCT.Count; i++)
            {
                typeCmbo.Items.Add(LCT[i].T_name);
                comboBox9.Items.Add(LCT[i].T_name);
                listBox1.Items.Add(LCT[i].T_name);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Officer        officer = new Officer();
                Admin          admin = new Admin();
                List <Officer> LO = o.read();
                List <Admin>   LA = a.read();
                string[]       results = username_txt.Text.Split('#');
                string         id = results[0];
                string         name = results[1];
                bool           isO = false, isA = false;
                for (int i = 0; i < LO.Count; i++)
                {
                    if (name == LO[i].O_name && id == LO[i].O_id && password_txt.Text == LO[i].O_Password)
                    {
                        isO     = true;
                        officer = LO[i];
                    }
                }

                for (int i = 0; i < LA.Count; i++)
                {
                    if (name == LA[i].A_name && id == LA[i].A_id && password_txt.Text == LA[i].A_Password)
                    {
                        isA   = true;
                        admin = LA[i];
                    }
                }

                if (isA)
                {
                    Form2 form2 = new Form2(admin);
                    this.Hide();
                    form2.Show();
                }
                else if (isO)
                {
                    Form3 form3 = new Form3(officer);
                    this.Hide();
                    form3.Show();
                }
                else
                {
                    MessageBox.Show("Invalid");
                }
            }
            catch
            {
                MessageBox.Show("Invalid");
            }
            //Form2 form2 = new Form2(admin);
            //form2.Show();
        }
Esempio n. 3
0
        public Form3(Officer o)
        {
            officer = o;
            count   = 0;
            LO      = officer.read();
            LC      = c.read();
            LCT     = cT.read();
            InitializeComponent();

            for (int i = 0; i < LC.Count; i++)
            {
                if (LC[i].C_offId == officer.O_id && LC[i].C_Stat == true)
                {
                    comboBox2.Items.Add(LC[i].C_id);
                    selectCmbo.Items.Add(LC[i].C_id);
                }
            }

            for (int i = 0; i < LCT.Count; i++)
            {
                typeCmbo.Items.Add(LCT[i].T_name);
            }
        }