private void btnDelete_Click(object sender, EventArgs e) { // MessageBox.Show("Are you sure you want to delete ?","",) // want to pop up message before delete DAL.StudentEducation stEdu = new DAL.StudentEducation(); //stEdu.Id = selectedRowId; if (stEdu.Delete()) { MessageBox.Show("Recored successfully deleted !"); } else { MessageBox.Show(stEdu.Error); } }
public frmStudentEducationEdit(int id) { InitializeComponent(); DAL.StudentEducation studentEducation = new DAL.StudentEducation(); if (studentEducation.SelectById()) { txtStudentId.Text = studentEducation.StudentId.ToString(); txtEducationId.Text = studentEducation.EducationId.ToString(); txtEducationBoardId.Text = studentEducation.EducationBoardId.ToString(); txtRegistration.Text = studentEducation.Registration; txtResult.Text = studentEducation.Result; txtRoll.Text = studentEducation.Roll; txtRoll.Text = studentEducation.Remarks; } }
private void btnSearch_Click(object sender, EventArgs e) { DAL.StudentEducation stEdu = new DAL.StudentEducation(); stEdu.Search = txtSearch.Text; if (cmbEducation.SelectedValue != null && cmbEducation.SelectedValue.ToString() != "") { stEdu.EducationId = Convert.ToInt32(cmbEducation.SelectedValue); } if (cmbStudent.SelectedValue != null && cmbStudent.SelectedValue.ToString() != "") { stEdu.StudentId = Convert.ToInt32(cmbStudent.SelectedValue); } if (cmbEducationBoard.SelectedValue != null && cmbEducationBoard.SelectedValue.ToString() != "") { stEdu.EducationBoardId = Convert.ToInt32(cmbEducationBoard.SelectedValue); } dgbStudentEducation.DataSource = stEdu.Select().Tables[0]; }
private void dgbStudentEducation_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { // MessageBox.Show(e.RowIndex.ToString() + ", " + e.ColumnIndex.ToString()); if (e.ColumnIndex == 10) { DAL.StudentEducation se = new DAL.StudentEducation(); se.StudentId = Convert.ToInt32(dgbStudentEducation.Rows[e.RowIndex].Cells["colStudentId"].Value); se.EducationId = Convert.ToInt32(dgbStudentEducation.Rows[e.RowIndex].Cells["colEducationId"].Value);; if (se.SelectById()) { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.ShowDialog(); Hypertag.Advising.filImage.FileFromByte(se.Document, fbd.SelectedPath + "/" + se.fileName); MessageBox.Show("Downloaded"); } else { MessageBox.Show("Vul Shobi Vul"); } } }
private void btnSubmit_Click(object sender, EventArgs e) { int er = 0; ep.Clear(); //if(cmbStudent.Text == "") //{ // er++; // ep.SetError(txtStudentId, "Requered"); //} //if (txtEducationId.Text == "") //{ // er++; // ep.SetError(txtEducationId, "Requered"); //} //if (txtEducationBoardId.Text == "") //{ // er++; // ep.SetError(txtEducationBoardId, "Requered"); //} if (txtYear.Text == "") { er++; ep.SetError(txtYear, "Requered"); } if (txtRegistration.Text == "") { er++; ep.SetError(txtRegistration, "Requered"); } if (txtRoll.Text == "") { er++; ep.SetError(txtRoll, "Requered"); } if (er > 0) { return; } DAL.StudentEducation studentEducation = new DAL.StudentEducation(); studentEducation.StudentId = Convert.ToInt32(cmbStudent.SelectedValue); studentEducation.EducationId = Convert.ToInt32(cmbEducation.SelectedValue); studentEducation.EducationBoardId = Convert.ToInt32(cmbEducationBoard.SelectedValue); studentEducation.Year = Convert.ToInt32(txtYear.Text); studentEducation.Registration = txtRegistration.Text; studentEducation.Roll = txtRoll.Text; studentEducation.Remarks = txtRemarks.Text; studentEducation.Result = txtResult.Text; studentEducation.DocumentType = cmbDocumentType.Text; studentEducation.Document = Hypertag.Advising.filImage.FileToByte(txtDocument.Text); studentEducation.fileName = System.IO.Path.GetFileName(txtDocument.Text); // document here if (studentEducation.Insert()) { MessageBox.Show("Recored successfully Inserted !"); //reset er code hobe } else { MessageBox.Show(studentEducation.Error); } }
private void btnSubmit_Click(object sender, EventArgs e) { int er = 0; ep.Clear(); if (txtStudentId.Text == "") { er++; ep.SetError(txtStudentId, "Requered"); } if (txtEducationId.Text == "") { er++; ep.SetError(txtEducationId, "Requered"); } if (txtEducationBoardId.Text == "") { er++; ep.SetError(txtEducationBoardId, "Requered"); } if (txtYear.Text == "") { er++; ep.SetError(txtYear, "Requered"); } if (txtRegistration.Text == "") { er++; ep.SetError(txtRegistration, "Requered"); } if (txtRoll.Text == "") { er++; ep.SetError(txtRoll, "Requered"); } if (er > 0) { return; } DAL.StudentEducation studentEducation = new DAL.StudentEducation(); studentEducation.StudentId = Convert.ToInt32(txtStudentId.Text); studentEducation.EducationId = Convert.ToInt32(txtEducationId.Text); studentEducation.EducationBoardId = Convert.ToInt32(txtEducationBoardId.Text); studentEducation.Registration = txtRegistration.Text; studentEducation.Roll = txtRoll.Text; studentEducation.Remarks = txtRemarks.Text; studentEducation.Year = Convert.ToInt32(txtYear.Text); //studentEducation.Document = btnDocument.Text; studentEducation.DocumentType = txtDocument.Text; if (studentEducation.Update()) { MessageBox.Show("Recored successfully updated !"); frmStudentEducation stEdu = new frmStudentEducation(); stEdu.btnLoad_Click(null, null); } else { MessageBox.Show(studentEducation.Error); } }