private void contextMenuStrip1_MouseClick(object sender, MouseEventArgs e)
        {
            if (contextMenuStrip1.Items[1].Selected)
            {
                if (FlatMessageBox.Show("¿Está seguro de eliminar el archivo?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    FtpWebRequest request = (FtpWebRequest)WebRequest.Create(sRutaActual + lvCarpetas.SelectedItems[0].Text);
                    request.Method      = WebRequestMethods.Ftp.DeleteFile;
                    request.Credentials = new NetworkCredential(FTPCredentials.User, FTPCredentials.Password);
                    FtpWebResponse response = (FtpWebResponse)request.GetResponse();
                    response.Close();
                    UpdateList();
                }
            }
            else if (contextMenuStrip1.Items[2].Selected)
            {
                // Opción para descargar el archivo seleccionado
                DownloadData.sRutaArchivo   = sRutaActual;
                DownloadData.sNombreArchivo = lvCarpetas.SelectedItems[0].Text;

                frmDescargarArchivos DownloadFile = new frmDescargarArchivos();
                DownloadFile.StartPosition = FormStartPosition.Manual;
                DownloadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - DownloadFile.Width) - 10
                                                       , (Screen.PrimaryScreen.WorkingArea.Height - DownloadFile.Height) - 10);
                DownloadFile.ShowDialog();
            }
            else if (contextMenuStrip1.Items[4].Selected)
            {
                UpdateList();
            }
        }
Пример #2
0
        private void DeleteMenu()
        {
            var currentMenu = bsMenu.Current as Menu;

            if (currentMenu == null)
            {
                return;
            }

            if (FlatMessageBox.Show("Are you sure?", "Delete", DialogButtons.YesNo, DialogType.Warning) ==
                DialogButton.Yes)
            {
                using (var context = UnitOfWork.Factory.Instance())
                {
                    var menu = context.Menus.GetById(currentMenu.Id);

                    menu.Flag = false;

                    context.SaveChanges();

                    FillMenus(true);

                    FlatMessageAlert.Show("Delete Successful.", alertType: AlertType.Delete);
                }
            }
        }
        private void UpdateProductDetails(DbRepository dbRepository)
        {
            if (!ValidateRequiredFields())
            {
                return;
            }
            if (!ValidateDuplicateRecord())
            {
                return;
            }
            if (FlatMessageBox.Show("Do you want to update the changes?", "Update Product", DialogButtons.YesNo,
                                    DialogType.Question) == DialogButton.Yes)
            {
                var repository      = dbRepository;
                var selectedProduct = repository.Products.GetById(GetProductId());
                {
                    selectedProduct.ProductCode      = txtProductCode.Text.Trim();
                    selectedProduct.ProductName      = txtProductCode.Text.Trim();
                    selectedProduct.SalesRate        = decimal.Parse(txtSalesRate.Text);
                    selectedProduct.PurchaseRate     = decimal.Parse(txtPurchaseRate.Text);
                    selectedProduct.Unit             = txtUnit.Text.Trim();
                    selectedProduct.Description      = txtDescription.Text.Trim();
                    selectedProduct.Quantity         = int.Parse(txtQuantity.Text);
                    selectedProduct.DateTimeModified = DateTime.Now;
                    //selectedProduct.ModifiedBy = AccountSession.GetAccount.Id;
                };
                repository.Commit();
            }

            MessageAlert.Show("Successfully Changed");
            ResetToDefault();
        }
        public void btnNuevo_Click(object sender, EventArgs e)
        {
            //ASIGNA NOMBRE Y FILTRO DE ARCHIVOS AL CONTROL OPENFILEDIALOG
            openFileDialogDocumentos.Title = "Subir Archivos";
            //openFileDialogDocumentos.Filter = "Pdf Files|*.pdf |JPG|*.jpg;*.jpeg |Excel Files|*.xls;*.xlsx;*.xlsm |txt files (*.txt)|*.txt|Zip Files|*.zip;*.rar";
            openFileDialogDocumentos.FileName = "";

            string sRuta = lblRuta.Text;

            if (openFileDialogDocumentos.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DownloadData.sRutaArchivo   = sRutaActual;
                    DownloadData.sNombreArchivo = openFileDialogDocumentos.FileName;

                    frmSubirArchivos UploadFile = new frmSubirArchivos();

                    UploadFile.StartPosition = FormStartPosition.Manual;
                    UploadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - UploadFile.Width) - 10
                                                         , (Screen.PrimaryScreen.WorkingArea.Height - UploadFile.Height) - 10);

                    UploadFile.ShowDialog();
                    UpdateList();
                }
                catch (Exception ex)
                {
                    FlatMessageBox.Show(ex.Message, "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                }
            }
        }
Пример #5
0
 private void btnComisionPagada_Click(object sender, EventArgs e)
 {
     if (FlatMessageBox.Show("¿Está seguro de cambiar el estado de pago de esta comisión?", "SI", "CANCELAR", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
     {
         var rowHandle = gridView1.FocusedRowHandle;
         if (new ComisionVendedor().bPagarComision(new ComisionVendedor()
         {
             iIdOperacionComisionista = int.Parse(gridView1.GetRowCellValue(rowHandle, "iIdOperacionComisionista").ToString()),
             sNoOperacionBancaria = string.Empty,
             dComisionF = Decimal.Parse(gridView1.GetRowCellValue(rowHandle, "dComision").ToString()),
             sFechaPago = dtFechaFactura.Value.ToString()
         }) == true)
         {
             btnComisionPagada.Visible      = false;
             dtFechaFactura.Enabled         = false;
             txtNoOperacionBancaria.Enabled = false;
             gridView1.SetRowCellValue(rowHandle, "sPagado", "True");
             gridView1.SetRowCellValue(rowHandle, "sNoOperacionBancaria", txtNoOperacionBancaria.Text);
             gridView1.SetRowCellValue(rowHandle, "sFechaPago", dtFechaFactura.Value);
             FlatMessageBox.Show("Estado de Pago cambiado con exito.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
         }
         else
         {
             FlatMessageBox.Show("No se Pudo Cambiar el Estado de Pago.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
         }
     }
 }
Пример #6
0
        private void btnGuardar_Click(Object sender, EventArgs e)
        {
            if (ValidarCampos() == 0)
            {
                int iResultado = SaveChang();
                if (iResultado == 1)
                {
                    frmPagos _Pagos = Application.OpenForms["frmPagos"] as frmPagos;
                    if (_Pagos != null)
                    {
                        _Pagos.cargarPagos();
                    }

                    _DialogResult = DialogResult.Yes;
                    //_AsignarFactCon.Close();
                }
                else if (iResultado == 0)
                {
                    FlatMessageBox.Show("Error al guardar en la base de datos", "OK", string.Empty, FlatMessageBoxIcon.Error);
                }
                else if (iResultado == -1)
                {
                    FlatMessageBox.Show("Error de conexión, reintente en un momento", "OK", string.Empty, FlatMessageBoxIcon.Error);
                }
            }
        }
Пример #7
0
        private void btnFacturaPagada_Click(object sender, EventArgs e)
        {
            if (FlatMessageBox.Show("¿Está seguro de cambiar el estado de pago de esta factura?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
            {
                if (new Operacion().bPagarFactura(new Operacion()
                {
                    iIdOperacion = int.Parse(lblNoOperacion.Name),
                    iIdVendedor = int.Parse(lblCliente.Name),
                    dFechaFactura = dtFechaFactura.Value,
                    dFechaPago = dtFechaDeposito.Value,
                    iNoSemana = int.Parse(cmbxNoSemana.Text)
                }) == true)
                {
                    btnFacturaPagada.Visible = false;
                    dtFechaFactura.Enabled   = false;
                    dtFechaDeposito.Enabled  = false;

                    var rowHandle = gridView1.FocusedRowHandle;
                    gridView1.SetRowCellValue(rowHandle, "sFechaFactura", dtFechaFactura.Value);
                    gridView1.SetRowCellValue(rowHandle, "sFechaDeposito", dtFechaDeposito.Value);


                    FlatMessageBox.Show("Factura pagada correctamente", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
                }
                else
                {
                    FlatMessageBox.Show("No se pudo cambiar el estado de pago de esta factura, ya que existe una factura anterior, no pagada.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
                }
            }
        }
Пример #8
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     //CREA NUEVO REGISTRO DE PAPEL DE TRABAJO Y OPERACIÓN
     if (new PapelTrabajo().CrearPapelTrabajo(new PapelTrabajo()
     {
         iIdVendedor = vendedor.iIdCliente,
         iIdTipoFactura = int.Parse(cmbxTipoFactura.SelectedValue.ToString()),
         sNoOperacion = txtNoOperacion.Text,
         dImporte = dImporteRepartirAlimentos,
         sNoFactura = txtNoFactura.Text,
         dtFechaFactura = dtFechaFactura.Value,
         dtFechaDeposito = dtFechaDeposito.Value,
         iIdUsuario = vendedor.iIdVendedor,
         sUUID = txtUuid.Text
     }) == 1)
     {
         FlatMessageBox.Show("Factura guardada correctamente", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
         LimpiarControles();
         btnGuardar.Visible = false;
     }
     else
     {
         FlatMessageBox.Show("Error al guardar la factura", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
     }
 }
Пример #9
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (ValidateArchivoPago())
            {
                if (FlatMessageBox.Show("¿Está seguro de actualizar la declaración?.", "SI", "NO", FlatMessageBoxIcon.Question) == DialogResult.Yes)
                {
                    // Cambiamos el estado de los controles
                    EstadoControles(false);
                    btnGuardar.Visible = false;
                    pgbCarga.Visible   = true;

                    // Recogemos la información de la declaración en variables
                    iIdPeriodo         = int.Parse(_Editar.cbPeriodo.SelectedValue.ToString());
                    sIdDeclaracionTipo = _Editar.cbDecTipo.SelectedValue.ToString();
                    sIdDecEstado       = _Editar.cbEstadoPago.SelectedValue.ToString();
                    iAnio               = int.Parse(_Editar.cmbxAnioDeclaracion.Text);
                    sLinCap             = txbLCaptura.Text.ToUpper();
                    sNumOper            = txbNumOperacion.Text.ToUpper();
                    dMonto              = Decimal.Parse(MoneyToDecimal(txbMonto.Text));
                    sLlavePago          = txbLlavePago.Text.ToUpper();
                    dtFechaLimitePago   = dpFechaLimitePago.Value;
                    dtFechaPresentacion = dpFPresentacion.Value;
                    dtFechaPag          = _Editar.dtFechaPago.Visible ? dtFechaPago.Value : (DateTime?)null;
                    iIdDeclaracionModo  = int.Parse(cmbxTipoDeclaracion.SelectedValue.ToString());
                    sEstadoPago         = cbEstadoPago.Text;

                    sDecTipoTx = cbDecTipo.Text;

                    // Recogemos el listado de conceptos de la declaración en una lista
                    RegistrosConceptos = new List <LogicaCC.LexaSIOContaLogica.RegistroConcepto>();
                    foreach (DataGridViewRow row in grdConceptos.Rows)
                    {
                        if (int.Parse(row.Cells[0].Value.ToString()) < 0)
                        {
                            LogicaCC.LexaSIOContaLogica.RegistroConcepto item = new LogicaCC.LexaSIOContaLogica.RegistroConcepto()
                            {
                                iIdConcepto    = int.Parse(row.Cells[1].Value.ToString()),
                                sEstado        = row.Cells[3].Value.ToString(),
                                dMonto         = decimal.Parse(row.Cells[4].Value.ToString()),
                                dActualizacion = decimal.Parse(row.Cells[5].Value.ToString()),
                                dRecargos      = decimal.Parse(row.Cells[6].Value.ToString()),
                                dMultas        = decimal.Parse(row.Cells[7].Value.ToString()),
                                dTotal         = decimal.Parse(row.Cells[8].Value.ToString()),
                                iIdDeclaracion = _Editar.iIdStatement
                            };
                            RegistrosConceptos.Add(item);
                        }
                    }
                    // Inciamos el guardado de la declaración
                    bgwDeclaracion.RunWorkerAsync();
                }
            }
            else
            {
                FlatMessageBox.Show("Archivo de pago vacío.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
Пример #10
0
        private void btnGuardar_Click(Object sender, EventArgs e)
        {
            if (ValidarDeclaracion() == 0)
            {
                string sFechaLimPag       = string.Format("{0}/{1}/{2}", dtpFechaPago.Value.Day, dtpFechaPago.Value.Month, dtpFechaPago.Value.Year);
                string sFechaPresentacion = string.Format("{0}/{1}/{2}", dtpFPresentacion.Value.Day, dtpFPresentacion.Value.Month, dtpFPresentacion.Value.Year);

                int iIdDeclaracion = new LogicaCC.LexaSIOContaLogica.Declaracion().AddStatement(new LogicaCC.LexaSIOContaLogica.Declaracion()
                {
                    iIdCliente         = iIdCliente,                     //4,//int.Parse(ACliente.sIdCliente),
                    iIdPeriodo         = int.Parse(cmbxPeriodo.SelectedValue.ToString()),
                    sIdDeclaracionTipo = cmbxDeclaracion.SelectedValue.ToString(),
                    sIdDecEstado       = cbEstadoPago.SelectedValue.ToString(),
                    sIdUsuario         = AUsuario.sIdusuario,
                    sAñoDec            = DateTime.Now.Year.ToString(),                     //txbAño.Text,
                    sLinCap            = txtLCaptura.Text.ToUpper(),
                    sNumOper           = txtNumOperacion.Text.ToUpper(),
                    sMonto             = txtMonto.Text,
                    sLlavePago         = txtLlavePago.Text.ToUpper(),
                    sFechaLimPag       = sFechaLimPag,
                    sFechaPresentacion = sFechaPresentacion,
                    iIdDeclaracionModo = int.Parse(cmbxTipoDeclaracion.SelectedValue.ToString())
                });
                if (iIdDeclaracion > 0)
                {
                    foreach (DataGridViewRow row in grdConceptos.Rows)
                    {
                        new LogicaCC.LexaSIOContaLogica.RegistroConcepto().InsertarRegistroObligacion(new LogicaCC.LexaSIOContaLogica.RegistroConcepto()
                        {
                            iIdConcepto    = int.Parse(row.Cells[0].Value.ToString()),
                            sEstado        = row.Cells[2].Value.ToString(),
                            dMonto         = decimal.Parse(row.Cells[3].Value.ToString()),
                            dActualizacion = decimal.Parse(row.Cells[4].Value.ToString()),
                            dRecargos      = decimal.Parse(row.Cells[5].Value.ToString()),
                            dMultas        = decimal.Parse(row.Cells[6].Value.ToString()),
                            dTotal         = decimal.Parse(row.Cells[7].Value.ToString()),
                            iIdDeclaracion = iIdDeclaracion
                        });
                    }

                    FlatMessageBox.Show("Declaración guardada exitosamente.", "OK", string.Empty, FlatMessageBoxIcon.Information);
                    LimpiarControles();
                    dTotal = 0;
                }
                else
                {
                    FlatMessageBox.Show("Error al guardar la informacion.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                }


                //foreach (DataGridViewRow row in grdConceptos.Rows)
                //{
                //	string sMensaje = string.Format("{1}{0}{2}{0}{3}{0}{4}", Environment.NewLine, row.Cells[0].Value.ToString(), row.Cells[1].Value.ToString(), row.Cells[2].Value.ToString(), row.Cells[3].Value.ToString());
                //	MessageBox.Show(sMensaje);
                //}
            }
        }
Пример #11
0
 private void bgwDeclaracion_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     pgbCarga.Visible    = false;
     txtRutaArchivo.Text = string.Empty;
     openFileDialogDocumento.FileName = "";
     btnBuscar_Click(sender, e);
     FlatMessageBox.Show("Declaración guardada exitosamente.", "OK", string.Empty, FlatMessageBoxIcon.Information);
     LimpiarControles();
     btnGuardar.Visible = true;
 }
Пример #12
0
 private void LnkComision_Click(object sender, EventArgs e)
 {
     //CAMBIA EL ESTADO DE PAGO DE UNA COMISIÓN Y ACTUALIZA LA LISTA DE COMISIONES PARA REFLEJAR LOS CAMBIOS
     MetroFramework.Controls.MetroLink Link = sender as MetroFramework.Controls.MetroLink;
     if (FlatMessageBox.Show("¿Está seguro de cambiar el estado de pago de esta comisión?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
     {
         Comision comision = new Comision();
         new Comision().marcarPagada(int.Parse(Link.Name));
         btnMostrarPagadas_Click(sender, e);
     }
 }
Пример #13
0
        public void PagarBono()
        {
            var rowHandle = gridView1.FocusedRowHandle;

            if (FlatMessageBox.Show(string.Format("¿Está seguro de cambiar el etado de pago{0}de este bono?", Environment.NewLine), "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
            {
                if (new LogicaCC.LexaSIOOperLogica.Bono().iPagaBono(int.Parse(gridView1.GetRowCellValue(rowHandle, "iIdBonoUsuario").ToString()), int.Parse(AUsuario.sIdusuario)) == 1)
                {
                    FlatMessageBox.Show("Cambio exitoso", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
                }
            }
        }
Пример #14
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         //REALIZA BUSQUEDA DE DECLARIONES PENDIENTES DE UN CLIENTE
         pnlDeclaraciones.Controls.Clear();
         cargarDeclaraciones(Cliente.iIdCliente);
     }
     catch (Exception)
     {
         FlatMessageBox.Show(string.Format("El cliente que intentas buscar, aun no tiene{0}obligaciones fiscales asignadas, contacte{1}con sus supervisor.", Environment.NewLine, Environment.NewLine), "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
     }
 }
Пример #15
0
        /// <summary>
        /// Carga el listado de declaraciones y los muestra en controles
        /// </summary>
        /// <param name="iIdCliente"></param>
        public void cargarDeclaraciones(int iIdCliente)
        {
            //REALIZA BÚSQUEDA DE DECLARACIONES DE UN CLIENTE EN ESPECIFICO
            DeclaracionEstado declaracionEstado = new DeclaracionEstado();

            declaraciones = declaracionEstado.listaDeclaracion(iIdCliente);

            if (declaraciones.Count > 0)
            {
                //SE CREA UNA LISTA DINAMICA DE DECLARACIONES PEDIENTES
                for (int i = 0; i < declaraciones.Count; i++)
                {
                    Button btnDeclaracion = new Button();
                    btnDeclaracion.Location  = new Point(1, 24 * i + 0);
                    btnDeclaracion.Name      = declaraciones[i].iIdDeclaracionTipo.ToString();
                    btnDeclaracion.Text      = declaraciones[i].sDeclaracionTipo;
                    btnDeclaracion.Width     = pnlDeclaraciones.Width - 1;                           //260, 40
                    btnDeclaracion.Height    = 23;
                    btnDeclaracion.FlatStyle = FlatStyle.Flat;
                    btnDeclaracion.FlatAppearance.BorderSize         = 0;
                    btnDeclaracion.FlatAppearance.MouseOverBackColor = Color.FromArgb(236, 239, 241);   //33, 69, 129// 246, 164, 0
                    btnDeclaracion.TextAlign = ContentAlignment.MiddleLeft;
                    btnDeclaracion.Font      = new Font("Arial", 9, FontStyle.Regular);
                    btnDeclaracion.ForeColor = Color.Black;                           //.FromArgb(105, 105, 105);
                    btnDeclaracion.Cursor    = Cursors.Hand;
                    //Creamos el evento Click del boton
                    btnDeclaracion.Click += BtnDeclaracion_Click;

                    Button btnEstado = new Button();
                    btnEstado.Location  = new Point(0, 24 * i + 0);
                    btnEstado.Width     = 3;
                    btnEstado.Height    = 23;
                    btnEstado.BackColor = Color.FromArgb(63, 81, 181);
                    btnEstado.Text      = "";
                    btnEstado.FlatStyle = FlatStyle.Flat;
                    btnEstado.FlatAppearance.BorderSize         = 0;
                    btnEstado.FlatAppearance.MouseDownBackColor = Color.FromArgb(63, 81, 181);
                    btnEstado.FlatAppearance.MouseOverBackColor = Color.FromArgb(63, 81, 181);

                    pnlDeclaraciones.Controls.Add(btnEstado);
                    pnlDeclaraciones.Controls.Add(btnDeclaracion);
                }
            }
            else
            {
                FlatMessageBox.Show(string.Format("No se encontraron declaraciones pendientes{0}para este cliente.", Environment.NewLine), "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
            }
        }
Пример #16
0
        private void btnAgregarConcepto_Click(object sender, EventArgs e)
        {
            //AGREGAMOS UN NUEVO CONCEPTO DE LA LISTA DE CONCEPTOS AL GRIDVIEW GRDCONCEPTOS
            if (cmbxConcepto.SelectedIndex != -1 && txtImporte.Text != string.Empty)
            {
                string sTotal = (decimal.Parse(string.IsNullOrEmpty(txtImporte.Text) ? "0" : txtImporte.Text)
                                 + decimal.Parse(string.IsNullOrEmpty(txtActualizacion.Text) ? "0" : txtActualizacion.Text)
                                 + decimal.Parse(string.IsNullOrEmpty(txtRecargos.Text)      ? "0" : txtRecargos.Text)
                                 + decimal.Parse(string.IsNullOrEmpty(txtMultas.Text)        ? "0" : txtMultas.Text)).ToString();

                int iIdNewConcept = 0 - (NewConcepts.Count() + 1);

                LogicaCC.LexaSIOContaLogica.RegistroConcepto NewConcept = new LogicaCC.LexaSIOContaLogica.RegistroConcepto()
                {
                    iIdRegistroConcepto = iIdNewConcept,
                    iIdConcepto         = int.Parse(cmbxConcepto.SelectedValue.ToString()),
                    sConcepto           = cmbxConcepto.Text,
                    sEstado             = string.Empty,
                    dMonto         = string.IsNullOrEmpty(txtImporte.Text)      ? 0 : Decimal.Parse(txtImporte.Text),
                    dActualizacion = string.IsNullOrEmpty(txtActualizacion.Text)? 0 : Decimal.Parse(txtActualizacion.Text),
                    dRecargos      = string.IsNullOrEmpty(txtRecargos.Text)     ? 0 : Decimal.Parse(txtRecargos.Text),
                    dMultas        = string.IsNullOrEmpty(txtMultas.Text)       ? 0 : Decimal.Parse(txtMultas.Text),
                    dTotal         = Decimal.Parse(sTotal)
                };
                NewConcepts.Add(NewConcept);
                ConceptsStatement.Add(NewConcept);

                dTotal = dTotal + decimal.Parse(sTotal);

                decimal dTo = ConceptsStatement.Sum(x => x.dTotal);

                txbMonto.Text = dTo.ToString("C2");

                cmbxConcepto.SelectedIndex = -1;
                txtImporte.Text            = "";
                txtActualizacion.Text      = "";
                txtRecargos.Text           = "";
                txtMultas.Text             = "";

                grdConceptos.DataSource = null;
                grdConceptos.DataSource = ConceptsStatement;
            }
            else
            {
                FlatMessageBox.Show("No campos vacios", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
Пример #17
0
 private void btnCancelarFactura_Click(object sender, EventArgs e)
 {
     if (FlatMessageBox.Show("¿Está seguro de cancelar esta factura?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
     {
         if (new Operacion().bCancelarFactura(new Operacion()
         {
             iIdOperacion = int.Parse(lblNoOperacion.Name),
             sComentario = txtComentario.Text
         }) == true)
         {
             cargarComisionitas(int.Parse(cmbxNoSemana.Text), 2, 1, int.Parse(cmbxAño.SelectedValue.ToString()));
             FlatMessageBox.Show("Factura cancelada correctamente.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
             lnkCerrarPagoComisiones_Click(sender, e);
             btnCancelarCanFac_Click(sender, e);
         }
     }
 }
Пример #18
0
        private void openFileDialogDocumento_FileOk(object sender, CancelEventArgs e)
        {
            //VALIDA EL TAMAÑO DE ARCHIVO SELECCIONADO
            int iTamanio = 0;

            foreach (string fileName in openFileDialogDocumento.FileNames)
            {
                FileInfo info = new FileInfo(fileName);
                iTamanio = iTamanio + int.Parse(info.Length.ToString());
            }

            if (iTamanio > 31457280)
            {
                e.Cancel = true;
                FlatMessageBox.Show(string.Format("Limite de tamaño de archivos superados{0}El tamaño maximo es de 30Mb.", Environment.NewLine), "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
        public void cargarInformacion()
        {
            //INFORMACIÓN DEL CLIENTE
            Cliente = new Cliente().InformacionCliente(txtCliente.Text, iIdUsuario);
            if (Cliente != null)
            {
                lblCampoRequerido.Visible = false;
                //lblCliente.Text             = string.Format("{0} {1} {2}", Cliente.sNombre, Cliente.sAPaterno, Cliente.sAMaterno);
                txtNombre.Text            = string.Format("{0} {1} {2}", Cliente.sNombre, Cliente.sAPaterno, Cliente.sAMaterno);
                txtRfc.Text               = Cliente.sRfc;
                txtTelefono.Text          = Cliente.sTelefono;
                txtCelular.Text           = Cliente.sNumeroMovil;
                txtExtension.Text         = Cliente.sExtension;
                txtCorreoElectronico.Text = Cliente.sCorreoElectronico;

                if (Cliente.iIdRegimen == 2)
                {
                    ovalPictureBox1.Image = Properties.Resources.skyscrapers_96px;
                }
                else
                {
                    ovalPictureBox1.Image = Properties.Resources.circled_user_male_skin_type_1_2_96px;
                }

                pnlInformacion.Visible = true;


                //lblDomicilio.Text           = string.Format("{0}, {1}", Cliente.sDireccion, Cliente.sMunicipio);
                //lblCp.Text                  = Cliente.sCodigoPostal;

                //CARGAMOS LISTA DE OBLIGACIONES FISCALES
                cargarObligaciones(txtCliente.Text);
                //EstadoControles(true);
                //pnlInformacionObligacion.Visible = false;
            }
            else
            {
                //EstadoControles(false);
                //lblCampoRequerido.Text              = "*No se encontro el cliente";

                //pnlInformacionObligacion.Visible    = false;
                FlatMessageBox.Show(string.Format("El cliente que intentas buscar, aun no tiene{0}obligaciones fiscales asignadas, contacte{1}con sus supervisor.", Environment.NewLine, Environment.NewLine), "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
 private void cargarCliente(string sCliente)
 {
     if (FTPServer.DirectoryExists(string.Format("{0}/{1}/", FTPCredentials.Path, ConnectionString.FolderConnection), FTPCredentials.User, FTPCredentials.Password, sCliente))
     {
         //FlatMessageBox.Show("Expediente encontrado", "OK", string.Empty, FlatMessageBoxIcon.Information);
         //LLenar();
         directories.Clear();
         lvCarpetas.Items.Clear();
         lvCarpetas.Visible        = true;
         separatorControl1.Visible = true;
         //lnkAtras.Visible    = true;
         //lnkAdelante.Visible = true;
         backgroundWorker1.RunWorkerAsync();
     }
     else
     {
         FlatMessageBox.Show("No se encontro el expediente del cliente", "OK", string.Empty, FlatMessageBoxIcon.Warning);
     }
 }
Пример #21
0
 private void btnObligacionCumplida_Click(object sender, EventArgs e)
 {
     //CONDICIÓN SI EXISTE UNA RUTA DE ARCHIVO
     if (openFileDialogDocumento.FileName.ToString() != string.Empty)
     {
         if (FlatMessageBox.Show(string.Format("¿Está seguro de marcar como{0}cumplida esta obligación fiscal?", Environment.NewLine), "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
         {
             //SE ACTUALIZA EL ESTADO DE CUMPLIMIENTO DE LA OBLIGACIÓN SELECCIONADA
             btnObligacionCumplida.Visible = false;
             pnlObligaciones.Enabled       = false;
             btnSubirArchivo.Enabled       = false;
             pgbCarga.Visible = true;
             bgwObligacion.RunWorkerAsync();
         }
     }
     else
     {
         FlatMessageBox.Show("No se ha seleccionado un archivo", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
     }
 }
Пример #22
0
        private void btnGenerarDeclaracion_Click(Object sender, EventArgs e)
        {
            if (FlatMessageBox.Show("¿Esta seguro de generar esta obligación?", "SI", "NO", FlatMessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    if (_DetalleObligacion.iIdDetalleObligacion > 0)
                    {
                        int iResultado = 1;
                        iResultado = new RegistroObligacion().AddRecordatorio(new RegistroObligacion()
                        {
                            iIdDetalleObligacion       = _DetalleObligacion.iIdDetalleObligacion,
                            iIdCliente                 = Cliente.iIdCliente,
                            iIdUsuarioRegistra         = int.Parse(AUsuarioData.sIdusuario),
                            sFechaCumplimientoVerde    = detalleObligacion.sfechaVerde,
                            sFechaCumplimientoAmarillo = detalleObligacion.sfechaAmarillo,
                            sFechaCumplimientoRojo     = detalleObligacion.sfechaRojo
                        });

                        if (iResultado > 0)
                        {
                            cargarObligaciones(sCliente);
                            ControlesVisibles(false);
                            FlatMessageBox.Show("Obligacion Guardada", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
                        }
                        else if (iResultado == 0)
                        {
                            FlatMessageBox.Show("Error al guardar en la base de datos", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                        }
                        else if (iResultado == -1)
                        {
                            FlatMessageBox.Show("Error de conexión, reintente en un momento", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void btnGuardarISR_Click(Object sender, EventArgs e)
        {
            LogicaCC.Logica.UsuarioData AUsuarioData = LogicaCC.Logica.UsuarioData.Instancia;
            //RECORREMOS LA LISTA PARA GUARDAR LOS REGISTROS DE LAS OBLIGACIONES MARCADAS
            foreach (Control control in this.pnlListaObligaciones.Controls)
            {
                if (control is LollipopCheckBox)
                {
                    LollipopCheckBox checkbox = control as LollipopCheckBox;
                    if (checkbox.Checked)
                    {
                        new RegistroObligacion().insertarRegistroObligacion(new RegistroObligacion()
                        {
                            iIdUsuarioRegistra   = int.Parse(AUsuarioData.sIdusuario),
                            iIdDetalleObligacion = int.Parse(checkbox.Name),
                            iIdCliente           = Cliente.iIdCliente
                        });
                    }
                }
            }
            bISRH = false;
            bISRA = false;

            FlatMessageBox.Show("Cambios Guardados Correctamente", "OK", string.Empty, FlatMessageBoxIcon.Information);

            EstadoControles(false);
            lblNombre.Text            = "--";
            lblRfc.Text               = "--";
            lblTelefono.Text          = "--";
            lblCelular.Text           = "--";
            lblExtension.Text         = "--";
            lblCorreoElectronico.Text = "--";
            materialLabel2.Visible    = false;
            btnHonorarios.Visible     = false;
            btnArrendamiento.Visible  = false;
            btnAsimilados.Visible     = false;

            pnlListaObligaciones.Controls.Clear();
            txtCliente.Clear();
            txtCliente.Focus();
        }
Пример #24
0
        private void btnGuardar_Click(Object sender, EventArgs e)
        {
            int iResultado = 0;

            iResultado = new Comisionista().UpdateInfoComisionista(int.Parse(AUsuario.sIdusuario), _Comisionista.iIdComisionista, txtIdBancario.Text, txtBanco.Text);

            if (iResultado == 1)
            {
                FlatMessageBox.Show("Operación exitosa", "OK", string.Empty, FlatMessageBoxIcon.Information);
                _DialogResult = DialogResult.Yes;
                _AsigIdBanMan.Close();
            }
            else if (iResultado == 0)
            {
                FlatMessageBox.Show("Error al actualizar en la base de datos", "OK", string.Empty, FlatMessageBoxIcon.Error);
            }
            else if (iResultado == -1)
            {
                FlatMessageBox.Show("Error de conexión, reintente en un momento", "OK", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
Пример #25
0
 private void lnkCancelarFactura_Click(object sender, EventArgs e)
 {
     //if(MessageBox.Show("¿Está seguro de cancelar esta factura?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     if (FlatMessageBox.Show("¿Está seguro de cancelar esta factura?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
     {
         pnlComentario.Visible           = true;
         panel2.Enabled                  = false;
         dtFechaDeposito.Enabled         = false;
         dtFechaFactura.Enabled          = false;
         lnkCerrarPagoComisiones.Enabled = false;
         label12.Enabled                 = false;
         lblNoFactura.Enabled            = false;
         label16.Enabled                 = false;
         lblImporteTotal.Enabled         = false;
         label18.Enabled                 = false;
         label17.Enabled                 = false;
         btnFacturaPagada.Enabled        = false;
         lblNoOperacion.Enabled          = false;
         txtComentario.Focus();
     }
 }
        private void DeleteProduct()
        {
            if (!ValidateSelectedRecord())
            {
                return;
            }

            if (FlatMessageBox.Show("Selected product will be deleted. Do you want to continue?", "Delete Product", DialogButtons.YesNo, DialogType.Warning) ==
                DialogButton.Yes)
            {
                using (var repository = new DbRepository(new DatabaseContext()))
                {
                    var selectedProduct = repository.Products.GetById(GetProductId());
                    if (selectedProduct != null)
                    {
                        repository.Products.Remove(selectedProduct);
                        repository.Commit();
                        MessageAlert.Show("Product successfully removed from the list", "Deleted", AlertType.Delete);
                        ShowProducts();
                    }
                }
            }
        }
        private void SaveNewProduct(DbRepository repository)
        {
            if (!ValidateRequiredFields())
            {
                return;
            }
            if (!ValidateDuplicateRecord())
            {
                return;
            }

            var productRepository = repository;

            if (FlatMessageBox.Show("Do you want to save new product?", "Update Product", DialogButtons.YesNo,
                                    DialogType.Question) == DialogButton.Yes)
            {
                var newProduct = new Products()
                {
                    ProductCode     = txtProductCode.Text.Trim(),
                    ProductName     = txtProductCode.Text.Trim(),
                    SalesRate       = decimal.Parse(txtSalesRate.Text),
                    PurchaseRate    = decimal.Parse(txtPurchaseRate.Text),
                    Unit            = txtUnit.Text.Trim(),
                    Description     = txtDescription.Text.Trim(),
                    Quantity        = int.Parse(txtQuantity.Text),
                    DateTimeCreated = DateTime.Now,
                    IsActive        = true
                };
                productRepository.Products.Add(newProduct);
                productRepository.Commit();
            }



            ResetToDefault();
            MessageAlert.Show("New product has successfully added.", "New Product", AlertType.Info);
        }
Пример #28
0
        public void btnPagarTodas_Click(object sender, EventArgs e)
        {
            //if (MessageBox.Show("¿Está seguro de cambiar el estado de pago de las comisiones?, solo se cambiaran las que se muestran actualmente.", "Pagar Comisiones", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            if (FlatMessageBox.Show("¿Desea cambiar el estado de pago de las comisiones?" + Environment.NewLine + "Solo se cambiaran las que se muestran actualmente.", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
            {
                string sNoPagadas = string.Empty;
                for (int i = 0; i < gridView1.DataRowCount; i++)
                {
                    //DataRow row = gridView1.GetDataRow(i);
                    //string name = row["Importe"].ToString();
                    //string name = string.Format("Comisión: {0}{1}Importe: {2}{1}NoOperación: {3}", Convert.ToString(gridView1.GetRowCellValue(i, "iIdOperacionComisionista")), Environment.NewLine, Convert.ToString(gridView1.GetRowCellValue(i, "dImporte")), Convert.ToString(gridView1.GetRowCellValue(i, "sNoOperacionBancaria")));
                    //MessageBox.Show(name);

                    if (new ComisionVendedor().bPagarComision(new ComisionVendedor()
                    {
                        iIdOperacionComisionista = int.Parse(gridView1.GetRowCellValue(i, "iIdOperacionComisionista").ToString()),
                        sNoOperacionBancaria = string.Empty,
                        dComisionF = decimal.Parse(gridView1.GetRowCellValue(i, "dComision").ToString()),
                        sFechaPago = DateTime.Now.ToString()
                    }) == false)
                    {
                        sNoPagadas = sNoPagadas + Convert.ToString(gridView1.GetRowCellValue(i, "sNoFactura")) + Environment.NewLine;
                    }
                }

                cmbxNoSemana_SelectionChangeCommitted(sender, e);
                if (string.IsNullOrEmpty(sNoPagadas))
                {
                    FlatMessageBox.Show("Todas las comisiones fueran cambiadas a pagadas exitosamente.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Information);
                }
                else
                {
                    FlatMessageBox.Show(string.Format("Cambio terminado, no se pudo cambiar el estado{0}de pago de algunas comisiones.{0}{1}", Environment.NewLine, sNoPagadas), "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
                }
            }
        }
Пример #29
0
        private void lnkGuardarArchivoPago_Click(object sender, EventArgs e)
        {
            string sPathFile = new Adjunto().GetPathAttachment(_Editar.iIdStatement);

            if (!string.IsNullOrEmpty(sPathFile))
            {
                DownloadData.sRutaArchivo   = string.Format("ftp://{0}", Path.GetDirectoryName(sPathFile)).Replace(@"\", "/");
                DownloadData.sNombreArchivo = Path.GetFileName(sPathFile);

                frmDescargarArchivos DownloadFile = new frmDescargarArchivos();
                DownloadFile.StartPosition = FormStartPosition.Manual;
                DownloadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - DownloadFile.Width) - 10
                                                       , (Screen.PrimaryScreen.WorkingArea.Height - DownloadFile.Height) - 10);
                DownloadFile.ShowDialog();
            }
            else if (sPathFile == "Error de Conexión")
            {
                FlatMessageBox.Show("Error de Conexón", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
            }
            else if (string.IsNullOrEmpty(sPathFile))
            {
                FlatMessageBox.Show("No se encontro el archivo adjunto", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }
Пример #30
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (FlatMessageBox.Show("¿Está seguro de cambiar el estado de" + Environment.NewLine + "pago de esta declaración?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
            {
                // Cambiamos el estado de los controles
                EstadoControles(false);
                btnGuardar.Visible = false;
                pgbCarga.Visible   = true;

                // Recogemos la información de la declaración en variables
                sEstadoPagoTx = cbEstadoPago.Text;
                iEstadoPago   = cbEstadoPago.SelectedIndex;
                sLlavePag     = txbLlavePago.Text;
                dtFechaPa     = dtFechaPago.Value;
                sDecTipo      = txtDecTipo.Name.ToString();
                sDecTipoTx    = txtDecTipo.Text;

                if (openFileDialogDocumento.FileName != string.Empty && sLlavePag != string.Empty)
                {
                    if (sEstadoPagoTx == "PAGADA" || sEstadoPagoTx == "Pagada")
                    {
                        // Inciamos el guardado de la declaración
                        bgwDeclaracion.RunWorkerAsync();
                    }
                    else
                    {
                        //SE GUARDA EL ESTADO DE LA DECLARACIÓN
                        new DeclaracionEstado().UpdateDeclaracion(iIdDeclaracion, iEstadoPago + 1, string.Empty, null);
                    }
                }
                else
                {
                    FlatMessageBox.Show("No se ha seleccionado un archivo o no ha ingresado la llave de pago.", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
                }
            }
        }