예제 #1
0
        /**
         *  Author      | Arcelia Aguirre
         *  Description | Agregar un usuario
         *  Date        | 23-02-2018
         *  Parameters  | object sender, EventArgs e
         */
        private void btn_userSave_Click(object sender, EventArgs e)
        {
            TextBox[]  component = { txt_nameUser, txt_passwordUser, txt_fatherLastnameUser };
            ComboBox[] comboBox  = { cmbbx_typeUser };
            UserCICE   userCICE  = new UserCICE();

            if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
            {
                return;
            }
            if (!PROPS.emptyComponent(comboBox, (int)PROPS.COMPONENT.COMPONENT_COMBO_BOX))
            {
                return;
            }
            component = new TextBox[] { txt_idUser, txt_nameUser, txt_passwordUser, txt_fatherLastnameUser, txt_motherLastnameUser };
            if (txt_idUser.Text == PROPS.EMPTY)
            {
                userCICE.save(txt_nameUser.Text, txt_passwordUser.Text, txt_fatherLastnameUser.Text, txt_motherLastnameUser.Text, Int32.Parse(cmbbx_typeUser.SelectedValue.ToString()));
            }
            else
            {
                userCICE.update(Int32.Parse(txt_idUser.Text), txt_nameUser.Text, txt_passwordUser.Text, PROPS.EMPTY, txt_fatherLastnameUser.Text, txt_motherLastnameUser.Text, Int32.Parse(cmbbx_typeUser.SelectedValue.ToString()));
            }
            PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX);
            PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_COMBO_BOX);
            userCICE.load_dtgdUser(ds, dtgd_user);
        }
예제 #2
0
        /**
         *  Author      | Arcelia Aguirre
         *  Date        | 09-03-2018
         *  Description | Funcion al iniciar sesion
         */
        private void Login()
        {
            DataTable dt       = new DataTable();
            UserCICE  userCICE = new UserCICE();

            /*Validación*/
            TextBox[] component = { txt_name, txt_password };
            if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
            {
                return;
            }

            //dt =  userCICE.login(txt_name.Text, txt_password.Text);
            //if (dt != null)
            //{
            //    if (dt.Rows.Count == 0)
            //        MessageBox.Show("Usuario o Password Incorrectos");
            //    else
            //    {
            //        frm_signIn frm_checkIn = new frm_signIn();
            //        frm_checkIn.Show();
            //    }
            //}
            /*Quitar*/
            frm_signIn frm_checkIn2 = new frm_signIn();

            frm_checkIn2.Show();
        }
예제 #3
0
 /**
  *  Author      | Arcelia Aguirre
  *  Date        | 19-04-2018
  *  Description | Limpiar campos de carga por archivo
  *  Parameteres | object sender, KeyEventArgs e
  */
 private void btn_cancelLoad_Click(object sender, EventArgs e)
 {
     TextBox[]  component = { txt_file };
     ComboBox[] comboBox  = { cmbbx_type };
     if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
     {
         return;
     }
     PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX);
     PROPS.clear(comboBox, (int)PROPS.COMPONENT.COMPONENT_COMBO_BOX);
 }
예제 #4
0
 /**
  *  Author      | Juan Pablo Espinoza
  *  Description | Agregar un estudiante
  *  Date        | 08-03-2018
  *  Parameters  | object sender, EventArgs e
  */
 private void btn_add_Click(object sender, EventArgs e)
 {
     TextBox[]  component = { txt_numberStudent, txt_nameStudent, txt_fatherLasnameStudent, txt_semesterStudent };
     ComboBox[] comboBox  = { cmbbx_typeRegister, cmbbox_careerStudent };
     if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
     {
         return;
     }
     if (!PROPS.emptyComponent(comboBox, (int)PROPS.COMPONENT.COMPONENT_COMBO_BOX))
     {
         return;
     }
     component = new TextBox[] { txt_idStudent, txt_numberStudent, txt_nameStudent, txt_fatherLasnameStudent, txt_motherLasnameStudent, txt_semesterStudent };
     if (cmbbx_typeRegister.Items.Count != cmbbx_typeRegister.SelectedIndex + 1 && cmbbx_typeRegister.SelectedValue is int)
     {
         NotStudent notStudent = new NotStudent();
         if (txt_idStudent.Text == PROPS.EMPTY)
         {
             notStudent.save(txt_numberStudent.Text, txt_nameStudent.Text, txt_fatherLasnameStudent.Text, txt_motherLasnameStudent.Text, Int32.Parse(cmbbx_typeRegister.SelectedValue.ToString()));
         }
         else
         {
             notStudent.update(Int32.Parse(txt_idStudent.Text), txt_numberStudent.Text, txt_nameStudent.Text, txt_fatherLasnameStudent.Text, txt_motherLasnameStudent.Text, Int32.Parse(cmbbx_typeRegister.SelectedValue.ToString()));
         }
         notStudent.load_dtgdStudent(ds, dtgd_student, cmbbx_typeRegister);
     }
     else
     {
         Student.Student student = new Student.Student();
         if (txt_idStudent.Text == PROPS.EMPTY)
         {
             student.save(txt_numberStudent.Text, txt_nameStudent.Text, txt_fatherLasnameStudent.Text, txt_motherLasnameStudent.Text, txt_semesterStudent.Text, Int32.Parse(cmbbox_careerStudent.SelectedValue.ToString()));
         }
         else
         {
             student.update(Int32.Parse(txt_idStudent.Text), txt_numberStudent.Text, txt_nameStudent.Text, txt_fatherLasnameStudent.Text, txt_motherLasnameStudent.Text, txt_semesterStudent.Text, Int32.Parse(cmbbox_careerStudent.SelectedValue.ToString()));
         }
         student.load_dtgdStudent(ds, dtgd_student);
     }
     PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX);
     PROPS.clear(comboBox, (int)PROPS.COMPONENT.COMPONENT_COMBO_BOX);
 }
예제 #5
0
        /**
         *  Author      | Arcelia Aguirre
         *  Description | Agregar nuevo tipo usuario
         *  Date        | 23-02-2018
         *  Parameters  | object sender, EventArgs e
         */
        private void btn_typeUserSave_Click(object sender, EventArgs e)
        {
            TextBox[] component = { txt_typeUserName };
            TypeUser  typeUser  = new TypeUser();

            if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
            {
                return;
            }
            component = new TextBox[] { txt_idTypeUser, txt_typeUserName };
            if (txt_idTypeUser.Text == PROPS.EMPTY)
            {
                typeUser.save(txt_typeUserName.Text);
            }
            else
            {
                typeUser.update(Int32.Parse(txt_idTypeUser.Text), txt_typeUserName.Text);
            }
            PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX);
            typeUser.load_dtgdTypeUser(ds, dtgd_typeUser);
        }
예제 #6
0
        /**
         *  Author      | Arcelia Aguirre
         *  Description | Agregar una carrera
         *  Date        | 27-02-2018
         *  Parameters  | object sender, EventArgs e
         */
        private void btn_careerSave_Click(object sender, EventArgs e)
        {
            TextBox[] component = { txt_careerName, txt_careerKey };
            Career    career    = new Career();

            if (!PROPS.emptyComponent(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX))
            {
                return;
            }

            component = new TextBox[] { txt_idCareer, txt_careerName, txt_careerKey };
            if (txt_idCareer.Text == PROPS.EMPTY)
            {
                career.save(txt_careerName.Text, txt_careerKey.Text);
            }
            else
            {
                career.update(Int32.Parse(txt_idCareer.Text), txt_careerName.Text, txt_careerKey.Text);
            }
            PROPS.clear(component, (int)PROPS.COMPONENT.COMPONENT_TEXT_BOX);
            career.load_dtgdCareer(ds, dtgd_career);
        }