private void button3_Click(object sender, EventArgs e)
 {
     string TheCommand = "";
     if (textBox1.Text == "" )
     {
         MessageBox.Show("Roll No cannot be Empty!!!");
     }
     else
     {
         TheCommand = "SELECT FullName,ClassCode FROM Student WHERE RollNo = '" + textBox1.Text+"'";
         ExcSQL pv = new ExcSQL(2, TheCommand);
         textBox2.Text = pv.FullName;
         comboBox1.Text = pv.ClassCode;
     }
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string TheCommand = "";
            if(textBox1.Text=="" || this.dateTimePicker1.ToString().Equals(this.dateTimePicker2.ToString()))
            {
                MessageBox.Show("Please enter valid details");
            }
            else
            {
                TheCommand = " IF EXISTS (SELECT * FROM Class WHERE Semester='" + textBox1.Text + "') "
                            + "SELECT SemesterId From Class where SemesterId='" + textBox1.Text + "'"
                    +" ELSE INSERT INTO Semester(SemesterId,Name,StartDate,EndDate) VALUES('" + textBox1.Text.ToString() + "','" + textBox1.Text.ToString() + "','" + Convert.ToDateTime(this.dateTimePicker1.Text) + "','" + Convert.ToDateTime(this.dateTimePicker2.Text) + "')";

                ExcSQL pv = new ExcSQL(1,TheCommand);
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            string TheCommand = "";
            if (textBox1.Text == "")
            {
                MessageBox.Show("Roll No cannot be Empty!!!");
            }
            else
            {
                TheCommand = "SELECT SemesterId,SemesterNo,Status_ FROM StudentStatus WHERE RollNo = '" + textBox1.Text + "'";
                ExcSQL pv = new ExcSQL(3, TheCommand);
                comboBox1.Text = pv.SemesterName;
                textBox2.Text = pv.SemesterNo;
                comboBox2.Text = pv.Status;

            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string TheCommand = "";
            if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.SelectedIndex < 0 || comboBox2.SelectedIndex < 0)
            {
                MessageBox.Show("All fields must be filled!!!");
            }
            else
            {
                TheCommand = " IF EXISTS (SELECT * FROM StudentStatus WHERE RollNo='" + textBox1.Text+"') "
                            +"SELECT RollNo From StudentStatus where RollNo='" + textBox1.Text+"'"
                            +" ELSE INSERT INTO StudentStatus(RollNo,SemesterId,SemesterNo,Status_) Values ('"
                            + textBox1.Text +"','" + comboBox1.SelectedItem.ToString() +"','"+ textBox2.Text + "','" + comboBox2.SelectedItem.ToString() + "')";

                ExcSQL pv = new ExcSQL(4,TheCommand);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string TheCommand = "";
            if (textBox1.Text == "" )
            {
                MessageBox.Show("You must Enter a rollno!!!");
            }
            else
            {
                TheCommand = "update StudentStatus set "
                +"SemesterId = '"+comboBox2.Text+"', SemesterNo = "
                +textBox3.Text+ ", Status_ = '"+comboBox3.Text+ "' WHERE ROllNo = '"
                +textBox1.Text+"'";

                ExcSQL pv = new ExcSQL(1,TheCommand);
            }
        }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string TheCommand="";
            if(textBox1.Text=="" || textBox2.Text=="" || comboBox1.SelectedIndex<0 )
            {
                MessageBox.Show("All fields must be filled!!!");
            }
            else
            {
                TheCommand = " IF EXISTS (SELECT * FROM Class WHERE ClassCode='" + textBox1.Text+"') "
                            +"SELECT ClassCode From Class where ClassCode='" + textBox1.Text+"'"
                            +" ELSE INSERT INTO Class(ClassCode,Batch,Major) Values "+
                   "('" + textBox1.Text +
                    "'," + "'" + textBox2.Text + "','" + comboBox1.SelectedItem.ToString()+"')";

                ExcSQL pv = new ExcSQL(4,TheCommand);
            }
        }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            string TheCommand = "";
            if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.SelectedIndex < 0 || comboBox2.SelectedIndex < 0)
            {
                MessageBox.Show("All fields must be filled!!!");
            }
            else
            {
                TheCommand = " IF EXISTS (SELECT * FROM Class WHERE Student='" + textBox1.Text+"') "
                            +"SELECT RollNo From Class where RollNo='" + textBox1.Text+"'"
                    +" ELSE INSERT INTO Student(RollNo,ClassCode,FullName,Nationality) Values " +
                   "('" + textBox1.Text +  "','" + comboBox2.SelectedItem.ToString() +
                    "'," + "'" + textBox2.Text + "','" + comboBox1.SelectedItem.ToString() + "')";

                ExcSQL pv = new ExcSQL(4,TheCommand);
            }
        }