Ejemplo n.º 1
0
        private void miEliminar_Click(object sender, EventArgs e)
        {
            Element el = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv                     = (el as Record).GetData() as DataRowView;
                    DataSet     DSDevuelveID            = new DataSet();
                    DataTable   DTDevuelveID            = new DataTable();
                    WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
                    WSLic.Url    = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
                    DSDevuelveID = WSLic.EliminacertificacionLicExperiencia(mdlGenerales.Conexion,
                                                                            txtNumeroRuc.Text.ToString(), drv[1].ToString(),
                                                                            drv[3].ToString(), drv[5].ToString(),
                                                                            mdlGenerales.STRUsuario);

                    /*if (drv[2].ToString() == "SI")
                    *   DeleteFile(drv[6].ToString());*/
                    CargaGrid(txtNumeroRuc.Text.ToString(), txtRazonSocial.Text.ToString(),
                              txtNRP.Text.ToString(), txtCapacidad.Text.ToString());
                    MessageBoxAdv.Show("Se elimino la certificación seleccionado", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 2
0
        private void eliminarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBoxAdv.Show("Desea eliminar esta orden de servicio?", "Eliminar OS", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                try
                {
                    String correlativo = "";

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

                        correlativo = el.GetRecord().GetValue("Correlativo").ToString();
                    }
                    WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
                    WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
                    DataSet b = WSLic.EliminaOrdenServicio(mdlGenerales.Conexion, correlativo);

                    if (b.Tables[0].Rows.Count > 0)
                    {
                        MessageBoxAdv.Show("Se ha eliminado la orden de servicio", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBoxAdv.Show("No se pudo eliminar el item", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    MessageBoxAdv.Show("Debes seleccionar un item#", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                CargarGrid();
            }
        }
Ejemplo n.º 3
0
        public void CargaGrid(String NumeroRuc, String RazonSocial, String NRP, String Capacidad)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();

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

            txtNumeroRuc.Text   = NumeroRuc;
            txtRazonSocial.Text = RazonSocial;
            txtNRP.Text         = NRP;
            txtCapacidad.Text   = Capacidad;


            DSDevuelve            = WSLic.DevuelveCertificacionesEmpresa(mdlGenerales.Conexion, txtNumeroRuc.Text.ToString());
            DTMain                = DSDevuelve.Tables[0];
            DVMain                = DTMain.DefaultView;
            GGCPersLiq.DataSource = null;
            GGCPersLiq.TableDescriptor.Reset();
            GGCPersLiq.TableDescriptor.AllowNew = false;
            GGCPersLiq.Refresh();
            GGCPersLiq.DataSource = DVMain;
            FormatColumnas();
            AplicarFilterBar();
        }
Ejemplo n.º 4
0
        public void CargaGrid(String TipoDoc, String NDoc, String Nombres, String Apellidos, String Telefono1, String Email)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();

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

            txtTipoDoc.Text       = TipoDoc;
            txtNDoc.Text          = NDoc;
            txtNombres.Text       = Nombres;
            txtApellidos.Text     = Apellidos;
            txtTelefono1.Text     = Telefono1;
            txtEmail.Text         = Email;
            DSDevuelve            = WSLic.DevuelveExpPersonalLicitaciones(mdlGenerales.Conexion, txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString());
            DTMain                = DSDevuelve.Tables[0];
            DVMain                = DTMain.DefaultView;
            GGCPersLiq.DataSource = null;
            GGCPersLiq.TableDescriptor.Reset();
            GGCPersLiq.TableDescriptor.AllowNew = false;
            GGCPersLiq.Refresh();
            GGCPersLiq.DataSource = DVMain;
            FormatColumnas();
            AplicarFilterBar();
        }
Ejemplo n.º 5
0
        private void GGCPersLiq_TableControlCurrentCellMoved(object sender, GridTableControlCurrentCellMovedEventArgs e)
        {
            Limpiar();
            MFPersExperiencia Frm = new MFPersExperiencia();
            Element           el  = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    lblItem.Text      = drv[1].ToString(); //show column 2
                    txtNombres.Text   = drv[2].ToString();
                    txtTelefono1.Text = drv[3].ToString();
                    txtTelefono2.Text = drv[4].ToString();
                    txtMail.Text      = drv[5].ToString();
                }
            }
            //bloqueo
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveAntiguedadEmpresaLic(mdlGenerales.Conexion, txtRuc);
            DTMain     = DSDevuelve.Tables[0];
            int Horas = 0;

            foreach (DataRow row in DTMain.Rows)
            {
                Horas = int.Parse(row[0].ToString());
            }
            Bloquear(Horas, mdlGenerales.STRUsuario);
        }
Ejemplo n.º 6
0
        private void miEliminar_Click(object sender, EventArgs e)
        {
            MFPersExperiencia Frm = new MFPersExperiencia();
            Element           el  = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv                     = (el as Record).GetData() as DataRowView;
                    DataSet     DSDevuelveID            = new DataSet();
                    DataTable   DTDevuelveID            = new DataTable();
                    WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
                    WSLic.Url    = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
                    DSDevuelveID = WSLic.EliminaPersonalLicExperiencia(mdlGenerales.Conexion,
                                                                       txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), drv[1].ToString(),
                                                                       drv[5].ToString(), drv[6].ToString(), mdlGenerales.STRUsuario);
                    if (drv[2].ToString() == "SI")
                    {
                        DeleteFile(drv[13].ToString());
                    }
                    CargaGrid(txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), txtNombres.Text.ToString(),
                              txtApellidos.Text.ToString(), txtTelefono1.Text.ToString(), txtEmail.Text.ToString());
                    MessageBoxAdv.Show("Se elimino la experiencia seleccionada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 7
0
        private void MFOSLicitaciones_Load(object sender, EventArgs e)
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern = "HH:mm:ss";
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongTimePattern  = "HH:mm:ss";
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            this.MdiParent = MFMdi.ActiveForm;
            this.Left      = 0;
            this.Top       = 0;

            //Para pruebas
            //lblIDooss.Text = "0";
            //lblCorrelativo.Text = "0";

            CargaAutocomplete();
            CargaGrid();
            CargaGridOs();
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url    = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelveOs = WSLic.DevuelveAntiguedadOs(mdlGenerales.Conexion, lblIDooss.Text.ToString());
            DTMainOs     = DSDevuelveOs.Tables[0];
            int Horas = 0;

            foreach (DataRow row in DTMainOs.Rows)
            {
                Horas = int.Parse(row[0].ToString());
            }

            Bloquear(Int32.Parse(lblIDooss.Text.ToString()), Horas, mdlGenerales.STRUsuario);
        }
Ejemplo n.º 8
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 = "";
        }
Ejemplo n.º 9
0
        public void CargarReporte(int id)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();

            this.Left = 0;
            this.Top  = 0;
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveRepOrden(mdlGenerales.Conexion, id.ToString());
            Report.Database.Tables[0].SetDataSource(DSDevuelve.Tables[0]);
            CRVReport.ReportSource = Report;
            CRVReport.Zoom(100);
            CRVReport.Visible = true;
        }
Ejemplo n.º 10
0
 private void CargaGrid()
 {
     WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
     WSLic.Url             = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
     DSDevuelve            = WSLic.DevuelvePersonalLicitacionesDisp(mdlGenerales.Conexion, lblIDooss.Text.ToString());
     DTMain                = DSDevuelve.Tables[0];
     DVMain                = DTMain.DefaultView;
     GGCPersLiq.DataSource = null;
     GGCPersLiq.TableDescriptor.Reset();
     GGCPersLiq.TableDescriptor.AllowNew = false;
     GGCPersLiq.Refresh();
     GGCPersLiq.DataSource = DVMain;
     FormatColumnas();
     AplicarFilterBar();
 }
Ejemplo n.º 11
0
        private void GGCPersLiq_TableControlCurrentCellMoved(object sender, GridTableControlCurrentCellMovedEventArgs e)
        {
            Limpiar();
            Element el = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    txtRuc.Text         = drv[1].ToString(); //show column 2
                    txtNRP.Text         = drv[2].ToString(); //show column 2
                    txtRazonSocial.Text = drv[3].ToString(); //show column 2
                    txtCapacidad.Text   = drv[4].ToString(); //show column 2
                    if (drv[5].ToString() != "")
                    {
                        dptFechaCreacion.Value = Convert.ToDateTime(drv[5].ToString());
                    }
                    txtDireccion.Text     = drv[10].ToString(); //show column 2
                    txtTelefono1.Text     = drv[11].ToString(); //show column 2
                    txtTelefono2.Text     = drv[12].ToString(); //show column 2
                    txtEmail.Text         = drv[13].ToString(); //show column 2
                    txtArchivo.Text       = drv[14].ToString(); //show column 2
                    txtObservaciones.Text = drv[16].ToString(); //show column 2
                    if (drv[17].ToString() == "1")
                    {
                        chkPendiente.Checked = true;
                    }
                    else
                    {
                        chkPendiente.Checked = false;
                    }
                    txtRepresentante.Text = drv[18].ToString();
                }
            }
            //bloqueo
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveAntiguedadEmpresaLic(mdlGenerales.Conexion, txtRuc.Text.ToString());
            DTMain     = DSDevuelve.Tables[0];
            int Horas = 0;

            foreach (DataRow row in DTMain.Rows)
            {
                Horas = int.Parse(row[0].ToString());
            }
            Bloquear(Horas, mdlGenerales.STRUsuario);
        }
Ejemplo n.º 12
0
 public void CargaGrid(String StrClave, String Detalle)
 {
     WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
     WSLic.Url             = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
     DSDevuelve            = WSLic.DevuelveBitacoraLicitaciones(mdlGenerales.Conexion, StrClave);
     DTMain                = DSDevuelve.Tables[0];
     DVMain                = DTMain.DefaultView;
     GGCPersLiq.DataSource = null;
     GGCPersLiq.TableDescriptor.Reset();
     GGCPersLiq.TableDescriptor.AllowNew = false;
     GGCPersLiq.Refresh();
     GGCPersLiq.DataSource = DVMain;
     FormatColumnas();
     AplicarFilterBar();
     this.Text = "Bitacora de: " + Detalle;
 }
Ejemplo n.º 13
0
        private void CargarReporte()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();

            this.MdiParent = MFMdi.ActiveForm;
            this.Left      = 0;
            this.Top       = 0;
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveRepExpLicEmpresa(mdlGenerales.Conexion);
            Report.Database.Tables[0].SetDataSource(DSDevuelve.Tables[0]);
            CRVReport.ReportSource = Report;
            CRVReport.Zoom(100);
            CRVReport.Visible = true;
        }
Ejemplo n.º 14
0
        private void cmdRetirar_Click(object sender, EventArgs e)
        {
            try
            {
                WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
                WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
                DataSet Devuelve = new DataSet();

                ArrayList numdoc  = new ArrayList();
                ArrayList idtdoc  = new ArrayList();
                ArrayList iditem  = new ArrayList();
                ArrayList idcargo = new ArrayList();

                for (Int32 Index = 0; Index <= GGCPersOsl.Table.Records.Count - 1; Index++)
                {
                    if (Convert.ToInt16(GGCPersOsl.Table.Records[Index].GetValue("Sel").ToString()) == 1)
                    {
                        numdoc.Add(GGCPersOsl.Table.Records[Index].GetValue("NDoc").ToString());
                        idtdoc.Add(GGCPersOsl.Table.Records[Index].GetValue("idtipodoc").ToString());
                        iditem.Add(GGCPersOsl.Table.Records[Index].GetValue("Item").ToString());
                        idcargo.Add(GGCPersOsl.Table.Records[Index].GetValue("idCargo").ToString());
                    }
                }

                Devuelve = WSLic.RemuevePersonalOs(mdlGenerales.Conexion, lblIDooss.Text.ToString(), iditem.ToArray(), txtNroDocumento.Text.ToString(), txtContacto.Text.ToString(), idcargo.ToArray(), numdoc.ToArray(), idtdoc.ToArray(), mdlGenerales.STRUsuario);
                DataTable DTSuccess = new DataTable();
                int       codigo    = 0;
                String    mensaje   = "";
                DTSuccess = Devuelve.Tables[0];
                foreach (DataRow row in DTSuccess.Rows)
                {
                    codigo  = Convert.ToInt32(row[0].ToString());
                    mensaje = row[1].ToString();
                }
                MessageBoxAdv.Show(mensaje, "Informacion" + codigo, MessageBoxButtons.OK, MessageBoxIcon.Information);
                lblIDSelOs.Text = "0";
                txtCargo.Text   = "";
                lblIDCargo.Text = "0";
                CargaGrid();
                CargaGridOs();
            }
            catch (Exception ee)
            {
                MessageBoxAdv.Show("Porfavor seleccione uno o mas elementos.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 15
0
        private void CargarGrid()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();

            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveOs(mdlGenerales.Conexion,
                                          dtpMes.Value.Month.ToString(), dtpMes.Value.Year.ToString());
            DTMain = DSDevuelve.Tables[0];
            DVMain = DTMain.DefaultView;
            GGCOrdenes.DataSource = null;
            GGCOrdenes.TableDescriptor.Reset();
            GGCOrdenes.TableDescriptor.AllowNew = false;
            GGCOrdenes.Refresh();
            GGCOrdenes.DataSource = DVMain;
            FormatColumnas();
            AplicarFilterBar();
        }
Ejemplo n.º 16
0
        private void cmdReporte_Click(object sender, EventArgs e)
        {
            ArrayList sIDTipoDoc = new ArrayList();
            ArrayList sNdoc      = new ArrayList();
            ArrayList sItem      = new ArrayList();

            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            WSLic.LimpiaTablaSeleccionRepExpLicPersonal(mdlGenerales.Conexion);
            for (Int32 Index = 0; Index <= GGCPersLiq.Table.Records.Count - 1; Index++)
            {
                if (Convert.ToInt16(GGCPersLiq.Table.Records[Index].GetValue("Sel").ToString()) == 1)
                {
                    sIDTipoDoc.Add(txtTipoDoc.Text.ToString());
                    sNdoc.Add(txtNDoc.Text.ToString());
                    sItem.Add(GGCPersLiq.Table.Records[Index].GetValue("item").ToString());
                }
            }
            WSLic.RptExpLicitacionesSeleccionar(mdlGenerales.Conexion, sIDTipoDoc.ToArray(), sNdoc.ToArray(), sItem.ToArray());
            MFRptExperiencia Frm = new MFRptExperiencia();

            Frm.Show();
        }
Ejemplo n.º 17
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);
            }
        }
Ejemplo n.º 18
0
        private void cmdConstancia_Click(object sender, EventArgs e)
        {
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DataSet   DSDevuelveID         = new DataSet();
            DataTable DTDevuelveID         = new DataTable();
            DataSet   DSDevuelveValidacion = new DataSet();
            DataTable DTDevuelveValidacion = new DataTable();
            String    strResultado         = "";
            Int32     intResultado         = 0;
            string    strConsorcio         = "";
            string    strTipoCambio        = "";

            /*************************
            * Validación de  datos
            *************************/

            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;
            }

            /*try
            *  {
            *   if (txtArchivo.Text != "")
            *       DeleteFile(txtArchivo.Text);
            *  }
            *  catch
            *  { }*/
            string NombreArchivo = string.Concat("E_C_", txtNumeroRuc.Text.ToString(), "_", txtEntidad.Text.ToString(), "_", dtpVencimiento.Value.ToString("yyyyMMdd"));

            NombreArchivo = NombreArchivo.Replace(" ", "");
            string extension = "";

            /*************************
            * Subiendo Constancia
            *************************/
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(openFileDialog1.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
                }
                Upload(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string Item = "";

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

            Int32 Consorcio = 0;

            /************************************
            * Registrando experiencia en BD
            ************************************/
            DSDevuelveID = WSLic.ActualizaCertificacionesEmpresa(mdlGenerales.Conexion,
                                                                 txtNumeroRuc.Text.ToString(), lblItem.Text.ToString(),
                                                                 txtCertificacion.Text.ToString(), dtpVencimiento.Value.ToString("yyyy/MM/dd"),
                                                                 txtEntidad.Text.ToString(), NombreArchivo + extension,
                                                                 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);
            }
        }
Ejemplo n.º 19
0
        public void Bloquear(String Usuario = "", String nDoc = "", String tDoc = "")
        {
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveAntiguedadPersonalLic(mdlGenerales.Conexion, nDoc, tDoc);
            DTMain     = DSDevuelve.Tables[0];
            int Horas = 0;

            foreach (DataRow row in DTMain.Rows)
            {
                Horas = int.Parse(row[0].ToString());
            }

            cmdConstancia.Enabled    = false;
            cmdExperienciaSC.Enabled = false;
            miEliminar.Enabled       = false;

            cmdActualizaSoloDatos.Enabled = false;
            foreach (DataRow Row in mdlGenerales.DTRoles.Rows)
            {
                if (Convert.ToInt32(Row[0].ToString()) == 202)
                {
                    switch (Convert.ToInt32(Row[1].ToString()))
                    {
                    case 0:     //No
                        cmdConstancia.Enabled         = false;
                        cmdExperienciaSC.Enabled      = false;
                        miEliminar.Enabled            = false;
                        cmdActualizaSoloDatos.Enabled = false;
                        break;

                    case 1:     //Ingreso
                        cmdConstancia.Enabled         = true;
                        cmdExperienciaSC.Enabled      = true;
                        miEliminar.Enabled            = true;
                        cmdActualizaSoloDatos.Enabled = true;
                        break;

                    case 2:     //Actualizar
                        cmdConstancia.Enabled         = true;
                        cmdExperienciaSC.Enabled      = true;
                        miEliminar.Enabled            = true;
                        cmdActualizaSoloDatos.Enabled = true;
                        break;

                    case 3:     //Visualizar
                        cmdConstancia.Enabled         = false;
                        cmdExperienciaSC.Enabled      = false;
                        miEliminar.Enabled            = false;
                        cmdActualizaSoloDatos.Enabled = false;
                        break;

                    case 4:     //Administrador
                        cmdConstancia.Enabled         = true;
                        cmdExperienciaSC.Enabled      = true;
                        miEliminar.Enabled            = true;
                        cmdActualizaSoloDatos.Enabled = true;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 20
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);
            }
        }
Ejemplo n.º 21
0
        private void cmdCertificado_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

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

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

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

            /*try
            *  {
            *   if (txtArchivo.Text != "")
            *       DeleteFile(txtArchivo.Text);
            *  }
            *  catch
            *  { }*/

            string NombreArchivo = string.Concat(txtNDoc.Text.ToString(), "_", txtTitulo.Text.ToString(), "_", txtCentroEstudios.Text.ToString(), "_", dtpExpedicion.Value.ToString("yyyyMMdd"));

            NombreArchivo = NombreArchivo.Replace(" ", "");
            string extension = "";

            /*************************
            * Subiendo Constancia
            *************************/
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(openFileDialog1.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
                }
                Upload(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string Item = "";

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

            DSDevuelveID = WSLic.ActualizaPersonalLicEstudios(mdlGenerales.Conexion,
                                                              txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), lblItem.Text,
                                                              IDTipo[Convert.ToInt32(cmbTipo.SelectedIndex.ToString())].ToString(),
                                                              txtTitulo.Text.ToString(), txtCentroEstudios.Text.ToString(),
                                                              dtpExpedicion.Value.ToString("yyyy/MM/dd"), NombreArchivo + extension, mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            String strResultado = "";
            Int32  intResultado = 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(), txtTelefono.Text.ToString(), txtEmail.Text.ToString());
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 22
0
        public void Bloquear(String Usuario = "", String nDoc = "", String tDoc = "")
        {
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url  = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelve = WSLic.DevuelveAntiguedadPersonalLic(mdlGenerales.Conexion, nDoc, tDoc);
            DTMain     = DSDevuelve.Tables[0];
            int Horas = 0;

            foreach (DataRow row in DTMain.Rows)
            {
                Horas = int.Parse(row[0].ToString());
            }

            cmdCertificado.Enabled        = false;
            cmdEstudioSC.Enabled          = false;
            miEliminar.Enabled            = false;
            cmdActualizaSoloDatos.Enabled = false;
            foreach (DataRow Row in mdlGenerales.DTRoles.Rows)
            {
                if (Convert.ToInt32(Row[0].ToString()) == 203)
                {
                    switch (Convert.ToInt32(Row[1].ToString()))
                    {
                    case 0:     //No
                        cmdCertificado.Enabled        = false;
                        cmdEstudioSC.Enabled          = false;
                        miEliminar.Enabled            = false;
                        cmdActualizaSoloDatos.Enabled = false;
                        break;

                    case 1:     //Ingreso


                        if ((mdlGenerales.HorasCambioIngreso > Horas) && (mdlGenerales.STRUsuario == Usuario))
                        {
                            //cumple condiciones
                            cmdCertificado.Enabled        = true;
                            cmdEstudioSC.Enabled          = true;
                            miEliminar.Enabled            = true;
                            cmdActualizaSoloDatos.Enabled = true;
                        }
                        else
                        {
                            cmdCertificado.Enabled        = false;
                            cmdEstudioSC.Enabled          = false;
                            miEliminar.Enabled            = false;
                            cmdActualizaSoloDatos.Enabled = false;
                        }

                        break;

                    case 2:     //Actualizar
                        if ((mdlGenerales.HorasCambioActualizacion > Horas))
                        {
                            //cumple condiciones
                            cmdCertificado.Enabled        = true;
                            cmdEstudioSC.Enabled          = true;
                            miEliminar.Enabled            = true;
                            cmdActualizaSoloDatos.Enabled = true;
                        }
                        else
                        {
                            cmdCertificado.Enabled        = false;
                            cmdEstudioSC.Enabled          = false;
                            miEliminar.Enabled            = false;
                            cmdActualizaSoloDatos.Enabled = false;
                        }
                        break;

                    case 3:     //Visualizar
                        cmdCertificado.Enabled        = false;
                        cmdEstudioSC.Enabled          = false;
                        miEliminar.Enabled            = false;
                        cmdActualizaSoloDatos.Enabled = false;
                        break;

                    case 4:     //Administrador
                        cmdCertificado.Enabled        = true;
                        cmdEstudioSC.Enabled          = true;
                        miEliminar.Enabled            = true;
                        cmdActualizaSoloDatos.Enabled = true;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 23
0
        private void cmdActualizaSoloDatos_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            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 el estudio a modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (txtTitulo.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el titulo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtTitulo.Focus();
                return;
            }
            if (txtCentroEstudios.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el centro de estudios", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCentroEstudios.Focus();
                return;
            }

            DSDevuelveID = WSLic.ActualizaPersonalLicEstudiosDatos(mdlGenerales.Conexion,
                                                                   txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), lblItem.Text,
                                                                   IDTipo[Convert.ToInt32(cmbTipo.SelectedIndex.ToString())].ToString(),
                                                                   txtTitulo.Text.ToString(), txtCentroEstudios.Text.ToString(),
                                                                   dtpExpedicion.Value.ToString("yyyy/MM/dd"), mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            String strResultado = "";
            Int32  intResultado = 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(), txtTelefono.Text.ToString(), txtEmail.Text.ToString());
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 24
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();
            String    Spendiente   = "";

            if (txtRuc.Text.ToString().Replace(" ", "") == "")
            {
                MessageBoxAdv.Show("El Ruc debe de tener 11 digitos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }

            if (txtRuc.Text.ToString().Length != 11)
            {
                MessageBoxAdv.Show("Debe de registrar el número de Ruc de la empresa", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }

            if (ValidarSoloNumeros(txtRuc.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("El Número de documento solo debe de contener números", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }


            if (txtNRP.Text.ToString().Replace(" ", "") == "")
            {
                MessageBoxAdv.Show("Debe de registrar el número de NRP", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtNRP.Focus();
                return;
            }
            if (txtRazonSocial.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar la Razón Social de la empresa", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRazonSocial.Focus();
                return;
            }

            if (MayorACero(txtCapacidad.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("La capacidad debe de ser un valor númerico mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCapacidad.Focus();
                return;
            }
            if (chkPendiente.Checked == true)
            {
                if (txtObservaciones.Text == "")
                {
                    MessageBoxAdv.Show("Debe de registrar en observaciones que es lo que tiene pendiente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtDireccion.Focus();
                    return;
                }
                Spendiente = "1";
            }
            else
            {
                Spendiente = "0";
            }

            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url    = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelveID = WSLic.ActualizaEmpresaLic(mdlGenerales.Conexion,
                                                     txtRuc.Text.ToString().Replace(" ", ""), txtNRP.Text.ToString().Replace(" ", ""),
                                                     txtRazonSocial.Text.ToString(), txtCapacidad.Text.ToString(), dptFechaCreacion.Value.ToString("yyyy/MM/dd"),
                                                     txtDireccion.Text.ToString(), txtTelefono1.Text.ToString(), txtTelefono2.Text.ToString(),
                                                     txtEmail.Text.ToString(), txtObservaciones.Text, Spendiente, txtRepresentante.Text.ToString(), mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            Limpiar();
            MessageBoxAdv.Show("Se actualizo el personal", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }
Ejemplo n.º 25
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);
            }
        }
Ejemplo n.º 26
0
        private void cmdConstancia_Click(object sender, EventArgs e)
        {
            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DataSet   DSDevuelveID         = new DataSet();
            DataTable DTDevuelveID         = new DataTable();
            DataSet   DSDevuelveValidacion = new DataSet();
            DataTable DTDevuelveValidacion = new DataTable();
            String    strResultado         = "";
            Int32     intResultado         = 0;
            String    strNDoc      = "";
            String    strApellidos = "";
            String    strNombres   = "";

            /*************************
            * Validación de  datos
            *************************/

            if (lblIDCargo.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar un cargo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCargo.Focus();
                return;
            }

            DSDevuelveValidacion = WSLic.ValidaExperiencia(mdlGenerales.Conexion,
                                                           txtTipoDoc.Text.ToString(), txtNDoc.Text.ToString(), lblItem.Text,
                                                           lblIDCargo.Text.ToString(), txtCliente.Text.ToString(), txtComentario.Text.ToString(),
                                                           dtpInicio.Value.ToString("yyyy/MM/dd"), dtpFin.Value.ToString("yyyy/MM/dd"));
            DTDevuelveValidacion = DSDevuelveValidacion.Tables[0];

            foreach (DataRow Row in DTDevuelveValidacion.Rows)
            {
                intResultado = Convert.ToInt32(Row[0].ToString());
                strResultado = Row[1].ToString();
                strNDoc      = Row[2].ToString();
                strApellidos = Row[3].ToString();
                strNombres   = Row[4].ToString();
            }

            if (intResultado == -2)
            {
                if (MessageBoxAdv.Show("El objeto esta presente en otro personal: " + strNDoc + " " + strApellidos + " " + strNombres, "Información", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK)
                {
                    MessageBoxAdv.Show("Se cancelo el ingreso de la experiencia", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            if (intResultado == -1)
            {
                if (MessageBoxAdv.Show("Existe un traslape de fechas en la experiencia, desea continuar", "Información", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK)
                {
                    MessageBoxAdv.Show("Se cancelo el ingreso de la experiencia", "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;
            }

            /*try
            *  {
            *   if (txtArchivo.Text != "")
            *       DeleteFile(txtArchivo.Text);
            *  }
            *  catch
            *  { }*/
            string NombreArchivo = string.Concat(txtNDoc.Text.ToString(), "_", txtCliente.Text.ToString(), "_", txtCargo.Text.ToString(), "_", txtRubro.Text.ToString(), "_", dtpInicio.Value.ToString("yyyyMMdd"), "_", dtpFin.Value.ToString("yyyyMMdd"));

            NombreArchivo = NombreArchivo.Replace(" ", "");
            string extension = "";

            /*************************
            * Subiendo Constancia
            *************************/
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(openFileDialog1.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
                }
                Upload(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string Item = "";

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

            /************************************
            * Registrando experiencia en BD
            ************************************/
            DSDevuelveID = WSLic.ActualizaPersonalLicExperiencia(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"),
                                                                 NombreArchivo + extension,
                                                                 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);
            }
        }
Ejemplo n.º 27
0
        private void cmdSubirCurriculum_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();
            String    Spendiente   = "";

            if (ValidarSoloNumeros(txtRuc.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("El Número de documento solo debe de contener números", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }

            if (txtRuc.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el número de Ruc de la empresa", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }
            if (txtNRP.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el número de NRP", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtNRP.Focus();
                return;
            }
            if (txtRazonSocial.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar la Razón Social de la empresa", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRazonSocial.Focus();
                return;
            }
            if (MayorACero(txtCapacidad.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("La capacidad debe de ser un valor númerico mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtCapacidad.Focus();
                return;
            }
            if (chkPendiente.Checked == true)
            {
                if (txtObservaciones.Text == "")
                {
                    MessageBoxAdv.Show("Debe de registrar en observaciones que es lo que tiene pendiente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtDireccion.Focus();
                    return;
                }
                Spendiente = "1";
            }
            else
            {
                Spendiente = "0";
            }

            WSLicitaciones.WSLicitaciones WSLic = new WSLicitaciones.WSLicitaciones();
            WSLic.Url    = mdlGenerales.DireccionWS + "FazServices/WSLicitaciones.asmx";
            DSDevuelveID = WSLic.ActualizaEmpresaLic(mdlGenerales.Conexion,
                                                     txtRuc.Text.ToString().Replace(" ", ""), txtNRP.Text.ToString().Replace(" ", ""), txtRazonSocial.Text.ToString(),
                                                     txtCapacidad.Text.ToString(), dptFechaCreacion.Value.ToString("yyyy/MM/dd"),
                                                     txtDireccion.Text.ToString(), txtTelefono1.Text.ToString(), txtTelefono2.Text.ToString(),
                                                     txtEmail.Text.ToString(), txtObservaciones.Text, Spendiente, txtRepresentante.Text.ToString(), mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];

            DataSet   DSDevuelveValidacion = new DataSet();
            DataTable DTDevuelveValidacion = new DataTable();
            String    strResultado         = "";
            Int32     intResultado         = 0;

            /*************************
            * Validación de  datos
            *************************/
            /*try
            *  {
            *   if (txtArchivo.Text != "")
            *       DeleteFile(txtArchivo.Text);
            *  }
            *  catch
            *  { }*/
            string NombreArchivo = string.Concat("C1V3E2_" + txtRuc.Text.ToString());

            NombreArchivo = NombreArchivo.Replace(" ", "");
            string extension = "";

            /*************************
            * Subiendo Constancia
            *************************/
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(openFileDialog1.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
                }
                Upload(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(openFileDialog1.FileName.Replace(openFileDialog1.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            /************************************
            * Registrando experiencia en BD
            ************************************/
            DSDevuelveID = WSLic.ActualizaEmpresaLicArchivo(mdlGenerales.Conexion,
                                                            txtRuc.Text.ToString(), NombreArchivo + extension, 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();
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }