public Addpro()
 {
     accmng = new Accmng();
     pro    = new Pro();
     acc    = new Account();
     promng = new Progmng();
     InitializeComponent();
     if (accmng.readkey() != null)
     {
         pro = promng.get(Convert.ToInt32(accmng.readkey()));
         if (pro.Program_id.Equals(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;
             pro                               = promng.get(Convert.ToInt32(accmng.readkey()));
             acc                               = accmng.getpropass(Convert.ToInt32(accmng.readkey()));
             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);
         }
         else
         {
             throw new Exception("Access Denied");
         }
     }
 }
        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;
            }
        }
        public Addfac()
        {
            fac    = new Faculty();
            acc    = new Account();
            ass    = new Assignment();
            stumng = new Studmng();
            facmng = new Facmng();
            accmng = new Accmng();
            images = new Images();
            InitializeComponent();

            cmbxgen.DataSource = facmng.gender();
            cmbxqua.DataSource = facmng.qualification();
            if (accmng.readkey() != null)
            {
                fac = facmng.get(Convert.ToInt32(accmng.readkey()));
                if (fac == null)
                {
                    throw new Exception("Access Denied");
                }
                else
                {
                    facmng.Email(Convert.ToInt32(accmng.readkey()));
                    string[] a = accmng.annoucements().Split('\n');
                    foreach (string s in a)
                    {
                        listBox2.Items.Add(s);
                    }
                    panel6.Visible = false;
                    phome.Visible  = true;
                    acc            = accmng.getfacpass(Convert.ToInt32(accmng.readkey()));
                    FillForm(fac, acc);
                    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 Uploaded";
                        btnsubmit.Enabled = false;
                        btndelete.Enabled = true;
                        Fillexistassign(ass);
                    }
                    else if (ass == null)
                    {
                        lblnote.Text      = "Assignment Not Uploaded";
                        btnsubmit.Enabled = true;
                        btnbrowse.Enabled = true;
                    }
                }
            }
        }
        public Addmain()
        {
            ad       = new Admin();
            accmng   = new Accmng();
            facmng   = new Facmng();
            ad       = new Admin();
            acc      = new Account();
            images   = new Images();
            adminmng = new Adminmng();
            InitializeComponent();
            if (accmng.readkey() != null)
            {
                ad = adminmng.get(Convert.ToInt32(accmng.readkey()));
                if (ad == null)
                {
                    throw new Exception("Access Denied");
                }
                else
                {
                    if (ad.ID.Equals(Convert.ToInt32(accmng.readkey())))
                    {
                        acc = accmng.getadminpass(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);
                    }
                    else
                    {
                        throw new Exception("Access Denied");
                    }
                }
            }
        }
 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;
     }
 }
        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;
            }
        }
Example #7
0
        public Addstu()
        {
            stu    = new Student();
            facmng = new Facmng();
            stumng = new Studmng();
            accmng = new Accmng();
            images = new Images();
            InitializeComponent();

            cmbxgen.DataSource = facmng.gender();
            if (accmng.readkey() != null)
            {
                stu = stumng.get(Convert.ToInt32(accmng.readkey()));
                if (stu.ID.Equals(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;
                    acc            = accmng.getstupass(Convert.ToInt32(accmng.readkey()));
                    FillForm(stu, acc);
                    comboBox1.DataSource              = stumng.teachernames(Convert.ToInt32(accmng.readkey()));
                    comboBox2.DataSource              = stumng.teachernames(Convert.ToInt32(accmng.readkey()));
                    dataGridView1.DataSource          = stumng.getcourse(Convert.ToInt32(accmng.readkey()));
                    dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                    dataGridView1.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
                }
                else
                {
                    throw new Exception("Access Denied");
                }
            }
        }