Beispiel #1
0
        private void lnkClo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CLO c = new CLO();

            this.Hide();
            c.Show();
        }
Beispiel #2
0
        void std_FormClosed(object sender, FormClosingEventArgs e)
        {
            std              = null;
            clo              = null;
            rubric           = null;
            assessment       = null;
            component        = null;
            result           = null;
            classattendance  = null;
            stdattendance    = null;
            cloreport        = null;
            assessmentreport = null;


            stdflag              = false;
            cloflag              = false;
            rbflag               = false;
            assessmentflag       = false;
            componentflag        = false;
            studentresultflag    = false;
            classattendanceflag  = false;
            studentresultflag    = false;
            cloreportflag        = false;
            assessmentreportflag = false;
            //throw new NotImplementedException();
        }
Beispiel #3
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CLO C = new CLO();

            this.Hide();
            C.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                CLO s = new CLO();
                s.set_Name(text1.Text);
                s.set_Data_Created(dateTimePicker3.Value);
                s.set_Data_Updated(dateTimePicker4.Value);

                if ((s.get_Name() == null || s.get_Name() == "") || (s.get_Data_Created() == null) || (s.get_Data_Updated() == null))
                {
                    MessageBox.Show("Submssion is not allowed with null values");
                }
                else
                {
                    string        constr = "Data Source=DESKTOP-GP94IEM\\SQLEXPRESS;Initial Catalog=Projectb;Integrated Security=True";
                    SqlConnection c      = new SqlConnection(constr);
                    c.Open();
                    int f   = dataGridView1.CurrentCell.RowIndex;
                    int id4 = (int)(dataGridView1.Rows[f].Cells["Id"].Value);
                    //MessageBox.Show("Updating this entry"

                    string s1 = string.Format("UPDATE clo SET Name=@Name, DateCreated=@DateCreated,DateUpdated=@DateUpdated where Id=@Id");

                    //values('" + s.get_FirstName() + "',  '" + s.get_LastName() + "','" + s.get_Contact() + "','" + s.get_Email() + "','" + s.get_Registration_No() + "','" + id + "')");

                    //string s1 = string.Format("INSERT INTO Student(FirstName,LastName,Contact,Email,RegistrationNumber,Status) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}')", s.get_FirstName(), s.get_LastName(), s.get_Contact(), s.get_Email(), s.get_Registration_No(), id);
                    SqlCommand a2 = new SqlCommand(s1, c);
                    //GetExample(a2, p.ToArray());

                    a2.Parameters.Add(new SqlParameter("Id", id4));

                    a2.Parameters.Add(new SqlParameter("@Name", SqlDbType.VarChar));
                    a2.Parameters["@Name"].Value = s.get_Name();
                    a2.Parameters.Add(new SqlParameter("@DateCreated", SqlDbType.DateTime));
                    a2.Parameters["@DateCreated"].Value = s.get_Data_Created();
                    a2.Parameters.Add(new SqlParameter("@DateUpdated", SqlDbType.DateTime));
                    a2.Parameters["@DateUpdated"].Value = s.get_Data_Updated();

                    int rows = a2.ExecuteNonQuery();
                    if (rows != 0)
                    {
                        MessageBox.Show("CLO Updated");
                        c.Close();
                        panel1.Hide();
                        this.Close();
                        Manage_Clo j = new Manage_Clo();
                        j.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #5
0
 private void manageToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (clo == null)
     {
         clo              = new CLO();
         clo.MdiParent    = this;
         clo.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.std_FormClosed);
         clo.Show();
         if (stdflag)
         {
             std.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (rbflag)
         {
             rubric.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (assessmentflag)
         {
             assessment.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (componentflag)
         {
             component.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (studentattendanceflag)
         {
             stdattendance.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (classattendanceflag)
         {
             classattendance.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (studentresultflag)
         {
             result.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (cloreportflag)
         {
             cloreport.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         if (assessmentreportflag)
         {
             assessmentreport.WindowState = System.Windows.Forms.FormWindowState.Minimized;
         }
         cloflag = true;
     }
     else
     {
         clo.Activate();
     }
 }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                CLO s = new CLO();
                s.set_Name(Name.Text);
                s.set_Data_Created(dateTimePicker1.Value);
                s.set_Data_Updated(dateTimePicker2.Value);
                if ((Name.Text == "") || (dateTimePicker1.Value == null) || (dateTimePicker2.Value == null))
                {
                    MessageBox.Show("Submssion is not allowed with null values");
                }
                else if ((s.get_Name() == "" || (s.get_Name() == null)) || (s.get_Data_Created() == null) || (s.get_Data_Updated() == null))
                {
                    MessageBox.Show("Invalid Data Entered!!");
                }
                else
                {
                    string        constr = "Data Source=DESKTOP-GP94IEM\\SQLEXPRESS;Initial Catalog=Projectb;Integrated Security=True";
                    SqlConnection c      = new SqlConnection(constr);
                    c.Open();

                    string     s2   = string.Format("INSERT INTO Clo(Name,DateCreated,DateUpdated) values('" + s.get_Name() + "','" + s.get_Data_Created() + "','" + s.get_Data_Updated() + "')");
                    SqlCommand a2   = new SqlCommand(s2, c);
                    int        rows = a2.ExecuteNonQuery();
                    if (rows != 0)
                    {
                        MessageBox.Show("CLO Added");
                        this.Close();
                        Manage_Clo h = new Manage_Clo();
                        h.Show();
                    }
                    c.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }