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

            newf.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 AssessmentComponent set Name='" + txtcompname.Text.ToString() + "',RubricId='" + Convert.ToInt32(comboBoxRubricid.Text) + "',TotalMarks='" + Convert.ToInt32(txttotalmarks.Text) + "',DateUpdated='" + DateTime.Now + "',AssessmentId='" + Convert.ToInt32(comboBoxAssessId.SelectedValue) + "' 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 AssessmentComponent(Name,RubricId,TotalMarks,DateCreated,DateUpdated,AssessmentId) values('" + txtcompname.Text.ToString() + "','" + Convert.ToInt32(comboBoxRubricid.Text) + "','" + Convert.ToInt32(txttotalmarks.Text) + "','" + DateTime.Now + "','" + DateTime.Now + "','" + Convert.ToInt32(comboBoxAssessId.SelectedValue) + "')";
                SqlCommand newcom = new SqlCommand(qu, newcon);
                newcom.ExecuteNonQuery();
                newcon.Close();
            }
            this.Hide();
            ManageAssessmentComponent newf = new ManageAssessmentComponent();

            newf.Show();
        }