/** * Author | Arcelia Aguirre * Description | Inicializar el form * Date | 23-02-2018 * Parameters | object sender, EventArgs e */ private void frm_signIn_Load(object sender, EventArgs e) { TypeUser typeUser = new TypeUser(); TypeNotStudent typeNotStudent = new TypeNotStudent(); Career career = new Career(); UserCICE userCICE = new UserCICE(); Student.Student student = new Student.Student(); try { /*Combobox*/ typeUser.load_cmbbxTypeUser(ds, cmbbx_typeUser); typeNotStudent.load_cmbbxReport(ds, cmbbx_report); typeNotStudent.load_cmbbxReport(ds, cmbbx_type); typeNotStudent.load_cmbbxReport(ds, cmbbx_typeRegister); career.load_cmbbxCarrer(ds, cmbbx_carrer); career.load_cmbbxCarrer(ds, cmbbox_careerStudent); DataTable dt = cmbbx_typeRegister.DataSource as DataTable; DataRow row = dt.NewRow(); row["description_typeNotStudent"] = "Alumno"; dt.Rows.Add(row); cmbbx_typeRegister.SelectedIndex = cmbbx_typeRegister.Items.Count - 1; /*Grid*/ career.load_dtgdCareer(ds, dtgd_career); typeNotStudent.load_dtgdTypeNotStudent(ds, dtgd_typeNotStudent); typeUser.load_dtgdTypeUser(ds, dtgd_typeUser); userCICE.load_dtgdUser(ds, dtgd_user); student.load_dtgdStudent(ds, dtgd_student); /*DataBase*/ DataBaseSettings dataBaseSettings = new DataBaseSettings(); btn_create.Enabled = dataBaseSettings.ifExist().Rows.Count == 0 ? true : false; btn_drop.Enabled = !btn_create.Enabled; } catch { Button[] component = { btn_create, btn_drop, btn_seeder, btn_delete, btn_deleteDuplicate }; PROPS.enableButton(component); //PROPS.messageError(""); } }
/** * Author | Arcelia Aguirre * Description | Agregar un tipo de no estudiante * Date | 23-02-2018 * Parameters | object sender, EventArgs e */ private void btn_typeNotStudentSave_Click(object sender, EventArgs e) { TextBox[] component = { txt_typeNotStudentName }; TypeNotStudent typeNotStudent = new TypeNotStudent(); if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX)) { return; } component = new TextBox[] { txt_idTypeNotStudent, txt_typeNotStudentName }; if (txt_idTypeNotStudent.Text == PROPS.EMPTY) { typeNotStudent.save(txt_typeNotStudentName.Text); } else { typeNotStudent.update(Int32.Parse(txt_idTypeNotStudent.Text), txt_typeNotStudentName.Text); } PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX); typeNotStudent.load_dtgdTypeNotStudent(ds, dtgd_typeNotStudent); }
/** * Author | Arcelia Aguirre * Description | Datos para eliminar y modificar typos de no estudiantes * Date | 27-02-2018 * Parameters | object sender, DataGridViewCellEventArgs e */ private void dtgd_typeNotStudent_CellContentClick(object sender, DataGridViewCellEventArgs e) { TextBox[] component = { txt_idTypeNotStudent, txt_typeNotStudentName }; TypeNotStudent typeNotStudent = new TypeNotStudent(); PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX); if (this.dtgd_typeNotStudent.Columns[e.ColumnIndex].Name.Equals("delete_userNotStudent")) { if (MessageBox.Show("¿Seguro que quieres borrar el Tipo de No Estudiate?", "Borrar", MessageBoxButtons.YesNo) == DialogResult.Yes) { typeNotStudent.delete(Int32.Parse(dtgd_typeNotStudent.CurrentRow.Cells["id_typeNotStudent"].Value.ToString())); } typeNotStudent.load_dtgdTypeNotStudent(ds, dtgd_typeNotStudent); return; } else if (this.dtgd_typeNotStudent.Columns[e.ColumnIndex].Name.Equals("edit_typeNotStudent")) { txt_idTypeNotStudent.Text = dtgd_typeNotStudent.CurrentRow.Cells["id_typeNotStudent"].Value.ToString(); txt_typeNotStudentName.Text = dtgd_typeNotStudent.CurrentRow.Cells["description_typeNotStudent"].Value.ToString(); } }