示例#1
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            try
            {
                WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
                WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
                DataSet Devuelve = new DataSet();
                String  ndoc     = "";
                String  tipodoc  = "";

                GridRangeInfoList range = GGCPersOsl.TableControl.Selections.GetSelectedRows(true, true);
                foreach (GridRangeInfo info in range)
                {
                    Element el = this.GGCPersOsl.TableModel.GetDisplayElementAt(info.Top);

                    ndoc    = el.GetRecord().GetValue("NDoc").ToString();
                    tipodoc = el.GetRecord().GetValue("idtipodoc").ToString();
                }


                Devuelve = WSLic.InscribePersonalOs(mdlGenerales.Conexion, lblIDooss.Text, lblIDSelOs.Text.ToString(), txtNroDocumento.Text.ToString(), txtContacto.Text.ToString(), mdlGenerales.STRUsuario, ndoc, tipodoc, lblIDCargo.Text.ToString(), lblDireccion.Text.ToString(), lblProveedor.Text.ToString());
                DataTable DTSuccess = new DataTable();
                DTSuccess = Devuelve.Tables[0];
                Int32  codigo  = 0;
                String mensaje = "";
                foreach (DataRow row in DTSuccess.Rows)
                {
                    codigo  = Convert.ToInt32(row[0].ToString());
                    mensaje = row[1].ToString();
                }
                if (codigo != 0)
                {
                    MessageBoxAdv.Show(mensaje, "Informacion" + codigo, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtNroDocumento.Focus();
                }
                else
                {
                    MessageBoxAdv.Show(mensaje, "Error" + codigo, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                txtCargo.Text       = "";
                lblIDCargo.Text     = "0";
                lblIDSelOs.Text     = "0";
                lblCorrelativo.Text = codigo.ToString();
                lblIDooss.Text      = codigo.ToString();
                CargaGrid();
                CargaGridOs();
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show("Asegurese de seleccionar un item", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            txtCargo.Text = "";
        }