示例#1
0
        private void cmdModificar_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";

            if (txtNombres.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el nombre del contacto", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtNombres.Focus();
                return;
            }

            if (txtTelefono1.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el telefono 1", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtTelefono1.Focus();
                return;
            }


            string Item = "";

            if (lblItem.Text.ToString() == ("0"))
            {
                Item = "0";
            }
            else
            {
                Item = lblItem.Text.ToString();
            }

            DSDevuelveID = WSLic.ActualizaContactosEmpresa(mdlGenerales.Conexion,
                                                           txtNumeroRuc.Text.ToString(), lblItem.Text.ToString(),
                                                           txtNombres.Text.ToString(), txtTelefono1.Text.ToString(),
                                                           txtTelefono2.Text.ToString(), txtMail.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);
            }
        }