コード例 #1
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            //try
            {
                ArrayList SIDTipo    = new ArrayList();
                ArrayList SNDoc      = new ArrayList();
                ArrayList SApellidos = new ArrayList();
                ArrayList SNombres   = new ArrayList();
                ArrayList SDireccion = new ArrayList();
                ArrayList Stelefono  = new ArrayList();
                ArrayList SIDCargo   = new ArrayList();
                ArrayList SIDEstado  = new ArrayList();
                WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
                for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
                {
                    if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
                    {
                        SIDTipo.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("idtipodoc").ToString()));
                        SNDoc.Add(GGCVista.Table.Records[Index].GetValue("NDoc").ToString());
                        SApellidos.Add(GGCVista.Table.Records[Index].GetValue("Apellidos").ToString());
                        SNombres.Add(GGCVista.Table.Records[Index].GetValue("Nombre").ToString());
                        SDireccion.Add(GGCVista.Table.Records[Index].GetValue("Direccion").ToString());
                        Stelefono.Add(GGCVista.Table.Records[Index].GetValue("Telefono").ToString());
                        SIDCargo.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("IDCargo").ToString()));
                        SIDEstado.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("IDEstado").ToString()));
                    }
                }
                WSMAnt.ActualizaPersonal(mdlGenerales.Conexion, SIDTipo.ToArray(),
                                         SNDoc.ToArray(), SApellidos.ToArray(),
                                         SNombres.ToArray(), SDireccion.ToArray(),
                                         Stelefono.ToArray(), SIDEstado.ToArray(),
                                         SIDCargo.ToArray());
                MessageBoxAdv.Show("Personal actualizado", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CargaGrid();
            }

            /*catch (Exception E)
             * {
             *  MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
             * }*/
        }
コード例 #2
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList SIDTipo    = new ArrayList();
            ArrayList SNDoc      = new ArrayList();
            ArrayList SApellidos = new ArrayList();
            ArrayList SNombres   = new ArrayList();
            ArrayList SDireccion = new ArrayList();
            ArrayList Stelefono  = new ArrayList();
            ArrayList SIDCargo   = new ArrayList();
            ArrayList SIDEstado  = new ArrayList();

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";

            SIDTipo.Add(IDTipo[Convert.ToInt32(cmbTipo.SelectedIndex.ToString())].ToString());
            SNDoc.Add(txtNDoc.Text.ToString());
            SApellidos.Add(txtApellidos.Text.ToString());
            SNombres.Add(txtNombres.Text.ToString());
            SDireccion.Add(txtDireccion.Text.ToString());
            Stelefono.Add(txtTelefono.Text.ToString());
            SIDCargo.Add(IDCargo[Convert.ToInt32(cmbCargo.SelectedIndex.ToString())].ToString());
            SIDEstado.Add(IDEstado[Convert.ToInt32(cmbCondicion.SelectedIndex.ToString())].ToString());

            WSMAnt.ActualizaPersonal(mdlGenerales.Conexion, SIDTipo.ToArray(), SNDoc.ToArray(), SApellidos.ToArray(),
                                     SNombres.ToArray(), SDireccion.ToArray(), Stelefono.ToArray(), SIDEstado.ToArray(),
                                     SIDCargo.ToArray());

            cmbTipo.SelectedIndex      = 0;
            txtNDoc.Text               = "";
            txtApellidos.Text          = "";
            txtNombres.Text            = "";
            txtDireccion.Text          = "";
            txtTelefono.Text           = "";
            cmbCondicion.SelectedIndex = 0;
            cmbCargo.SelectedIndex     = 0;
            MessageBoxAdv.Show("El personal fue añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }