Пример #1
0
        private void cmdActualizaSoloDatos_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID         = new DataSet();
            DataTable DTDevuelveID         = new DataTable();
            DataSet   DSDevuelveValidacion = new DataSet();
            DataTable DTDevuelveValidacion = new DataTable();
            String    strResultado         = "";
            Int32     intResultado         = 0;

            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";

            string Item = "";

            if (lblItem.Text.ToString() == ("0"))
            {
                Item = "0";
            }
            else
            {
                Item = lblItem.Text.ToString();
            }
            if (Item == "0")
            {
                MessageBoxAdv.Show("Debe de seleccionar la experiencia a modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (dtpInicio.Value > dtpFin.Value)
            {
                MessageBoxAdv.Show("La fecha de Inicio no puede ser mayor que la fecha de fin de la experiencia", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtpInicio.Focus();
                return;
            }
            if (txtComentario.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el comentario de la experiencia", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtComentario.Focus();
                return;
            }
            if (txtRubro.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el rubro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRubro.Focus();
                return;
            }
            if (txtCliente.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el cliente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCliente.Focus();
                return;
            }
            if (lblIDCargo.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar un cargo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCargo.Focus();
                return;
            }
            DSDevuelveID = WSLic.ActualizaPersonalLicExperienciaSoloDatos(mdlGenerales.Conexion,
                                                                          txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), lblItem.Text,
                                                                          lblIDCargo.Text.ToString(), txtRubro.Text.ToString(), txtCliente.Text.ToString(),
                                                                          txtComentario.Text.ToString(), dtpInicio.Value.ToString("yyyy/MM/dd"),
                                                                          dtpFin.Value.ToString("yyyy/MM/dd"), mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            foreach (DataRow Row in DTDevuelveID.Rows)
            {
                intResultado = Convert.ToInt32(Row[0].ToString());
                strResultado = Row[1].ToString();
            }
            if (intResultado != 0)
            {
                MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Limpiar();
                CargaGrid(txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), txtNombres.Text.ToString(),
                          txtApellidos.Text.ToString(), txtTelefono1.Text.ToString(), txtEmail.Text.ToString());
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }