Пример #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 certificación a modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (txtCertificacion.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el detalle de la certificación", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCertificacion.Focus();
                return;
            }

            if (txtEntidad.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar la entidad certificadora", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEntidad.Focus();
                return;
            }

            DSDevuelveID = WSLic.ActualizaCertificacionesEmpresadatos(mdlGenerales.Conexion,
                                                                      txtNumeroRuc.Text.ToString(), lblItem.Text.ToString(),
                                                                      txtCertificacion.Text.ToString(), dtpVencimiento.Value.ToString("yyyy/MM/dd"),
                                                                      txtEntidad.Text.ToString(), 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(txtNumeroRuc.Text.ToString(), txtRazonSocial.Text.ToString(),
                          txtNRP.Text.ToString(), txtCapacidad.Text.ToString());
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }