Exemplo n.º 1
0
        private void btnlogin_Click_1(object sender, EventArgs e)
        {
            try
            {
                acc.Pro_id   = Convert.ToInt32(txtidmain.Text);
                acc.Password = txtpassmain.Text;

                promng.verifyprogram(acc.Pro_id, acc.Password);

                accmng.createkey(acc.Pro_id);
                pro = promng.get(Convert.ToInt32(accmng.readkey()));

                string[] a = accmng.annoucements().Split('\n');
                foreach (string s in a)
                {
                    listBox1.Items.Add(s);
                }

                panel6.Visible                    = false;
                phome.Visible                     = true;
                dataGridView1.DataSource          = promng.getcourse(Convert.ToInt32(accmng.readkey()));
                dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                dataGridView1.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView2.DataSource          = promng.getAll(Convert.ToInt32(accmng.readkey()));
                FillForm(pro, acc);
                lblmsg.Text      = "";
                txtidmain.Text   = "";
                txtpassmain.Text = "";
            }
            catch (Exception ex)
            {
                lblmsg.Text = ex.Message;
            }
        }
Exemplo n.º 2
0
 private void btnlogin_Click(object sender, EventArgs e)
 {
     acc = new Account();
     try
     {
         acc.Fac_id   = Convert.ToInt32(txtidmain.Text);
         acc.Password = txtpassmain.Text;
         accmng.verifyfac(acc.Fac_id, acc.Password);
         string[] a = accmng.annoucements().Split('\n');
         foreach (string s in a)
         {
             listBox2.Items.Add(s);
         }
         panel6.Visible = false;
         phome.Visible  = true;
         accmng.createkey(acc.Fac_id);
         facmng.Email(Convert.ToInt32(accmng.readkey()));
         fac = facmng.get(Convert.ToInt32(accmng.readkey()));
         FillForm(fac, acc);
         lblmsg.Text                 = "";
         txtidmain.Text              = "";
         txtpassmain.Text            = "";
         comboBox1.DataSource        = facmng.studentids(Convert.ToInt32(accmng.readkey()));
         dataGridView1.DataSource    = facmng.getAll(Convert.ToInt32(accmng.readkey()));
         dtmarks.DataSource          = facmng.getmarks(Convert.ToInt32(accmng.readkey()));
         dtmarks.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
         dtmarks.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
         ass = facmng.getassign(Convert.ToInt32(accmng.readkey()));
         if (ass != null)
         {
             lblnote.Text      = "Assignment has been Uploaded";
             btnsubmit.Enabled = false;
             btnupdate.Enabled = false;
             btndelete.Enabled = true;
             Fillexistassign(ass);
         }
         else if (ass == null)
         {
             lblnote.Text      = "Assignment Not Uploaded";
             btnsubmit.Enabled = true;
             btnbrowse.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         lblmsg.Text = ex.Message;
     }
 }
Exemplo n.º 3
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            try
            {
                acc          = new Account();
                acc.Admin_id = Convert.ToInt32(txtidmain.Text);
                acc.Password = txtpassmain.Text;
                adminmng.verifyadmin(acc.Admin_id, acc.Password);
                accmng.createkey(acc.Admin_id);
                ad = adminmng.get(Convert.ToInt32(accmng.readkey()));

                string[] a = accmng.annoucements().Split('\n');
                foreach (string s in a)
                {
                    listBox1.Items.Add(s);
                }

                panel1.Visible = false;

                phome.Visible                     = true;
                dataGridView1.DataSource          = adminmng.getprogram();
                dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                dataGridView1.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView2.DataSource          = adminmng.getcourse();
                dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                dataGridView2.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView3.DataSource          = adminmng.getStudent();
                comboBox1.DataSource              = adminmng.teachernames();
                FillForm(ad, acc);
                lblmsg.Text      = "";
                txtidmain.Text   = "";
                txtpassmain.Text = "";
            }
            catch (Exception ex)
            {
                lblmsg.Text = ex.Message;
            }
        }