Ejemplo n.º 1
0
 private void dgvTesoreria_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (e.ColumnIndex == dgvTesoreria.Columns["Editar"].Index)
     {
         string          PK  = dgvTesoreria.CurrentRow.Cells["IdMovTESM"].Value.ToString();
         frmTesoreriaMov frm = new frmTesoreriaMov(idLocal, idPc, PK, tblTesoreria.Copy());
         frm.FormClosed += editTesoreria_FormClosed;
         frm.Show();
     }
     if (e.ColumnIndex == dgvTesoreria.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro?", "Trend Gestión",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
                 return;
             }
             int         PK  = Convert.ToInt32(dgvTesoreria.CurrentRow.Cells["IdMovTESM"].Value.ToString());
             frmProgress frm = new frmProgress(PK, "frmArqueoCajaAdmin_borrarTesoreria", "grabar");
             frm.FormClosed += progreso_FormClosed;
             frm.Show();
         }
     }
 }
 void dgvDatos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0) return;
     if (e.ColumnIndex == dgvDatos.Columns["Editar"].Index)
     {
         int PK = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdFondoFONP"].Value.ToString());
         frmFondoCaja frm = new frmFondoCaja(dt.Tables[0], PK);
         frm.fecha = Convert.ToDateTime(dgvDatos.CurrentRow.Cells["FechaFONP"].Value.ToString());
         frm.idPc = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdPcFONP"].Value.ToString());
         frm.idLocal = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdLocalLOC"].Value.ToString());
         frm.ShowDialog();
     }
     if (e.ColumnIndex == dgvDatos.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro?", "Buscar",
                 MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                         + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
                 return;
             }
             int PK = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdFondoFONP"].FormattedValue.ToString());
             string formularioOrigen = "frmFondoCajaCons";
             string accionProgress = "grabar";
             frmProgress progreso = new frmProgress(PK, formularioOrigen, accionProgress, ref bindingSource1);
             progreso.ShowDialog();
         }
     }
 }
Ejemplo n.º 3
0
 void dgvDatos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (e.ColumnIndex == dgvDatos.Columns["Editar"].Index)
     {
         int          PK  = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdFondoFONP"].Value.ToString());
         frmFondoCaja frm = new frmFondoCaja(dt.Tables[0], PK);
         frm.fecha   = Convert.ToDateTime(dgvDatos.CurrentRow.Cells["FechaFONP"].Value.ToString());
         frm.idPc    = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdPcFONP"].Value.ToString());
         frm.idLocal = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdLocalLOC"].Value.ToString());
         frm.ShowDialog();
     }
     if (e.ColumnIndex == dgvDatos.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro?", "Buscar",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
                 return;
             }
             int         PK = Convert.ToInt32(dgvDatos.CurrentRow.Cells["IdFondoFONP"].FormattedValue.ToString());
             string      formularioOrigen = "frmFondoCajaCons";
             string      accionProgress   = "grabar";
             frmProgress progreso         = new frmProgress(PK, formularioOrigen, accionProgress, ref bindingSource1);
             progreso.ShowDialog();
         }
     }
 }
Ejemplo n.º 4
0
 private void dgvVentas_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (e.ColumnIndex == dgvVentas.Columns["Editar"].Index)
     {
         string    idVenta = dgvVentas.CurrentRow.Cells["IdVentaVEN"].Value.ToString();
         frmVentas ventas  = new frmVentas(idVenta, idPc, tblVentas, tblVentasDetalle);
         ventas.FormClosed += editVentas_FormClosed;
         ventas.ShowDialog();
     }
     if (e.ColumnIndex == dgvVentas.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro y todos los movimientos relacionados?", "Trend Gestión",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
                 return;
             }
             int         PK  = Convert.ToInt32(dgvVentas.CurrentRow.Cells["IdVentaVEN"].Value.ToString());
             frmProgress frm = new frmProgress(PK, "frmArqueoCajaAdmin_borrarVenta", "grabar");
             frm.FormClosed += progreso_FormClosed;
             frm.Show();
         }
     }
 }
Ejemplo n.º 5
0
 private void frmTesoreriaMov_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (registroNuevo == lblClave.Text && txtDetalle.Text == string.Empty && txtImporte.Text == string.Empty)
     {
         bindingSource1.Remove(bindingSource1.Current);
     }
     bindingSource1.EndEdit();
     if (tblTesoreriaMov.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             return;
         }
         string      formularioOrigen = "frmTesoreriaMov";
         string      accionProgress   = "grabar";
         frmProgress progreso         = new frmProgress(dsTesoreriaMov, formularioOrigen, accionProgress);
         try
         {
             progreso.ShowDialog();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Ejemplo n.º 6
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd");
            string strFechaHasta = dateTimeHasta.Value.ToString("yyyy-MM-dd");
            int    idEmpleado;

            if (chkTodos.Checked != true)
            {
                idEmpleado = Convert.ToInt32(lstEmpleados.SelectedValue.ToString());
            }
            else
            {
                idEmpleado = 0;
            }
            int liquidado;

            if (chkLiquidado.Checked)
            {
                liquidado = 1;
            }
            else
            {
                liquidado = 0;
            }
            frmProgress progreso = new frmProgress(strFechaDesde, strFechaHasta, idEmpleado, liquidado, "frmEmpleadosMovConsInter", "cargar");

            progreso.ShowDialog();
            DataTable           tbl     = frmProgress.tblEstatica;
            frmEmpleadosMovCons frmCons = new frmEmpleadosMovCons(tbl);

            frmCons.Show();
        }
Ejemplo n.º 7
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstPc.SelectedValue == null)
     {
         MessageBox.Show("Debe seleccionar un nro de caja.", "Trend Gestión");
         return;
     }
     if (txtImporte.Text == "")
     {
         return;
     }
     rowView.EndEdit();
     if (tblFondoCaja.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             tblFondoCaja.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblFondoCaja, "frmFondoCaja", "grabar");
         progreso.ShowDialog();
         tblFondoCaja.AcceptChanges();
         Close();
     }
 }
        private void frmVentasPesosCons_Load(object sender, EventArgs e)
        {
            foreach (DataRowView filaLocal in lstLocales.SelectedItems)
            {
                idLocal = filaLocal.Row[0].ToString();
                strLocales += "IdLocalLOC LIKE '" + idLocal + "' OR ";

            }
            strLocales = strLocales.Substring(0, strLocales.Length - 4);
            progreso = new frmProgress(forma, fechaDesde, fechaHasta, strLocales, formularioOrigen, accionProgress);
            progreso.ShowDialog();
            try
            {
                dataGridView1.DataSource = frmProgress.dsVentasPesosCons.Tables[0];
            }
            catch(Exception)
            {
                Close();
                return;
            }
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.Columns["Venta"].DefaultCellStyle.Format = "C0";
            dataGridView1.Columns["Costo"].DefaultCellStyle.Format = "C0";
            dataGridView1.Columns["Utilidad bruta"].DefaultCellStyle.Format = "C0";
            dataGridView1.Columns["Valor agregado"].DefaultCellStyle.Format = "0\\%";
        }
Ejemplo n.º 9
0
        private void frmFondoCaja_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (txtImporte.Text == "")
            {
                return;
            }
            rowView.EndEdit();
            if (tblFondoCaja.GetChanges() != null)
            {
                DialogResult respuesta = MessageBox.Show("¿Confirma la grabación de datos?", "Trend Gestión",
                                                         MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                switch (respuesta)
                {
                case DialogResult.Yes:
                    if (!BL.UtilDB.ValidarServicioMysql())
                    {
                        MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                                        + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                        MessageBoxIcon.Error);
                        tblFondoCaja.RejectChanges();
                        return;
                    }
                    frmProgress progreso = new frmProgress(tblFondoCaja, "frmFondoCaja", "grabar");
                    progreso.ShowDialog();
                    break;

                case DialogResult.No:
                    break;

                case DialogResult.Cancel:
                    e.Cancel = true;
                    break;
                }
            }
        }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstPc.SelectedValue == null)
     {
         MessageBox.Show("Debe seleccionar un nro de caja.", "Trend Gestión");
         return;
     }
     if (txtImporte.Text == "") return;
     rowView.EndEdit();
     if (tblFondoCaja.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             tblFondoCaja.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblFondoCaja, "frmFondoCaja", "grabar");
         progreso.ShowDialog();
         tblFondoCaja.AcceptChanges();
         Close();
     }
 }
Ejemplo n.º 11
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(cmbGenero.Text))
     {
         MessageBox.Show("Debe indicar un género.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
         cmbGenero.Focus();
     }
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                         + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
         return;
     }
     try
     {
         strFecha = dateTimeDesde.Value.ToString("yyyy-MM-dd");
         string      genero = cmbGenero.SelectedValue.ToString();
         frmProgress frm    = new frmProgress(strFecha, "frmArticulosBorradoMasivo", "cargar", genero);
         frm.ShowDialog();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }
Ejemplo n.º 12
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if(string.IsNullOrEmpty(cmbGenero.Text)){
                MessageBox.Show("Debe indicar un género.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                cmbGenero.Focus();
            }

            try
            {
                if (!BL.UtilDB.ValidarServicioMysql())
                {
                    MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                            + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                    return;
                }
                strFecha = dateTimeDesde.Value.ToString("yyyy-MM-dd");
                string genero = cmbGenero.SelectedValue.ToString();
                frmProgress frm = new frmProgress(strFecha, "frmPedido", "cargar", genero);
                frm.ShowDialog();
                tblPedidos = frmProgress.dtEstatico.Tables[0];
                tblPedidos.AcceptChanges();
                PedidoRpt frmPedido = new PedidoRpt(tblPedidos);
                frmPedido.Show();
            }
            catch (NullReferenceException)
            {
                return;
            }
        }
Ejemplo n.º 13
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmbGenero.Text))
            {
                MessageBox.Show("Debe indicar un género.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                cmbGenero.Focus();
            }

            try
            {
                if (!BL.UtilDB.ValidarServicioMysql())
                {
                    MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                                    + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return;
                }
                strFecha = dateTimeDesde.Value.ToString("yyyy-MM-dd");
                string      genero = cmbGenero.SelectedValue.ToString();
                frmProgress frm    = new frmProgress(strFecha, "frmPedido", "cargar", genero);
                frm.ShowDialog();
                tblPedidos = frmProgress.dtEstatico.Tables[0];
                tblPedidos.AcceptChanges();
                PedidoRpt frmPedido = new PedidoRpt(tblPedidos);
                frmPedido.Show();
            }
            catch (NullReferenceException)
            {
                return;
            }
        }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if(string.IsNullOrEmpty(cmbGenero.Text)){
         MessageBox.Show("Debe indicar un género.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
         cmbGenero.Focus();
     }
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     try
     {
         strFecha = dateTimeDesde.Value.ToString("yyyy-MM-dd");
         string genero = cmbGenero.SelectedValue.ToString();
         frmProgress frm = new frmProgress(strFecha, "frmArticulosBorradoMasivo", "cargar", genero);
         frm.ShowDialog();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }
Ejemplo n.º 15
0
 private void frmArticulosGenerar_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (tblArticulos.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblArticulos, "frmArticulosGenerar", "grabar");
         progreso.ShowDialog();
     }
 }
Ejemplo n.º 16
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string whereLocales = null;
            string articulo     = "";
            string descripcion  = "";

            Cursor.Current = Cursors.WaitCursor;
            string idLocal;

            foreach (DataRowView filaLocal in lstLocales.SelectedItems)
            {
                idLocal       = filaLocal.Row[0].ToString();
                whereLocales += "IdLocalSTK LIKE '" + idLocal + "' OR ";
            }
            whereLocales = whereLocales.Substring(0, whereLocales.Length - 4);
            if (rdArticulo.Checked == true)
            {
                articulo = txtParametros.Text;
            }
            else
            {
                descripcion = txtParametros.Text;
            }
            string      origen      = "frmStock";
            string      accion      = "cargar";
            frmProgress newMDIChild = new frmProgress(origen, accion, whereLocales, proveedor, articulo, descripcion);

            newMDIChild.ShowDialog();
            tblStock = frmProgress.dtEstatico.Tables[0];
            if (rdPantalla.Checked == true)
            {
                try
                {
                    DataColumn columnaPivot = tblStock.Columns["NombreLOC"];
                    DataColumn valorPivot   = tblStock.Columns["Cantidad"];
                    dtCruzada = BL.Utilitarios.Pivot(tblStock, columnaPivot, valorPivot);
                }
                catch
                {
                    if (whereLocales == null)
                    {
                        MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("No se encontraron artículos coincidentes", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    return;
                }
            }
            else
            {
            }
            frmStockInforme stockInforme = new frmStockInforme(dtCruzada);

            stockInforme.ShowDialog();
            Cursor.Current = Cursors.Arrow;
        }
Ejemplo n.º 17
0
 private void btnGrabar_Click(object sender, EventArgs e)
 {
     bindingSource1.EndEdit();
     if (tblEmpleadosMov.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblEmpleadosMov, "frmEmpleadosMov", "grabar");
         progreso.ShowDialog();
     }
 }
Ejemplo n.º 18
0
        private void Grabar()
        {
            DataRow row = tblArticulos.Rows.Find(txtIdArticulo.Text);

            row["RazonSocialPRO"] = cmbProveedor.Text;
            frmProgress progreso = new frmProgress(tblArticulos, "frmArticulos", "grabar");

            progreso.ShowDialog();
        }
 private void btnGrabar_Click(object sender, EventArgs e)
 {
     bindingSource1.EndEdit();
     if (tblEmpleadosMov.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblEmpleadosMov, "frmEmpleadosMov", "grabar");
         progreso.ShowDialog();
     }
 }
Ejemplo n.º 20
0
 private void Grabar()
 {
     if (tblArticulos.GetChanges() != null)
     {
         //    bindingSource1.MoveLast();
         frmProgress progreso = new frmProgress(tblArticulos, "frmArticulos", "grabar");
         progreso.ShowDialog();
         btnGrabar.Enabled = false;
     }
 }
Ejemplo n.º 21
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string whereLocales = null;
            string articulo = "";
            string descripcion = "";
            Cursor.Current = Cursors.WaitCursor;
            string idLocal;
            foreach (DataRowView filaLocal in lstLocales.SelectedItems)
            {
                idLocal = filaLocal.Row[0].ToString();
                whereLocales += "IdLocalSTK LIKE '" + idLocal + "' OR ";
            }
            whereLocales = whereLocales.Substring(0, whereLocales.Length - 4);
            if (rdArticulo.Checked == true)
            {
                articulo = txtParametros.Text;
            }
            else
            {
                descripcion = txtParametros.Text;
            }
            string origen = "frmStock";
            string accion = "cargar";
            frmProgress newMDIChild = new frmProgress(origen, accion, whereLocales, proveedor, articulo, descripcion);
            newMDIChild.ShowDialog();
            tblStock = frmProgress.dtEstatico.Tables[0];
            if (rdPantalla.Checked == true)
            {
                try
                {
                    DataColumn columnaPivot = tblStock.Columns["NombreLOC"];
                    DataColumn valorPivot = tblStock.Columns["Cantidad"];
                    dtCruzada = BL.Utilitarios.Pivot(tblStock, columnaPivot, valorPivot);
                }
                catch
                {
                    if (whereLocales == null)
                    {
                        MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("No se encontraron artículos coincidentes", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    return;
                }
            }
            else
            {

            }
            frmStockInforme stockInforme = new frmStockInforme(dtCruzada);
            stockInforme.ShowDialog();
            Cursor.Current = Cursors.Arrow;
        }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     DataRow selectedDataRow = ((DataRowView)lstLocales.SelectedItem).Row;
     int idLocal = Convert.ToInt32(selectedDataRow["IdLocalLOC"]);
     string strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
     string strFechaHasta = dateTimeHasta.Value.ToString("yyyy-MM-dd 00:00:00");
     if (rdDetalle.Checked == true) //informe detalle
     {
         try
         {
             string tipoMov = "compensaciones";
             string opcMov = "entradas";
             string articulo = string.Empty;
             string descripcion = string.Empty;
             if (rdArticulo.Checked) articulo = txtParametros.Text;
             else descripcion = txtParametros.Text;
             string formularioOrigen = "frmStockMovInforme";
             string accionProgress = "cargar";
             frmProgress progreso = new frmProgress(strFechaDesde, strFechaHasta, idLocal, tipoMov, opcMov, formularioOrigen, accionProgress,
                 articulo, descripcion);
             progreso.ShowDialog();
             DataSet dsStockMov = frmProgress.dsStockMovCons;
                 frmStockMovInforme frm = new frmStockMovInforme(dsStockMov, tipoMov, articulo, descripcion);
                 frm.Show();
         }
         catch (NullReferenceException)
         {
             return;
         }
     }
     else // informe en pesos
     {
         try
         {
             frmProgress frm = new frmProgress(strFechaDesde, strFechaHasta, idLocal, "frmStockCompPesos", "cargar");
             frm.ShowDialog();
             DataTable tblStockCompPesos = frmProgress.tblEstatica;
             strFechaDesde = dateTimeDesde.Value.ToShortDateString();
             strFechaHasta = dateTimeHasta.Value.ToShortDateString();
             StockCompPesosRpt frmStockComp = new StockCompPesosRpt(tblStockCompPesos, strFechaDesde, strFechaHasta);
             frmStockComp.Show();
         }
         catch (NullReferenceException)
         {
             return;
         }
     }
 }
Ejemplo n.º 23
0
 private void frmEmpleadosMov_FormClosing(object sender, FormClosingEventArgs e)
 {
     e.Cancel = false; //
     bindingSource1.EndEdit();
     if (tblEmpleadosMov.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblEmpleadosMov, "frmEmpleadosMov", "grabar");
         progreso.ShowDialog();
     }
     bindingSource1.RemoveFilter();
 }
Ejemplo n.º 24
0
        void ActualizarArqueo()
        {
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                                + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar", frmInstanciaArqueo);

            frm.ShowDialog();
        }
Ejemplo n.º 25
0
        private void actualizarDatosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!BL.Utilitarios.ValidarServicioMysql())
            {
                string mensaje = "No se pudo establecer la conexión con el servidor de base de datos."
                                 + '\r' + "No se actualizaron los datos.";
                MessageBox.Show(this, mensaje, "Trend Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            frmProgress frm = new frmProgress("ActualizarDatos", "grabar");

            frm.ShowDialog();
        }
Ejemplo n.º 26
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstLocales.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (!BL.Utilitarios.ValidarServicioMysql())
     {
         string mensaje = "No se pudo establecer la conexión con el servidor de base de datos.";
         MessageBox.Show(this, mensaje, "Trend Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (rdTotales.Checked)
     {
         strLocales    = string.Empty;
         forma         = Convert.ToInt32(cmbForma.SelectedValue.ToString());
         strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
         dtFechaHasta  = dateTimeHasta.Value.AddDays(1);
         strFechaHasta = dtFechaHasta.ToString("yyyy-MM-dd 00:00:00");
         foreach (DataRowView filaLocal in lstLocales.SelectedItems)
         {
             idLocal     = filaLocal.Row[0].ToString();
             strLocales += "IdLocalLOC LIKE '" + idLocal + "' OR ";
         }
         strLocales = strLocales.Substring(0, strLocales.Length - 4);
         progreso   = new frmProgress(forma, strFechaDesde, strFechaHasta, strLocales, "frmVentasPesosCons", "cargar");
         progreso.ShowDialog();
         DataTable          tblVentasPesos = frmProgress.dsVentasPesosCons.Tables[0];
         frmVentasPesosCons frm            = new frmVentasPesosCons(tblVentasPesos);
         frm.Show();
     }
     else
     {
         string origen      = "frmVentasPesosInter_diarias";
         string accion      = "cargar";
         string fecha_desde = dateTimeDesde.Value.ToString("yyyy-MM-dd");
         dtFechaHasta = dateTimeHasta.Value.AddDays(1);
         string      fecha_hasta = dtFechaHasta.ToString("yyyy-MM-dd");
         int         local       = Convert.ToInt32(lstLocales.SelectedValue.ToString());
         string      formaPago   = cmbForma.Text;
         frmProgress newMDIChild = new frmProgress(fecha_desde, fecha_hasta, local, formaPago, origen, accion);
         newMDIChild.ShowDialog();
         DataTable tblVentasDiarias = frmProgress.tblEstatica;
         fecha_desde = dateTimeDesde.Value.ToString("dd-MM-yyyy");
         fecha_hasta = dateTimeHasta.Value.ToString("dd-MM-yyyy");
         string nombreLocal = lstLocales.Text;
         frmVentasPesosDiarias frmDiarias = new frmVentasPesosDiarias(tblVentasDiarias, fecha_desde, fecha_hasta, nombreLocal);
         frmDiarias.Show();
     }
 }
Ejemplo n.º 27
0
 private void frmArticulosGenerarApartir_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (tblArticulos.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE CREARON LOS ARTICULOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             tblArticulos.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblArticulos, "frmArticulosGenerar", "grabar");
         progreso.ShowDialog();
     }
 }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     fecha = dateTimePicker1.Value;
     idLocal = Convert.ToInt32(lstLocales.SelectedValue.ToString());
     nombreLocal = lstLocales.Text;
     idPc = Convert.ToInt32(lstPc.SelectedValue.ToString());
     frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar");
     frm.Show();
 }
Ejemplo n.º 29
0
        private void fondosDeCajaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            origen = "frmFondoCajaCons";
            accion = "cargar";
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                                + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            frmProgress newMDIChild = new frmProgress(origen, accion);

            newMDIChild.MdiParent = this;
            newMDIChild.Show();
        }
Ejemplo n.º 30
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if(lstLocales.SelectedIndex == -1)
            {
            MessageBox.Show("Debe seleccionar un local.", "Trend",MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (rdTotales.Checked)
            {
                strLocales = string.Empty;
                forma = Convert.ToInt32(cmbForma.SelectedValue.ToString());
                strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
                dtFechaHasta = dateTimeHasta.Value.AddDays(1);
                strFechaHasta = dtFechaHasta.ToString("yyyy-MM-dd 00:00:00");
                foreach (DataRowView filaLocal in lstLocales.SelectedItems)
                {
                    idLocal = filaLocal.Row[0].ToString();
                    strLocales += "IdLocalLOC LIKE '" + idLocal + "' OR ";

                }
                strLocales = strLocales.Substring(0, strLocales.Length - 4);
                progreso = new frmProgress(forma, strFechaDesde, strFechaHasta, strLocales, "frmVentasPesosCons", "cargar");
                progreso.ShowDialog();
                DataTable tblVentasPesos = frmProgress.dsVentasPesosCons.Tables[0];
                frmVentasPesosCons frm = new frmVentasPesosCons(tblVentasPesos);
                frm.Show();
            }
            else
            {
                string origen = "frmVentasPesosInter_diarias";
                string accion = "cargar";
                string fecha_desde = dateTimeDesde.Value.ToString("yyyy-MM-dd");
                dtFechaHasta = dateTimeHasta.Value.AddDays(1);
                string fecha_hasta = dtFechaHasta.ToString("yyyy-MM-dd");
                int local = Convert.ToInt32(lstLocales.SelectedValue.ToString());
                string formaPago = cmbForma.Text;
                frmProgress newMDIChild = new frmProgress(fecha_desde, fecha_hasta, local, formaPago, origen, accion);
                newMDIChild.ShowDialog();
                DataTable tblVentasDiarias = frmProgress.tblEstatica;
                fecha_desde = dateTimeDesde.Value.ToString("dd-MM-yyyy");
                fecha_hasta = dateTimeHasta.Value.ToString("dd-MM-yyyy");
                string nombreLocal = lstLocales.Text;
                frmVentasPesosDiarias frmDiarias = new frmVentasPesosDiarias(tblVentasDiarias, fecha_desde, fecha_hasta, nombreLocal);
                frmDiarias.Show();
            }
        }
Ejemplo n.º 31
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                                + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            fecha       = dateTimePicker1.Value;
            idLocal     = Convert.ToInt32(lstLocales.SelectedValue.ToString());
            nombreLocal = lstLocales.Text;
            idPc        = Convert.ToInt32(lstPc.SelectedValue.ToString());
            frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar");

            frm.Show();
        }
Ejemplo n.º 32
0
        private void button4_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            string          Connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Benja\\Desktop\\liquidacion.xlsx;Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";";
            OleDbConnection con        = new OleDbConnection(Connection);

            System.Data.DataTable tblPrecioNuevos = new System.Data.DataTable();
            OleDbDataAdapter      myCommand       = new OleDbDataAdapter("select * from [Hoja1$]", con);

            myCommand.Fill(tblPrecioNuevos);
            DataTable tblArticulos = BL.GetDataBLL.Articulos();

            foreach (DataRow rowPreciosNuevos in tblPrecioNuevos.Rows)
            {
                string articulo = rowPreciosNuevos["Articulo"].ToString();
                if (!string.IsNullOrEmpty(articulo))
                {
                    if (articulo.Length == 8)
                    {
                        articulo = "00" + articulo;
                    }
                    if (articulo.Length == 9)
                    {
                        articulo = "0" + articulo;
                    }
                    //  articulo = rowPreciosNuevos["Articulo"].ToString().Substring(0, rowPreciosNuevos["Articulo"].ToString().Length - 4);
                    articulo = articulo.Substring(0, articulo.Length - 4);
                    DataRow[] foundRow = tblArticulos.Select("IdArticuloART LIKE '" + articulo + "*'");
                    foreach (DataRow rowArticulos in foundRow)
                    {
                        if (!string.IsNullOrEmpty(rowPreciosNuevos["Makro"].ToString()) && !string.IsNullOrEmpty(rowPreciosNuevos["Jesus"].ToString()))
                        {
                            rowArticulos["PrecioPublicoART"] = rowPreciosNuevos["Makro"];
                            rowArticulos["PrecioMayorART"]   = rowPreciosNuevos["Jesus"];
                        }
                    }
                }
            }
            if (tblArticulos.GetChanges() != null)
            {
                frmProgress progreso = new frmProgress(tblArticulos, "frmArticulosGenerar", "grabar");
                progreso.ShowDialog();
            }
            Cursor.Current = Cursors.Arrow;
        }
Ejemplo n.º 33
0
 private void frmCondicionIva_FormClosing(object sender, FormClosingEventArgs e)
 {
     bindingSource1.EndEdit();
     if (tblCondicionIva.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             tblCondicionIva.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblCondicionIva, "frmCondicionIva", "grabar");
         progreso.ShowDialog();
     }
     bindingSource1.RemoveFilter();
 }
Ejemplo n.º 34
0
 void ActualizarArqueo()
 {
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar", frmInstanciaArqueo);
     }
     catch (ServidorMysqlInaccesibleException ex)
     {
         MessageBox.Show(ex.Message, "Trend Gestión",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     Cursor.Current = Cursors.Arrow;
 }
Ejemplo n.º 35
0
        void editVentas_FormClosed(object sender, FormClosedEventArgs e)
        {
            frmVentas formVentas = (frmVentas)sender;

            if (formVentas.Tag != null && formVentas.Tag.ToString() == "ActualizarArqueo")
            {
                DataSet dsVentas = formVentas.dsVentas;
                if (!BL.UtilDB.ValidarServicioMysql())
                {
                    MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                                    + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    dsVentas.RejectChanges();
                    return;
                }
                frmProgress progreso = new frmProgress(dsVentas, "frmVentas", "grabar");
                progreso.FormClosed += progreso_FormClosed;
                progreso.Show();
            }
        }
Ejemplo n.º 36
0
        private void importarDatosActualesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                                + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            frmProgress frm = new frmProgress("ImportarDatos", "grabar", true);

            try
            {
                frm.ShowDialog();
            }
            catch (WebException)
            {
                MessageBox.Show("No se pudo establecer conexión con el servidor remoto. No se actualizaron los datos.", "Trend Gestión",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 37
0
 private void btnBorrar_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(articulo) || !string.IsNullOrEmpty(descripcion))
     {
         MessageBox.Show("Las opciones 'Modificar' y/o 'Borrar' no están disponibles cuando se usaron criterios de búsqueda",
                         "Trend Gestión", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (dsStockMov.Tables[0].Rows.Count == 0)
     {
         return;
     }
     if (MessageBox.Show("¿Desea borrar este registro y todos los movimientos relacionados?", "Trend Gestión",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             return;
         }
         Cursor.Current = Cursors.WaitCursor;
         PK             = Convert.ToInt32(dgvStockMov.CurrentRow.Cells["IdMovMSTK"].Value.ToString());
         progreso       = new frmProgress(PK, "frmStockMov_borrar", "grabar");
         progreso.ShowDialog();
         if (codigoError != null)
         {
             Close();
             return;
         }
         viewStockMov.RowFilter = "IdMovMSTK = '" + PK + "'";
         foreach (DataRowView row in viewStockMov)
         {
             row.Delete();
         }
         tblStockMov.AcceptChanges();
         Cursor.Current = Cursors.Arrow;
     }
 }
Ejemplo n.º 38
0
 private void Grabar()
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("NO SE ACTUALIZARON LOS PRECIOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                         + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
         tblArticulos.RejectChanges();
         return;
     }
     foreach (DataGridViewRow row in dgvDatos.Rows)
     {
         if (row.Cells["Actualizar"].Value != null)
         {
             if (row.Cells["Actualizar"].Value.ToString() == "1")
             {
                 DataRowView[] foundRows = viewNuevos.FindRows(new object[] { row.Cells["IdArticuloART"].Value.ToString() });
                 foundRows[0].BeginEdit();
                 if (!String.IsNullOrEmpty(txtCosto.Text))
                 {
                     foundRows[0]["PrecioCostoART"] = txtCosto.Text;
                 }
                 if (!String.IsNullOrEmpty(txtPublico.Text))
                 {
                     foundRows[0]["PrecioPublicoART"] = txtPublico.Text;
                 }
                 if (!String.IsNullOrEmpty(txtMayor.Text))
                 {
                     foundRows[0]["PrecioMayorART"] = txtMayor.Text;
                 }
                 foundRows[0].EndEdit();
             }
         }
     }
     if (tblArticulos.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblArticulos, "frmArticulos", "grabar");
         progreso.ShowDialog();
     }
 }
Ejemplo n.º 39
0
        private void btnAgrupar_Click(object sender, EventArgs e)
        {
            frmProgress frm = new frmProgress("frmArticulosAgrupar", "cargar");

            try
            {
                frm.ShowDialog();
                if (frm.servidorCaidoExcepcion != null)
                {
                    MessageBox.Show(frm.servidorCaidoExcepcion.Message, "Trend Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                frm.Close();
            }
        }
Ejemplo n.º 40
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstLocales.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (string.IsNullOrEmpty(cmbForma.Text))
     {
         MessageBox.Show("Debe seleccionar una forma de pago.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             return;
         }
         int         forma      = Convert.ToInt32(cmbForma.SelectedValue.ToString());
         string      strDesde   = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
         DateTime    hasta      = dateTimeHasta.Value;
         string      strHasta   = hasta.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
         int         idLocal    = Convert.ToInt32(lstLocales.SelectedValue.ToString());
         string      parametros = txtParametros.Text;
         frmProgress frm        = new frmProgress(forma, strDesde, strHasta, idLocal, "frmVentasDetalleInter", "cargar", parametros);
         frm.ShowDialog();
         DataTable        tblVentasDetalleCons = frmProgress.tblEstatica;
         string           nombreLocal          = lstLocales.Text;
         VentasDetalleRpt ventas = new VentasDetalleRpt(tblVentasDetalleCons, nombreLocal);
         ventas.Show();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstLocales.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (string.IsNullOrEmpty(cmbForma.Text))
     {
         MessageBox.Show("Debe seleccionar una forma de pago.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             return;
         }
         int forma = Convert.ToInt32(cmbForma.SelectedValue.ToString());
         string strDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
         DateTime hasta = dateTimeHasta.Value;
         string strHasta = hasta.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
         int idLocal = Convert.ToInt32(lstLocales.SelectedValue.ToString());
         string parametros = txtParametros.Text;
         frmProgress frm = new frmProgress(forma, strDesde, strHasta, idLocal, "frmVentasDetalleInter", "cargar", parametros);
         frm.ShowDialog();
         DataTable tblVentasDetalleCons = frmProgress.tblEstatica;
         string nombreLocal = lstLocales.Text;
         VentasDetalleRpt ventas = new VentasDetalleRpt(tblVentasDetalleCons, nombreLocal);
         ventas.Show();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     string strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd");
     string strFechaHasta = dateTimeHasta.Value.ToString("yyyy-MM-dd");
     int idEmpleado;
     if (chkTodos.Checked != true)
     {
         idEmpleado = Convert.ToInt32(lstEmpleados.SelectedValue.ToString());
     }
     else
     {
         idEmpleado = 0;
     }
     int liquidado;
     if (chkLiquidado.Checked) liquidado = 1;
     else liquidado = 0;
     frmProgress progreso = new frmProgress(strFechaDesde, strFechaHasta, idEmpleado, liquidado, "frmEmpleadosMovConsInter", "cargar");
     progreso.ShowDialog();
     DataTable tbl = frmProgress.tblEstatica;
     frmEmpleadosMovCons frmCons = new frmEmpleadosMovCons(tbl);
     frmCons.Show();
 }
 private void btnBorrar_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(articulo) || !string.IsNullOrEmpty(descripcion))
     {
         MessageBox.Show("Las opciones 'Modificar' y/o 'Borrar' no están disponibles cuando se usaron criterios de búsqueda",
             "Trend Gestión", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (dsStockMov.Tables[0].Rows.Count == 0) return;
     if (MessageBox.Show("¿Desea borrar este registro y todos los movimientos relacionados?", "Trend Gestión",
             MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             return;
         }
         Cursor.Current = Cursors.WaitCursor;
         PK = Convert.ToInt32(dgvStockMov.CurrentRow.Cells["IdMovMSTK"].Value.ToString());
         progreso = new frmProgress(PK, "frmStockMov_borrar", "grabar");
         progreso.ShowDialog();
         if (codigoError != null)
         {
             Close();
             return;
         }
         viewStockMov.RowFilter = "IdMovMSTK = '" + PK + "'";
         foreach (DataRowView row in viewStockMov)
         {
             row.Delete();
         }
         tblStockMov.AcceptChanges();
         Cursor.Current = Cursors.Arrow;
     }
 }
Ejemplo n.º 44
0
        private void button4_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            string Connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Benja\\Desktop\\liquidacion.xlsx;Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";";
            OleDbConnection con = new OleDbConnection(Connection);
            System.Data.DataTable tblPrecioNuevos = new System.Data.DataTable();
            OleDbDataAdapter myCommand = new OleDbDataAdapter("select * from [Hoja1$]", con);
            myCommand.Fill(tblPrecioNuevos);
            DataTable tblArticulos = BL.GetDataBLL.Articulos();
            foreach (DataRow rowPreciosNuevos in tblPrecioNuevos.Rows)
            {
                string articulo = rowPreciosNuevos["Articulo"].ToString();
                if(!string.IsNullOrEmpty(articulo))
                {
                    if (articulo.Length == 8)
                        articulo = "00" + articulo;
                    if (articulo.Length == 9)
                        articulo = "0" + articulo;
                  //  articulo = rowPreciosNuevos["Articulo"].ToString().Substring(0, rowPreciosNuevos["Articulo"].ToString().Length - 4);
                    articulo = articulo.Substring(0, articulo.Length - 4);
                    DataRow[] foundRow = tblArticulos.Select("IdArticuloART LIKE '" + articulo + "*'");
                    foreach (DataRow rowArticulos in foundRow)
                    {
                        if (!string.IsNullOrEmpty(rowPreciosNuevos["Makro"].ToString()) && !string.IsNullOrEmpty(rowPreciosNuevos["Jesus"].ToString()))
                        {
                            rowArticulos["PrecioPublicoART"] = rowPreciosNuevos["Makro"];
                            rowArticulos["PrecioMayorART"] = rowPreciosNuevos["Jesus"];
                        }

                    }
                }
            }
            if (tblArticulos.GetChanges() != null)
            {
                frmProgress progreso = new frmProgress(tblArticulos, "frmArticulosGenerar", "grabar");
                progreso.ShowDialog();
            }
            Cursor.Current = Cursors.Arrow;
        }
 private void fondosDeCajaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     origen = "frmFondoCajaCons";
     accion = "cargar";
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     frmProgress newMDIChild = new frmProgress(origen, accion);
     newMDIChild.MdiParent = this;
     newMDIChild.Show();
 }
Ejemplo n.º 46
0
 private void actualizarDatos_Click(object sender, EventArgs e)
 {
     frmProgress newMDIChild = new frmProgress("ActualizarBD", "cargar");
     newMDIChild.MdiParent = this;
     newMDIChild.Show();
 }
 private void importarDatosToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     frmProgress frm = new frmProgress("ImportarDatos", "grabar", false);
     try
     {
         frm.ShowDialog();
     }
     catch (WebException)
     {
         MessageBox.Show("No se pudo establecer conexión con el servidor remoto. No se actualizaron los datos.", "Trend Gestión",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void dgvVentas_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0) return;
     if (e.ColumnIndex == dgvVentas.Columns["Editar"].Index)
     {
         string idVenta = dgvVentas.CurrentRow.Cells["IdVentaVEN"].Value.ToString();
         frmVentas ventas = new frmVentas(idVenta, idPc, tblVentas, tblVentasDetalle);
         ventas.FormClosed += editVentas_FormClosed;
         ventas.ShowDialog();
     }
     if (e.ColumnIndex == dgvVentas.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro y todos los movimientos relacionados?", "Trend Gestión",
                 MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                         + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
                 return;
             }
             int PK = Convert.ToInt32(dgvVentas.CurrentRow.Cells["IdVentaVEN"].Value.ToString());
             frmProgress frm = new frmProgress(PK, "frmArqueoCajaAdmin_borrarVenta", "grabar");
             frm.FormClosed += progreso_FormClosed;
             frm.Show();
         }
     }
 }
 private void frmArticulosGenerarApartir_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (tblArticulos.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE CREARON LOS ARTICULOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             tblArticulos.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblArticulos, "frmArticulosGenerar", "grabar");
         progreso.ShowDialog();
     }
 }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     DataRow selectedDataRow = ((DataRowView)lstLocales.SelectedItem).Row;
     int idLocal = Convert.ToInt32(selectedDataRow["IdLocalLOC"]);
     string strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
     string strFechaHasta = dateTimeHasta.Value.ToString("yyyy-MM-dd 00:00:00");
     string tipoMov = "movimientos";
     string opcMov;
     if (rdEntradas.Checked)
     {
         opcMov = "entradas";
     }
     else if (rdSalidas.Checked)
     {
         opcMov = "salidas";
     }
     else
     {
         opcMov = "todos";
     }
     string articulo = string.Empty;
     string descripcion = string.Empty;
     if (rdArticulo.Checked) articulo = txtParametros.Text;
     else descripcion = txtParametros.Text;
     string formularioOrigen = "frmStockMovInforme";
     string accionProgress = "cargar";
     frmProgress progreso = new frmProgress(strFechaDesde, strFechaHasta, idLocal, tipoMov, opcMov, formularioOrigen, accionProgress,
         articulo, descripcion);
     progreso.ShowDialog();
     DataSet dsStockMov = frmProgress.dsStockMovCons;
     if (rdPantalla.Checked)
     {
         try
         {
             frmStockMovInforme frm = new frmStockMovInforme(dsStockMov, tipoMov, articulo, descripcion);
             frm.Show();
         }
         catch (NullReferenceException)
         {
             return;
         }
     }
     else // impresora
     {
         try
         {
             string opcOrden;
             if (rdOrdenEntrada.Checked) opcOrden = "movimiento";
             else opcOrden = "Descripcion";
             StockMovRpt rpt = new StockMovRpt(dsStockMov, opcOrden);
             rpt.Show();
         }
         catch (NullReferenceException)
         {
             return;
         }
     }
 }
        private void btnAgrupar_Click(object sender, EventArgs e)
        {
            if (dgvDatosOrigen.Rows.Count == 0)
            {
                MessageBox.Show("Debe indicar un artículo de origen", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtParametrosOrigen.Focus();
                return;
            }
            if (dgvDatosDestino.Rows.Count == 0)
            {
                MessageBox.Show("Debe indicar un artículo de destino", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtParametrosDestino.Focus();
                return;
            }
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                        + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                tblArticulos.RejectChanges();
                return;
            }
            if (MessageBox.Show("La agrupación de artículos eliminará los artículos de origen. ¿Desea continuar?", "Trend", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
                == DialogResult.No) return;
            Cursor.Current = Cursors.WaitCursor;
            DataView viewStock = new DataView(tblStock);
            DataView viewArticulos = new DataView(tblArticulos);
            DataTable tblLocales = BL.GetDataBLL.Locales();
            DataView viewLocales = new DataView(tblLocales);
            viewLocales.RowFilter = "IdLocalLOC <> 1 AND IdLocalLOC <> 2";
            string articuloDestino = dgvDatosDestino.CurrentRow.Cells["IdArticuloART"].Value.ToString();
            int cantidadArticulos = 0;
            int cantidadDestino = 0;
            ArrayList articulosBorrar = new ArrayList();
            foreach (DataGridViewRow rowOrigen in dgvDatosOrigen.Rows)
            {
                if (rowOrigen.Cells["Agrupar"].Value != null)
                {
                    if (rowOrigen.Cells["Agrupar"].Value.ToString() == "1")
                    {
                        string articuloOrigen = rowOrigen.Cells["IdArticuloART"].Value.ToString();
                        foreach (DataRowView rowLocales in viewLocales)
                        {
                            string local = rowLocales["IdLocalLOC"].ToString();
                            if (local != "1" && local != "2")
                            {
                                viewStock.RowFilter = "IdLocalSTK = '" + local + "' AND IdArticuloSTK = '" + articuloOrigen + "'";
                                int cantidadOrigen = Convert.ToInt32(viewStock[0]["CantidadSTK"].ToString());
                                viewStock.RowFilter = "IdLocalSTK = '" + local + "' AND IdArticuloSTK = '" + articuloDestino + "'";
                                if (viewStock.Count > 0)
                                {
                                    cantidadDestino = Convert.ToInt32(viewStock[0]["CantidadSTK"].ToString());
                                    viewStock[0]["CantidadSTK"] = cantidadOrigen + cantidadDestino;
                                }
                                else // no existe el registro en la tabla stock. Lo agrego
                                {
                                    DataRowView rowView = viewStock.AddNew();
                                    rowView["IdArticuloSTK"] = articuloDestino;
                                    rowView["IdLocalSTK"] = local;
                                    rowView["CantidadSTK"] = cantidadOrigen;
                                    rowView.EndEdit();
                                }

                            }

                        }
                        articulosBorrar.Add(articuloOrigen); // agrego los articulos agrupados para luego borrarlos
                    }
                    cantidadArticulos++;
                }
            }
            if (cantidadArticulos == 0)
            {
                MessageBox.Show("Debe seleccionar un artículo de origen", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            // borro los articulos agrupados
            foreach (string borrado in articulosBorrar)
            {
                DataRow[] found = tblArticulos.Select("IdArticuloART = '" + borrado + "'");
                found[0].Delete();
            }
            //Actualizo el viewOrigen para reflejar los cambios en pantalla
            foreach (string borrado in articulosBorrar)
            {
                DataRow[] found = tblArticulosStock.Select("IdArticuloART = '" + borrado + "'");
                found[0].Delete();
            }
            Cursor.Current = Cursors.Arrow;
            if(tblArticulos.GetChanges() != null)
            {
                frmProgress frm = new frmProgress(tblArticulos, tblStock, "frmArticulosAgrupar", "grabar", instanciaArticulosAgrupar);
                frm.FormClosed += frmProgress_FormClosed;
                frm.ShowDialog();
            }
        }
 private void frmFondoCaja_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (txtImporte.Text == "") return;
     rowView.EndEdit();
     if (tblFondoCaja.GetChanges() != null)
     {
         DialogResult respuesta = MessageBox.Show("¿Confirma la grabación de datos?", "Trend Gestión",
             MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
         switch (respuesta)
         {
             case DialogResult.Yes:
                 if (!BL.UtilDB.ValidarServicioMysql())
                 {
                     MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
                     tblFondoCaja.RejectChanges();
                     return;
                 }
                 frmProgress progreso = new frmProgress(tblFondoCaja, "frmFondoCaja", "grabar");
                 progreso.ShowDialog();
                 break;
             case DialogResult.No:
                 break;
             case DialogResult.Cancel:
                 e.Cancel = true;
                 break;
         }
     }
 }
 void ActualizarArqueo()
 {
     if (!BL.UtilDB.ValidarServicioMysql())
     {
         MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                 + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                 MessageBoxIcon.Error);
         return;
     }
     frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar", frmInstanciaArqueo);
     frm.ShowDialog();
 }
 private void dgvTesoreria_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0) return;
     if (e.ColumnIndex == dgvTesoreria.Columns["Editar"].Index)
     {
         string PK = dgvTesoreria.CurrentRow.Cells["IdMovTESM"].Value.ToString();
         frmTesoreriaMov frm = new frmTesoreriaMov(idLocal, idPc, PK, tblTesoreria.Copy());
         frm.FormClosed += editTesoreria_FormClosed;
         frm.Show();
     }
     if (e.ColumnIndex == dgvTesoreria.Columns["Borrar"].Index)
     {
         if (MessageBox.Show("¿Desea borrar este registro?", "Trend Gestión",
                 MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
         {
             if (!BL.UtilDB.ValidarServicioMysql())
             {
                 MessageBox.Show("NO SE BORRARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                         + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
                 return;
             }
             int PK = Convert.ToInt32(dgvTesoreria.CurrentRow.Cells["IdMovTESM"].Value.ToString());
             frmProgress frm = new frmProgress(PK, "frmArqueoCajaAdmin_borrarTesoreria", "grabar");
             frm.FormClosed += progreso_FormClosed;
             frm.Show();
         }
     }
 }
 private void frmRazonSocial_FormClosing(object sender, FormClosingEventArgs e)
 {
     bindingSource1.EndEdit();
     if (tblRazonSocial.GetChanges() != null)
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             tblRazonSocial.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(tblRazonSocial, "frmRazonSocial", "grabar");
         progreso.ShowDialog();
     }
     bindingSource1.RemoveFilter();
 }
 void ActualizarArqueo()
 {
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         frmProgress frm = new frmProgress(fecha, idLocal, nombreLocal, idPc, "frmArqueoInter", "cargar", frmInstanciaArqueo);
     }
     catch (ServidorMysqlInaccesibleException ex)
     {
         MessageBox.Show(ex.Message, "Trend Gestión",
         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     Cursor.Current = Cursors.Arrow;
 }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if(lstLocales.SelectedIndex == -1)
            {
            MessageBox.Show("Debe seleccionar un local.", "Trend",MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!BL.UtilDB.ValidarServicioMysql())
            {
                MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                        + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                return;
            }
            if (rdTotales.Checked)
            {
                strFechaDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
                dtFechaHasta = dateTimeHasta.Value.AddDays(1);
                strFechaHasta = dtFechaHasta.ToString("yyyy-MM-dd 00:00:00");
                forma = Convert.ToInt32(cmbForma.SelectedValue.ToString());
                string genero;
                if (!string.IsNullOrEmpty(cmbGenero.Text)) genero = cmbGenero.SelectedValue.ToString();
                else genero = string.Empty;
                strLocales = string.Empty;
                foreach (DataRowView filaLocal in lstLocales.SelectedItems)
                {
                    idLocal = filaLocal.Row[0].ToString();
                    strLocales += "IdLocalLOC LIKE '" + idLocal + "' OR ";

                }
                strLocales = strLocales.Substring(0, strLocales.Length - 4);
                progreso = new frmProgress(forma, strFechaDesde, strFechaHasta, strLocales, "frmVentasPesosCons", "cargar", genero);
                progreso.ShowDialog();
                try
                {
                    DataTable tblVentasPesos = frmProgress.dsVentasPesosCons.Tables[0];
                    frmVentasPesosCons frm = new frmVentasPesosCons(tblVentasPesos);
                    frm.Show();
                }
                catch(NullReferenceException)
                {
                    MessageBox.Show("El servidor de base de datos no respondió a la solicitud. Intente nuevamente.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            else
            {
                string origen = "frmVentasPesosInter_diarias";
                string accion = "cargar";
                string fecha_desde = dateTimeDesde.Value.ToString("yyyy-MM-dd");
                dtFechaHasta = dateTimeHasta.Value.AddDays(1);
                string fecha_hasta = dtFechaHasta.ToString("yyyy-MM-dd");
                int local = Convert.ToInt32(lstLocales.SelectedValue.ToString());
                string forma = cmbForma.Text;
                frmProgress newMDIChild = new frmProgress(fecha_desde, fecha_hasta, local, forma, origen, accion);
                newMDIChild.ShowDialog();
                DataTable tblVentasDiarias = frmProgress.tblEstatica;
                fecha_desde = dateTimeDesde.Value.ToString("dd-MM-yyyy");
                fecha_hasta = dateTimeHasta.Value.ToString("dd-MM-yyyy");
                string nombreLocal = lstLocales.Text;
                frmVentasPesosDiarias frmDiarias = new frmVentasPesosDiarias(tblVentasDiarias, fecha_desde, fecha_hasta, nombreLocal);
                frmDiarias.Show();
            }
        }
 private void Grabar()
 {
     DataRow row = tblArticulos.Rows.Find(txtIdArticulo.Text);
     row["RazonSocialPRO"] = cmbProveedor.Text;
     frmProgress progreso = new frmProgress(tblArticulos, "frmArticulos", "grabar");
     progreso.ShowDialog();
 }
Ejemplo n.º 59
0
 private void frmCondicionIva_FormClosing(object sender, FormClosingEventArgs e)
 {
     bindingSource1.EndEdit();
     if (tblCondicionIva.GetChanges() != null)
     {
         frmProgress progreso = new frmProgress(tblCondicionIva, "frmCondicionIva", "grabar");
         progreso.ShowDialog();
     }
     bindingSource1.RemoveFilter();
 }
 void editVentas_FormClosed(object sender, FormClosedEventArgs e)
 {
     frmVentas formVentas = (frmVentas)sender;
     if (formVentas.Tag != null && formVentas.Tag.ToString() == "ActualizarArqueo")
     {
         DataSet dsVentas = formVentas.dsVentas;
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("NO SE ACTUALIZARON LOS DATOS." + '\r' + "No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             dsVentas.RejectChanges();
             return;
         }
         frmProgress progreso = new frmProgress(dsVentas, "frmVentas", "grabar");
         progreso.FormClosed += progreso_FormClosed;
         progreso.Show();
     }
 }