private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            GroupEvaluation cg = new GroupEvaluation();

            this.Hide();
            cg.Show();
        }
Esempio n. 2
0
        private void button11_Click(object sender, EventArgs e)
        {
            this.Hide();
            GroupEvaluation ee = new GroupEvaluation();

            ee.Show();
        }
        private void individualEvaluationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GroupEvaluation l = GroupEvaluation.getInstance();

            l.Show();
            this.Hide();
        }
        private void button8_Click(object sender, EventArgs e)
        {
            GroupEvaluation ge = new GroupEvaluation();

            this.Hide();
            ge.Show();
        }
Esempio n. 5
0
        private void btnEvalGroups_Click(object sender, EventArgs e)
        {
            this.Hide();
            GroupEvaluation GE = new GroupEvaluation();

            GE.Show();
        }
Esempio n. 6
0
        private void button6_Click(object sender, EventArgs e)
        {
            conn.Open();

            int    ad  = Convert.ToInt32(comboBox3.SelectedItem.ToString());  //group id
            string reg = Convert.ToString(comboBox2.SelectedItem.ToString()); //evaluation name

            string     prooo   = "SELECT Id FROM Evaluation WHERE Name='" + reg + "' ";
            SqlCommand InvAmou = new SqlCommand(prooo, conn);
            int        pro     = Convert.ToInt32(InvAmou.ExecuteScalar());
            string     mark    = textBox1.Text.ToString();

            if (string.IsNullOrEmpty(mark) || !Regex.IsMatch(textBox1.Text, @"^[0-9]{1,3}$"))
            {
                MessageBox.Show("Invalid marks");
                textBox1.Clear();
                textBox1.BackColor = Color.DodgerBlue;
                conn.Close();
                return;
            }
            int      marks = Convert.ToInt32(textBox1.Text.ToString());
            DateTime dt    = DateTime.Today;

            try
            {
                String insert1 = "insert into GroupEvaluation  values('" + ad + "','" + pro + "','" + marks + "','" + dt + "' ) ";

                SqlCommand sql1 = new SqlCommand(insert1, conn);
                int        i1   = sql1.ExecuteNonQuery();

                // to check if the student is registered or not
                if (i1 >= 1)
                {
                    MessageBox.Show("Evaluation is marked against a  group");
                    this.Refresh();
                }
                else
                {
                    {
                        MessageBox.Show("Evaluation Not Marked");
                    }
                }
                this.Refresh();
                Refresh();
                this.Hide();
                GroupEvaluation ss = new GroupEvaluation();
                ss.Show();

                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Already exists");
                conn.Close();
            }
        }
 public static GroupEvaluation getInstance()
 {
     if (l == null)
     {
         l = new GroupEvaluation();
         l.Show();
         return(l);
     }
     else
     {
         return(l);
     }
 }
Esempio n. 8
0
        private void button5_Click(object sender, EventArgs e)
        {
            conn.Open();
            int      marks = Convert.ToInt32(textBox1.Text.ToString());
            DateTime dt    = DateTime.Today;

            try
            {
                String     insert1 = "update  GroupEvaluation set  GroupId='" + IDD + "',EvaluationId='" + idd + "',ObtainedMarks='" + marks + "',EvaluationDate='" + dt + "' WHERE  GroupId = '" + IDD + "' AND EvaluationId='" + idd + "'";
                SqlCommand sql1    = new SqlCommand(insert1, conn);
                int        i1      = sql1.ExecuteNonQuery();

                // to check if the student is registered or not
                if (i1 >= 1)
                {
                    MessageBox.Show("Updation Sucessful");
                    this.Refresh();
                }
                else
                {
                    { MessageBox.Show("Updation failed"); }
                }
                this.Refresh();
                Refresh();
                this.Hide();
                GroupEvaluation ss = new GroupEvaluation();
                ss.Show();

                conn.Close();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
                conn.Close();
            }
        }
Esempio n. 9
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            conn.Open();

            if (e.RowIndex == dataGridView1.NewRowIndex || e.RowIndex < 0)
            {
                return;
            }

            //Check if click is on specific column
            if (e.ColumnIndex == dataGridView1.Columns["DeleteButton"].Index)
            {
                int index = e.RowIndex;
                IDD = Convert.ToInt32(dataGridView1.Rows[index].Cells[2].Value.ToString());
                idd = Convert.ToInt32(dataGridView1.Rows[index].Cells[3].Value.ToString());
                try
                {
                    string delete1 = String.Format("DELETE FROM GroupEvaluation WHERE GroupId = '" + IDD + "' AND EvaluationId='" + idd + "'");

                    SqlCommand de11 = new SqlCommand(delete1, conn);
                    int        i    = de11.ExecuteNonQuery();

                    if (i >= 1)
                    {
                        MessageBox.Show("  Deletion Succesfull ");
                        this.Refresh();
                    }
                    else
                    {
                        MessageBox.Show("  Deletion Failed");
                    }
                    this.Refresh();
                    Refresh();
                    this.Hide();
                    GroupEvaluation ss = new GroupEvaluation();
                    ss.Show();
                }
                catch (Exception a)
                {
                    MessageBox.Show(a.Message);
                }
            }


            else if (e.ColumnIndex == dataGridView1.Columns["EditButton"].Index)
            {
                panel5.Show();
                button6.Hide();
                button5.Show();
                label2.Hide();
                label5.Hide();
                comboBox2.Hide();
                comboBox3.Hide();
                int indexx = e.RowIndex;
                IDD = Convert.ToInt32(dataGridView1.Rows[indexx].Cells[2].Value.ToString());
                idd = Convert.ToInt32(dataGridView1.Rows[indexx].Cells[3].Value.ToString());

                SqlCommand     cmd;
                SqlDataAdapter da;
                DataSet        ds;
                cmd = new SqlCommand("SELECT Id FROM [dbo].[Group]", conn);

                da = new SqlDataAdapter(cmd);
                ds = new DataSet();

                da.Fill(ds);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

                {
                    comboBox3.Items.Add(ds.Tables[0].Rows[i][0]);
                }

                cmd = new SqlCommand("select Name from Evaluation", conn);

                da = new SqlDataAdapter(cmd);
                ds = new DataSet();

                da.Fill(ds);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

                {
                    comboBox2.Items.Add(ds.Tables[0].Rows[i][0]);
                }
            }
            conn.Close();
        }
Esempio n. 10
0
        private void button9_Click(object sender, EventArgs e)
        {
            GroupEvaluation id3 = new GroupEvaluation();

            id3.Show();
        }