public int returnRollNumber() { QueriesClass qc = new QueriesClass(); string strSQL = "SELECT MAX(registrationNo) as 'LastID' FROM studentDetails"; return(qc.GetLastID(strSQL)); }
public string methodForId() { QueriesClass qc = new QueriesClass(); string strsql = "select max(ID) as 'lastid' from studentFee"; return(qc.GetLastID(strsql).ToString()); }
private void addingNewBook_Load(object sender, EventArgs e) { textBox1.Enabled = false; dataGridView1.DataSource = goFill().Tables[0]; qc = new QueriesClass(); string strSQL = "SELECT MAX(serialNo) as 'LastID' FROM addingBooks"; textBox1.Text = qc.GetLastID(strSQL).ToString(); radioLoad rl = new radioLoad(); comboBox1.DataSource = rl.mydt("select * from shelvesLibrary"); comboBox1.DisplayMember = "titleShelves"; comboBox1.ValueMember = "ID"; }
private void employeeBox_Load(object sender, EventArgs e) { qc = new QueriesClass(); string strSQL = "SELECT MAX(Id) as 'LastID' FROM employeeBoxData"; textBox1.Text = qc.GetLastID(strSQL).ToString(); radioLoad rad = new radioLoad(); comboBox1.DataSource = rad.mydt("select * from workCategories"); comboBox1.DisplayMember = "title"; comboBox1.ValueMember = "ID"; comboBox2.DataSource = rad.mydt("select * from payScales"); comboBox2.DisplayMember = "gradeNo"; comboBox2.ValueMember = "ID"; }
private void addmisionDepart_Load(object sender, EventArgs e) { textBox1.Enabled = false; textBox3.Enabled = false; qc = new QueriesClass(); textBox1.Text = qc.returnRollNumber().ToString(); rad = new radioLoad(); aq = new AdmissionQueries(); textBox3.Text = aq.limitSeats(); comboBox1.DataSource = rad.mydt("select * from categoriesFields"); comboBox1.DisplayMember = "title"; comboBox1.ValueMember = "ID"; comboBox4.DataSource = rad.mydt("select * from bloodGroups"); comboBox4.DisplayMember = "title"; comboBox4.ValueMember = "ID"; }
private void button1_Click(object sender, EventArgs e) { try { qc = new QueriesClass(); qc.employeeID = Convert.ToInt32(textBox1.Text); qc.workAs = comboBox1.Text; qc.salaryPM = Convert.ToInt32(comboBox2.Text); qc.passwords = textBox3.Text; qc.emmployeeBox(); MessageBox.Show("New Employee has been Hired !!"); this.Hide(); } catch (FormatException) { throw; } }
private void button3_Click(object sender, EventArgs e) { qc = new QueriesClass(); textBox3.Text = qc.CreatePassword(); }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != "" || textBox2.Text != "" || textBox3.Text != "" || textBox4.Text != "" || textBox5.Text != "") { ad = new QueriesClass(); radioLoad rl = new radioLoad(); if (radioButton4.Checked) { gender = "Male"; } else if (radioButton5.Checked) { gender = "Female"; } if (radioButton6.Checked) { mess = "Yes"; } else if (radioButton7.Checked) { mess = "No"; } ad.FirstName = textBox1.Text; ad.LastName = textBox2.Text; ad.FatherName = textBox3.Text; ad.Cnic = textBox4.Text; ad.Gender = gender; ad.PhoneNumber = textBox5.Text; ad.Qualification = comboBox1.Text; ad.EmailAddress = textBox6.Text; ad.Address = richTextBox1.Text; ad.Categories = comboBox2.Text; ad.Subject = comboBox3.Text; ad.payScl = Convert.ToInt32(comboBox4.Text); ad.DocumentCheck = mess; textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); textBox8.Clear(); richTextBox1.Clear(); if (radioButton1.Checked) { rl.radioCheck = "Employee"; ad.employeeRegistration(); } else if (radioButton2.Checked) { rl.radioCheck = "Faculty"; ad.facultyRegistration(); MessageBox.Show("New Faculty Member Hired!"); } rl.check(); } else { MessageBox.Show("Enter all values!!", "Alert!!"); } }
private void button1_Click(object sender, EventArgs e) { aq = new AdmissionQueries(); AdmissionQueries ad = new AdmissionQueries(); qc = new QueriesClass(); if (radioButton1.Checked) { myGender = "Male"; } else if (radioButton2.Checked) { myGender = "Female"; } try { if (aq.limitSeats() != "Admission Closed") { ad.Rno = Convert.ToInt32(textBox1.Text); ad.admissionDate = dateTimePicker1.Value; ad.firstName = textBox4.Text; ad.lastName = textBox5.Text; ad.dateBirth = dateTimePicker2.Value; ad.gender = myGender; ad.fatherName = textBox6.Text; ad.status = comboBox3.Text; ad.fatheOccupation = textBox7.Text; ad.income = Convert.ToInt32(textBox8.Text); ad.nationality = textBox9.Text; ad.blood = comboBox4.Text; ad.religion = comboBox5.Text; ad.field = comboBox1.Text; ad.year = comboBox2.Text; ad.section = textBox3.Text; ad.phoneNumber = textBox2.Text; ad.address = richTextBox1.Text; ad.parcentage = Convert.ToInt32(textBox10.Text); ad.insertStudent(); ad.insertRollSection(); qc.returnRollNumber(); textBox3.Text = aq.limitSeats(); textBox1.Text = qc.returnRollNumber().ToString(); } else { MessageBox.Show("Registration Closed!!", "Admission Alert!!"); } } catch (FormatException) { MessageBox.Show("Enter All values!!"); } textBox2.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); textBox7.Clear(); textBox8.Clear(); textBox9.Clear(); textBox10.Clear(); }