Ejemplo n.º 1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            ManageAssessment addn = new ManageAssessment();

            addn.Show();
        }
Ejemplo n.º 2
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            if (Class1.stuId != -1)
            {
                SqlConnection newcon1 = new SqlConnection(con);
                newcon1.Open();
                string     qu     = "update Assessment set Title='" + txtassestitle.Text.ToString() + "',TotalMarks='" + Convert.ToInt32(txttotalmarks.Text) + "',TotalWeightage='" + Convert.ToInt32(txttotalweigh.Text) + "' where Id='" + Class1.stuId + "'";
                SqlCommand newcom = new SqlCommand(qu, newcon1);
                newcom.ExecuteNonQuery();
                newcon1.Close();
                Class1.stuId = -1;
            }
            else
            {
                SqlConnection newcon = new SqlConnection(con);
                newcon.Open();
                string     qu     = "insert into Assessment(Title,DateCreated,TotalMarks,TotalWeightage) values('" + txtassestitle.Text.ToString() + "','" + DateTime.Now + "','" + Convert.ToInt32(txttotalmarks.Text) + "','" + Convert.ToInt32(txttotalweigh.Text) + "')";
                SqlCommand newcom = new SqlCommand(qu, newcon);
                newcom.ExecuteNonQuery();
                newcon.Close();
            }
            this.Hide();
            ManageAssessment addn = new ManageAssessment();

            addn.Show();
        }