private void cmdAdd_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            if (MayorACero(txtMonto.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("El monto de la entrega a rendir debe de ser nùmerico y mayor que 0", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string SCorrelativo = lblCorrelativo.Text.ToString();
            string SITem        = lblItem.Text.ToString();
            string SMonto       = txtMonto.Text.ToString();
            string SDetalle     = txtDetalle.Text.ToString();
            string SDocumento   = txtDocumento.Text.ToString();

            DSDevuelveID = WSAdmin.AddIngresoAEntregaARendir(mdlGenerales.Conexion, SCorrelativo, SITem, SMonto, SDetalle,
                                                             SDocumento, dtpFecha.Value.ToString("yyyy/MM/dd"), "0", mdlGenerales.STRUsuario);
            MessageBoxAdv.Show("Ingreso añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Limpiar();
            CargaGrid(lblCorrelativo.Text.ToString());
            return;
        }
Exemple #2
0
        private void CargarProyectos()
        {
            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DataSet   DSDevuelve = new DataSet();
            DataTable DTTipo     = new DataTable();
            Int32     I          = 0;

            DSDevuelve = WSAdm.DevuelveProyectoEmpresaRegistro(mdlGenerales.Conexion, RucEmpresa[Convert.ToInt32(cmbEmpresa.SelectedIndex.ToString())].ToString());
            DTTipo     = DSDevuelve.Tables[0];
            IDproyecto.Clear();
            cmbProyecto.Items.Clear();
            cmbProyecto.ResetText();
            foreach (DataRow Row in DTTipo.Rows)
            {
                IDproyecto.Insert(I, Row[0].ToString());
                cmbProyecto.Items.Add(Row[1].ToString());
                I = I + 1;
            }
            if (cmbProyecto.Items.Count > 0)
            {
                cmbProyecto.SelectedIndex = 0;
            }
            I = 0;
        }
Exemple #3
0
 private void miEliminar_Click(object sender, EventArgs e)
 {
     if (MessageBoxAdv.Show("Desea eliminar este sustento de la entrega a rendir, esto no se podra deshacer?", "Eliminar sustento", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
         WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
         Element     el  = GGCPersLiq.TableControl.Table.CurrentElement;
         DataRowView drv = (el as Record).GetData() as DataRowView;
         string      detallecosto_Correlativo   = "";
         string      entregaarendir_correlativo = "";
         if (el != null)
         {
             if (drv[6].ToString() != "")
             {
                 if (el != null)
                 {
                     if (el is GridRecord)
                     {
                         entregaarendir_correlativo = lblCorrelativo.Text.ToString();
                         detallecosto_Correlativo   = drv[6].ToString(); //show column 2
                         WSAdmin.DelfacturaAEntregaARendir(mdlGenerales.Conexion, entregaarendir_correlativo, detallecosto_Correlativo, mdlGenerales.STRUsuario);
                         MessageBoxAdv.Show("Registro eliminado", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         CargaGrid(entregaarendir_correlativo);
                         return;
                     }
                 }
             }
             else
             {
                 MessageBoxAdv.Show("Debe de seleccionar un registro a eliminar ", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
         }
     }
 }
Exemple #4
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            String CorrelativoFactura   = lblCorrelativo.Text.ToString();
            String CorrelativoEntregaAR = "";

            if (MessageBoxAdv.Show("Va a descarga esta factura a esta entrega a rendir?", "Esta seguro", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Element el = GGCEntregas.TableControl.Table.CurrentElement;
                if (el == null)
                {
                    MessageBoxAdv.Show("Debe de seleccionar una entrega a rendir", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (el != null)
                {
                    if (el is GridRecord)
                    {
                        DataRowView drv = (el as Record).GetData() as DataRowView;
                        CorrelativoEntregaAR = drv[0].ToString();
                    }
                }
            }
            WSAdmin.AddfacturaAEntregaARendirRuc(mdlGenerales.Conexion, CorrelativoEntregaAR, CorrelativoFactura, "", mdlGenerales.STRUsuario);
            MessageBoxAdv.Show("Factura descontada de Entrega a rendir", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemple #5
0
        public void CargaGrid()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();
            DataTable DTValor    = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url           = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve            = WSAdmin.DevuelveItemCosto(mdlGenerales.Conexion, lblCorrelativo.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();
            DTValor = DSDevuelve.Tables[1];
            foreach (DataRow Row in DTValor.Rows)
            {
                txtBase.Text  = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[0].ToString()));
                txtIGV.Text   = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[1].ToString()));;
                txtTotal.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[2].ToString()));;
            }
        }
Exemple #6
0
        private void cmdAddASIGV_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();
            String    SPGN3        = "";
            String    SCorrelativo = "";
            String    SIGV         = "";

            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            String TipoCosto = IDDatoProveedor[Convert.ToInt32(cmbTipoDocumento.SelectedIndex.ToString())].ToString();

            if (txtPGN3.Text == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar el asiento de registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPGN3.Focus();
                return;
            }
            if (MayorACero(txtBase.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("La cantidad a registrar debe de ser un valor númerico mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtBase.Focus();
                return;
            }

            SCorrelativo = lblCorrelativo.Text.ToString();
            SPGN3        = txtPGN3.Text.ToString();
            SIGV         = txtIGV.Text.ToString();

            DSDevuelveID = WSAdm.AgregaAsientoCostos(mdlGenerales.Conexion,
                                                     SCorrelativo, SPGN3, SIGV, "0", 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)
            {
                lblCorrelativo.Text = intResultado.ToString();
                MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtProveedor.Focus();
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            LimpiarItem();
            CargaGrid();
        }
Exemple #7
0
        public void CargaGrid(string LCorrelativo)
        {
            lblCorrelativo.Text = LCorrelativo;
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataTable DTCabecera = new DataTable();
            DataView  DVMain     = new DataView();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve  = WSAdmin.DevuelveDescuentosEntregaARendir(mdlGenerales.Conexion,
                                                                   lblCorrelativo.Text.ToString());
            DTMain                = DSDevuelve.Tables[0];
            DTCabecera            = DSDevuelve.Tables[1];
            DVMain                = DTMain.DefaultView;
            GGCPersLiq.DataSource = null;
            GGCPersLiq.TableDescriptor.Reset();
            GGCPersLiq.TableDescriptor.AllowNew = false;
            GGCPersLiq.Refresh();
            GGCPersLiq.DataSource = DVMain;
            foreach (DataRow Row in DTCabecera.Rows)
            {
                lblProyecto.Text = Row[0].ToString();
                lblPersonal.Text = Row[2].ToString();
                dtpFecha.Value   = Convert.ToDateTime(Row[3].ToString());
                lblMonto.Text    = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[4].ToString()));
                lblMoneda.Text   = Row[5].ToString();
                lblRuc.Text      = Row[7].ToString();
                if (Row[8].ToString() != "")
                {
                    lblSustMM.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[8].ToString()));
                }
                if (Row[9].ToString() != "")
                {
                    lblSustOM.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[9].ToString()));
                }
                if (Row[10].ToString() != "")
                {
                    lblSust2.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[10].ToString()));
                }
                if (Row[11].ToString() != "")
                {
                    lblTotalD.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[11].ToString()));
                }
                if (Row[12].ToString() != "")
                {
                    lblFaltante.Text = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[12].ToString()));
                }
                lblEstado.Text = Row[13].ToString();
            }
            FormatColumnas();
            AplicarFilterBar();
            Bloquear();
        }
Exemple #8
0
        public void CargarReporte(String LCorrelativo)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();

            this.MdiParent = MFMdi.ActiveForm;
            this.Left      = 0;
            this.Top       = 0;
            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url  = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve = WSAdm.GeneraReporteEAR(mdlGenerales.Conexion, LCorrelativo);
            DTMain     = DSDevuelve.Tables[0];
            DataSet   DSArma = new DataSet();
            DataTable DTArma = new DataTable();

            DTArma.Columns.Add("tipo", Type.GetType("System.String"));
            DTArma.Columns.Add("correlativo", Type.GetType("System.String"));
            DTArma.Columns.Add("ndoc", Type.GetType("System.String"));
            DTArma.Columns.Add("nombres", Type.GetType("System.String"));
            DTArma.Columns.Add("detalle", Type.GetType("System.String"));
            DTArma.Columns.Add("documento", Type.GetType("System.String"));
            DTArma.Columns.Add("fecha", Type.GetType("System.DateTime"));
            DTArma.Columns.Add("abreviatura", Type.GetType("System.String"));
            DTArma.Columns.Add("monto", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("tc", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("soles", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("logo", Type.GetType("System.Byte[]"));
            DTArma.Columns.Add("FechaEAR", Type.GetType("System.DateTime"));
            DataRow DR;

            foreach (DataRow Row in DTMain.Rows)
            {
                DR                = DTArma.NewRow();
                DR["tipo"]        = Row[0].ToString();
                DR["correlativo"] = Row[1].ToString();
                DR["ndoc"]        = Row[2].ToString();
                DR["nombres"]     = Row[3].ToString();
                DR["detalle"]     = Row[4].ToString();
                DR["documento"]   = Row[5].ToString();
                DR["fecha"]       = Convert.ToDateTime(Row[6].ToString());
                DR["abreviatura"] = Row[7].ToString();
                DR["monto"]       = Convert.ToDecimal(Row[8].ToString());
                DR["tc"]          = Convert.ToDecimal(Row[9].ToString());
                DR["soles"]       = Convert.ToDecimal(Row[10].ToString());
                DR["logo"]        = Mostrar(Row[11].ToString());
                DR["FechaEAR"]    = Convert.ToDateTime(Row[12].ToString());
                DTArma.Rows.Add(DR);
            }
            Report.Database.Tables[0].SetDataSource(DTArma);
            CRVReport.ReportSource = Report;
            CRVReport.Zoom(100);
            CRVReport.Visible = true;
        }
Exemple #9
0
        private void CargarReporte()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();

            this.MdiParent = MFMdi.ActiveForm;
            this.Left      = 0;
            this.Top       = 0;
            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url  = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve = WSAdm.DevuelveReporteCostosGeneral(mdlGenerales.Conexion,
                                                            RucEmpresa[Convert.ToInt32(cmbEmpresa.SelectedIndex.ToString())].ToString(),
                                                            IDproyecto[Convert.ToInt32(cmbProyecto.SelectedIndex.ToString())].ToString());
            DTMain = DSDevuelve.Tables[0];
            DataSet   DSArma = new DataSet();
            DataTable DTArma = new DataTable();

            DTArma.Columns.Add("empresa", Type.GetType("System.String"));
            DTArma.Columns.Add("Descripcion", Type.GetType("System.String"));
            DTArma.Columns.Add("inicio", Type.GetType("System.DateTime"));
            DTArma.Columns.Add("ruc", Type.GetType("System.String"));
            DTArma.Columns.Add("tipocosto", Type.GetType("System.String"));
            DTArma.Columns.Add("detalletc", Type.GetType("System.String"));
            DTArma.Columns.Add("IGV", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("totalsinigv", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("total", Type.GetType("System.Decimal"));
            DTArma.Columns.Add("logo", Type.GetType("System.Byte[]"));
            DataRow DR;

            foreach (DataRow Row in DTMain.Rows)
            {
                DR                = DTArma.NewRow();
                DR["empresa"]     = Row[0].ToString();
                DR["Descripcion"] = Row[1].ToString();
                DR["inicio"]      = Convert.ToDateTime(Row[2].ToString());
                DR["ruc"]         = Row[3].ToString();
                DR["tipocosto"]   = Row[4].ToString();
                DR["detalletc"]   = Row[5].ToString();
                DR["IGV"]         = Convert.ToDecimal(Row[6].ToString());
                DR["totalsinigv"] = Convert.ToDecimal(Row[7].ToString());
                DR["total"]       = Convert.ToDecimal(Row[8].ToString());
                DR["logo"]        = Mostrar(Row[9].ToString());
                DTArma.Rows.Add(DR);
            }
            Report.Database.Tables[0].SetDataSource(DTArma);
            CRVReport.ReportSource = Report;
            CRVReport.Zoom(100);
            CRVReport.Visible = true;
        }
        private void cmdAddFaltante_Click(object sender, EventArgs e)
        {
            string    LCorrelativo = "";
            string    LMonto       = "";
            string    SCorrelativo = "";
            string    SDetalle     = "";
            string    SDocumento   = "";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            Element el = GGCEntregas.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    LCorrelativo = drv[0].ToString();
                    LMonto       = drv[12].ToString();
                    SCorrelativo = lblCorrelativo.Text.ToString();
                    SDetalle     = "Descargada de otra entrega a rendir";
                    SDocumento   = LCorrelativo;
                }
            }
            if (LMonto == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar la EAR a descargar", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DSDevuelveID = WSAdmin.AddIngresoAEntregaARendir(mdlGenerales.Conexion, SCorrelativo, "0", LMonto, SDetalle,
                                                             SDocumento, dtpFecha.Value.ToString("yyyy/MM/dd"), LCorrelativo, mdlGenerales.STRUsuario);


            DSDevuelveID = WSAdmin.CierraEntregaARendir(mdlGenerales.Conexion, LCorrelativo, "1", "", "0",
                                                        "Se descargo el monto en otra entrega a rendir", lblCorrelativo.Text.ToString(),
                                                        mdlGenerales.STRUsuario);


            MessageBoxAdv.Show("Ingreso añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Limpiar();
            CargaGrid(lblCorrelativo.Text.ToString());
            return;
        }
Exemple #11
0
        private void dptFecha_ValueChanged(object sender, EventArgs e)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTAlerta1  = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve  = WSAdmin.DevuelveTCFecha(mdlGenerales.Conexion, dptFecha.Value.ToString("yyyy/MM/dd"));
            DTAlerta1   = DSDevuelve.Tables[0];
            lblTcc.Text = "0";
            lblTcv.Text = "0";
            foreach (DataRow Row in DTAlerta1.Rows)
            {
                dptFecha.Value = Convert.ToDateTime(Row[0].ToString());
                lblTcc.Text    = Row[1].ToString();
                lblTcv.Text    = Row[2].ToString();
            }
        }
Exemple #12
0
        public void CargaGrid(String IDProyecto, String IDPartidasPrincipales, String Empresa, String Proyecto, String Partida, String idmaestropartidas, String ruc)
        {
            try
            {
                DataSet   DSDevuelve = new DataSet();
                DataTable DTMain     = new DataTable();
                DataView  DVMain     = new DataView();

                if (idmaestropartidas == "0")
                {
                    lblTipo.Text = "Detalle Tipo Costo: ";
                }
                else
                {
                    lblTipo.Text = "Tipo Costo: ";
                }


                lblEmpresa.Text  = Empresa;
                lblProyecto.Text = Proyecto;
                lblPartida.Text  = Partida;
                WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
                WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
                DSDevuelve  = WSAdmin.DevuelveDetalleResumenCostosGeneral(mdlGenerales.Conexion,
                                                                          IDProyecto, IDPartidasPrincipales, idmaestropartidas);
                DTMain = DSDevuelve.Tables[0];
                DVMain = DTMain.DefaultView;
                GGCPersLiq.DataSource = null;
                GGCPersLiq.TableDescriptor.Reset();
                GGCPersLiq.TableDescriptor.AllowNew = false;
                GGCPersLiq.Refresh();
                GGCPersLiq.DataSource = DVMain;
                FormatColumnas();
                AplicarFilterBar();
                lblRuc.Text = ruc;
                Bloquear();
            }
            catch (Exception Ex)
            {
                MessageBoxAdv.Show("Debe de seleccionar un registro de costos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
 public void CargaGrid(string Correlativo)
 {
     try
     {
         DataSet   DSDevuelve = new DataSet();
         DataTable DTMain     = new DataTable();
         DataTable DTCabecera = new DataTable();
         DataView  DVMain     = new DataView();
         WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
         WSAdmin.Url           = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
         DSDevuelve            = WSAdmin.DevuelveItemIngEntregaARendir(mdlGenerales.Conexion, Correlativo);
         DTMain                = DSDevuelve.Tables[0];
         DTCabecera            = DSDevuelve.Tables[1];
         DVMain                = DTMain.DefaultView;
         GGCPersLiq.DataSource = null;
         GGCPersLiq.TableDescriptor.Reset();
         GGCPersLiq.TableDescriptor.AllowNew = false;
         GGCPersLiq.Refresh();
         GGCPersLiq.DataSource = DVMain;
         FormatColumnas();
         AplicarFilterBar();
         foreach (DataRow Row in DTCabecera.Rows)
         {
             lblCorrelativo.Text = Row[0].ToString();
             lblProyecto.Text    = Row[1].ToString();
             lblPersonal.Text    = Row[2].ToString();
             lblMoneda.Text      = Row[3].ToString();
             lblMonto.Text       = string.Format("{0:#,##0.##}", Convert.ToDouble(Row[4].ToString()));
             lblFecha.Text       = Convert.ToDateTime(Row[5].ToString()).ToString("MM/dd/yyyy");
             lblRuc.Text         = Row[6].ToString();
             lblIDProyecto.Text  = Row[7].ToString();
             lblDNI.Text         = Row[8].ToString();
         }
         CargaGridEARendirFaltantes();
         GGCPersLiq.Select();
         GGCEntregas.Select();
         Bloquear();
     }
     catch (Exception ex)
     {
         MessageBoxAdv.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public void CargaGridEARendirFaltantes()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();
            DataTable DTValor    = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url            = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve             = WSAdmin.DevuelveFaltantesEAR(mdlGenerales.Conexion, lblDNI.Text.ToString());
            DTMain                 = DSDevuelve.Tables[0];
            DVMain                 = DTMain.DefaultView;
            GGCEntregas.DataSource = null;
            GGCEntregas.TableDescriptor.Reset();
            GGCEntregas.TableDescriptor.AllowNew = false;
            GGCEntregas.Refresh();
            GGCEntregas.DataSource = DVMain;
            FormatColumnasEARFaltantes();
            AplicarFilterBarEARFaltantes();
        }
Exemple #15
0
        private void CargaAutoCompletePCGNivel2(string IDNivel1)
        {
            DataSet   DSDevuelveNivel2 = new DataSet();
            DataTable DTDevuelveNivel2 = new DataTable();
            Int32     I = 0;

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url      = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelveNivel2 = WSAdmin.DevuelveCuentasPCGNivel2(mdlGenerales.Conexion, IDNivel1);
            DTDevuelveNivel2 = DSDevuelveNivel2.Tables[0];
            ACIDNivel2.Clear();
            ACConcNivel2.Clear();
            foreach (DataRow Row in DTDevuelveNivel2.Rows)
            {
                ACIDNivel2.Insert(I, Row[0].ToString());
                ACConcNivel2.Insert(I, Row[1].ToString());
                I = I + 1;
            }
            acPCGN2.DataSource = ACConcNivel2;
        }
Exemple #16
0
        private void cmdDescontar_Click(object sender, EventArgs e)
        {
            /**************************************************************
             *                                                            *
             * En este caso se obliga a agregar el documento de descuento *
             *                                                            *
             ***************************************************************/
            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();
            String    strResultado = "";
            Int32     intResultado = 0;

            if (MessageBoxAdv.Show("Debera ingresar numero y documento de descuento escaneado", "Desea continuar?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                DSDevuelveID = WSAdm.CierraEntregaARendir(mdlGenerales.Conexion,
                                                          lblCorrelativo.Text.ToString(), "1", "", "0",
                                                          txtObservaciones.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 == 1)
                {
                    MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBoxAdv.Show("Cierre de entrega a rendir cancelada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
Exemple #17
0
        public void CargaGrid()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve  = WSAdmin.DevuelveResumenCostosGeneral(mdlGenerales.Conexion,
                                                               RucEmpresa[Convert.ToInt32(cmbEmpresa.SelectedIndex.ToString())].ToString(),
                                                               IDproyecto[Convert.ToInt32(cmbProyecto.SelectedIndex.ToString())].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();
        }
Exemple #18
0
 private void miEliminar_Click(object sender, EventArgs e)
 {
     if (MessageBoxAdv.Show("Esta seguro de eliminar esta factura?", "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         WSAdministracion.WSAdministracion WSDel = new WSAdministracion.WSAdministracion();
         WSDel.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
         Element el = GGCPersLiq.TableControl.Table.CurrentElement;
         if (el != null)
         {
             if (el is GridRecord)
             {
                 DataRowView drv                    = (el as Record).GetData() as DataRowView;
                 String      Correlativo            = drv[1].ToString();
                 String      NumeroDocumento        = drv[4].ToString();
                 String      Denominacion           = drv[6].ToString();
                 String      LIDPartidasPrincipales = drv[7].ToString();
                 String      Serie                  = drv[9].ToString();
                 String      Numero                 = drv[10].ToString();
                 String      usuario                = drv[20].ToString();
                 String      Horas                  = drv[22].ToString();
                 String      LIDproyecto            = drv[23].ToString();
                 String      LArchivo               = drv[25].ToString();
                 String      NumeroRuc              = drv[26].ToString();;
                 Bloquear(Convert.ToInt32(Correlativo), Convert.ToInt32(Horas), usuario);
                 if (LArchivo != "")
                 {
                     DeleteFile(LArchivo);
                 }
                 WSDel.DelDetalleCostos(mdlGenerales.Conexion, Correlativo, NumeroRuc,
                                        NumeroDocumento, Denominacion, Serie, Numero, mdlGenerales.STRUsuario);
                 MessageBoxAdv.Show("Registro eliminado", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 CargaGrid(LIDproyecto, LIDPartidasPrincipales, lblEmpresa.Text.ToString(),
                           lblProyecto.Text.ToString(), lblPartida.Text.ToString(),
                           lblIDMaestroPartida.Text.ToString(),
                           lblRuc.Text.ToString());
             }
         }
     }
 }
Exemple #19
0
        public void CargaGridEARendir()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();
            DataTable DTValor    = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DSDevuelve  = WSAdmin.DevuelveEntregaARendirSF(mdlGenerales.Conexion,
                                                           RucEmpresa[Convert.ToInt32(cmbEmpresa.SelectedIndex.ToString())].ToString(),
                                                           IDproyecto[Convert.ToInt32(cmbProyecto.SelectedIndex.ToString())].ToString(),
                                                           dtpFecha.Value.Month.ToString(), dtpFecha.Value.Year.ToString(),
                                                           lblCorrelativo.Text.ToString());
            DTMain = DSDevuelve.Tables[0];
            DVMain = DTMain.DefaultView;
            GGCEntregas.DataSource = null;
            GGCEntregas.TableDescriptor.Reset();
            GGCEntregas.TableDescriptor.AllowNew = false;
            GGCEntregas.Refresh();
            GGCEntregas.DataSource = DVMain;
            FormatColumnasEAR();
            AplicarFilterBarEAR();
        }
Exemple #20
0
        private void MIDesasignar_Click(object sender, EventArgs e)
        {
            string    LCorrelativo = "";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            Element el = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    LCorrelativo = drv[0].ToString();
                }
            }

            WSAdmin.DesAsignaEAR_EAR(mdlGenerales.Conexion, lblCorrelativo.Text.ToString(), LCorrelativo, mdlGenerales.STRUsuario);
            MessageBoxAdv.Show("Desasignación realizada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid(lblCorrelativo.Text.ToString(), lblIDProyecto.Text.ToString());
            return;
        }
Exemple #21
0
        private void miVisualizaDF_Click(object sender, EventArgs e)
        {
            DataSet     DSDevuelve               = new DataSet();
            DataTable   DTMain                   = new DataTable();
            DataView    DVMain                   = new DataView();
            Element     el                       = GGCPersLiq.TableControl.Table.CurrentElement;
            DataRowView drv                      = (el as Record).GetData() as DataRowView;
            string      LCorrelativo             = "";
            string      LIDTipoDocumento         = "";
            string      LProveedor               = "";
            string      LNumeroDocumento         = "";
            string      LDenominacion            = "";
            string      LIDPartida               = "";
            string      LPartida                 = "";
            string      Lserie                   = "";
            string      LNumero                  = "";
            string      LMoneda                  = "";
            string      LPendiente               = "";
            string      Lobservaciones           = "";
            string      LFecha                   = "";
            string      LUsuario                 = "";
            string      LHoras                   = "";
            string      LIDProyecto              = "";
            string      LRuc                     = "";
            string      LIDformapago             = "";
            string      Ldocumentopago           = "";
            string      LFPP                     = "";
            string      detallecosto_Correlativo = "";

            if (el != null)
            {
                if (drv[6].ToString() != "")
                {
                    if (el != null)
                    {
                        if (el is GridRecord)
                        {
                            detallecosto_Correlativo = drv[6].ToString(); //show column 2
                        }
                    }
                }
                else
                {
                    MessageBoxAdv.Show("Debe de seleccionar un registro a eliminar ", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            WSAdministracion.WSAdministracion WSAdmin = new WSAdministracion.WSAdministracion();
            WSAdmin.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";

            DSDevuelve = WSAdmin.DevuelveDetalleComprasUno(mdlGenerales.Conexion, detallecosto_Correlativo);
            DTMain     = DSDevuelve.Tables[0];

            foreach (DataRow Row in DTMain.Rows)
            {
                LCorrelativo     = Row[1].ToString();
                LIDTipoDocumento = Row[2].ToString();
                LNumeroDocumento = Row[4].ToString();
                LProveedor       = Row[5].ToString();;
                LDenominacion    = Row[6].ToString();
                Lserie           = Row[7].ToString();
                LNumero          = Row[8].ToString();
                LMoneda          = Row[10].ToString();
                LPendiente       = Row[12].ToString();
                Lobservaciones   = Row[13].ToString();
                LFecha           = Row[14].ToString();
                LUsuario         = Row[16].ToString();
                LHoras           = Row[18].ToString();
                LIDProyecto      = Row[19].ToString();
                LRuc             = Row[22].ToString();
                LIDformapago     = Row[23].ToString();
                Ldocumentopago   = Row[25].ToString();
                LFPP             = Row[26].ToString();
            }
            MFRegistroDocumentos frm = new MFRegistroDocumentos();

            frm.Show();
            frm.Cargarfactura(LCorrelativo, LIDTipoDocumento, LProveedor,
                              LNumeroDocumento, LDenominacion, Lserie, LNumero, LMoneda,
                              LPendiente, Lobservaciones, LFecha, LHoras, LRuc, LIDProyecto,
                              LIDformapago, Ldocumentopago, LFPP, LUsuario);
        }
Exemple #22
0
        private void miAdd_Click(object sender, EventArgs e)
        {
            string  LCorrelativo = "";
            string  LIDProyecto  = "";
            string  LArchivo     = "";
            Element el           = GGCPersLiq.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    LCorrelativo = drv[1].ToString();
                    LIDProyecto  = drv[23].ToString();
                    LArchivo     = drv[25].ToString();
                }
            }

            if (LCorrelativo == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar la factura a la que desea agregar el archivo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string NombreArchivo = string.Concat("FactCor_" + LCorrelativo.ToString());

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

            /*************************
            * Subiendo foto
            *************************/
            var dlg = new OpenFileDialog
            {
                Filter          = @"PDF files (*.pdf)|*.pdf|JPEG files (*.jpg)|*.jpg|BMP files (*.BMP)|*.BMP|GIF files (*.gif)|*.gif",
                CheckFileExists = true,
                Title           = @"Seleccione el archivo",
                Multiselect     = false
            };

            ;
            if (dlg.ShowDialog() == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(dlg.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension);
                }

                //aqui me quedo

                /*if (LArchivo != "")
                 *  DeleteFile(LArchivo);*/
                Upload(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            /************************************
            * Registrando experiencia en BD
            ************************************/
            Int32     intResultado = 0;
            String    strResultado = "";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";

            DSDevuelveID = WSAdm.AddFacturaCostos(mdlGenerales.Conexion, LCorrelativo,
                                                  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);
                CargaGrid(LIDProyecto, lblIDPartida.Text.ToString(), lblEmpresa.Text.ToString(),
                          lblProyecto.Text.ToString(), lblPartida.Text.ToString(),
                          lblIDMaestroPartida.Text.ToString(),
                          lblRuc.Text.ToString());
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #23
0
        private void cmdCerrar_Click(object sender, EventArgs e)
        {
            WSAdministracion.WSAdministracion WSAdm = new WSAdministracion.WSAdministracion();
            WSAdm.Url = mdlGenerales.DireccionWS + "FazServices/WSAdministracion.asmx";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();
            String    strResultado = "";
            Int32     intResultado = 0;

            if (MessageBoxAdv.Show("Desea cerrar esta entrega a rendir", "Esta seguro?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                if (IsNumeric(lblFaltante.Text.ToString()) == true)
                {
                    if (Convert.ToDouble(lblFaltante.Text.ToString()) >= 0)
                    {
                        //Ojo aqui cierra normal sin diferencia
                        DSDevuelveID = WSAdm.CierraEntregaARendir(mdlGenerales.Conexion,
                                                                  lblCorrelativo.Text.ToString(), "1", "", "0",
                                                                  txtObservaciones.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 == 1)
                        {
                            MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        //Ojo aqui cierra con sobrante
                        DSDevuelveID = WSAdm.CierraEntregaARendir(mdlGenerales.Conexion,
                                                                  lblCorrelativo.Text.ToString(), "3", "", "0",
                                                                  txtObservaciones.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 == 1)
                        {
                            MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            else
            {
                MessageBoxAdv.Show("Cierre de entrega a rendir cancelada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }