public frmRecursosEmpleado()
 {
     daoPromocion = new PromocionWS.PromocionWSClient();
     daoReporte   = new ReporteWS.ReporteWSClient();
     InitializeComponent();
     misPromocions = daoPromocion.listarPromocionPorZona("", DateTime.MinValue, DateTime.MaxValue, Program.empleado.zona.idZona);
     if (misPromocions == null)
     {
         pnlPromocion.Visible = false;
     }
 }
Esempio n. 2
0
        public frmBuscarPromocion()
        {
            daoPromocion = new PromocionWS.PromocionWSClient();
            InitializeComponent();
            dgv = dgvPromociones;
            dtpFechaInicio.Value = DateTime.Today.AddMonths(-3);
            dtpFechaFIn.Value    = DateTime.Today.AddMonths(3);
            completarTabla();
            #region colores de seleccion
            dgvPromociones.ColumnHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.ColumnHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromociones.RowHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.RowHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromociones.RowsDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.RowsDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);
            #endregion
        }
Esempio n. 3
0
        public frmGestionarPromociones()
        {
            daoPromocion = new PromocionWS.PromocionWSClient();
            InitializeComponent();
            dgv = dgvPromociones;
            dgvPromociones.AutoGenerateColumns = false;
            recargarDGV();

            #region colores de seleccion
            dgvPromociones.ColumnHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.ColumnHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromociones.RowHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.RowHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromociones.RowsDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromociones.RowsDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);
            #endregion
        }
Esempio n. 4
0
        public frmNuevaPromocion()
        {
            InitializeComponent();
            #region colores de seleccion
            dgvPromocionXProducto.ColumnHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.ColumnHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromocionXProducto.RowHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.RowHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromocionXProducto.RowsDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.RowsDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);
            #endregion

            daoPromocion          = new PromocionWS.PromocionWSClient();
            daoPromocionXProducto = new PromocionXProductoWS.PromocionXProductoWSClient();
            daoZona               = new ZonaWS.ZonaWSClient();
            cboZona.DataSource    = new BindingList <ZonaWS.zona>(daoZona.listarZonas().ToArray());
            cboZona.ValueMember   = "idZona";
            cboZona.DisplayMember = "nombre";

            if (frmVentanaPrincipal.nBtn == 1)
            {   //OBTNER DATOS DE FILA SELECCIONADA
                PromocionWS.promocion miPromocion = new PromocionWS.promocion();

                if (Program.pantallas[Program.pantallas.Count - 1].Formulario.Name == "frmGestionarPromociones")
                {
                    frmGestionarPromociones.promocionSeleccionada = (PromocionWS.promocion)frmGestionarPromociones.dgv.CurrentRow.DataBoundItem;
                    miPromocion = frmGestionarPromociones.promocionSeleccionada;
                }
                else
                {
                    frmBuscarPromocion.promocionSeleccionada = (PromocionWS.promocion)frmBuscarPromocion.dgv.CurrentRow.DataBoundItem;
                    miPromocion = frmBuscarPromocion.promocionSeleccionada;
                }
                txtId.Text            = miPromocion.idPromocion.ToString();
                txtNombre.Text        = miPromocion.nombre;
                txtDescripcion.Text   = miPromocion.descripcion;
                dtpFechaInicio.Value  = miPromocion.fechaInicio;
                dtpFechaFin.Value     = miPromocion.fechaFin;
                cboZona.SelectedValue = miPromocion.zona.idZona;
                //Listar los productos de la promoción.
                txtDescuento.Enabled      = false;
                txtStock.Enabled          = false;
                btnAddProducto.Enabled    = false;
                btnRemoveProducto.Enabled = false;
                btnBuscarProducto.Enabled = false;
                cboZona.Enabled           = false;
                int idPromocion = miPromocion.idPromocion;
                PromocionXProductoWS.promocionXProducto[] auxPromoXProd = daoPromocionXProducto.listarPromocionXProducto(idPromocion);
                if (auxPromoXProd.Length == 0)
                {
                    misPromocionXProducto = new BindingList <PromocionXProductoWS.promocionXProducto>();
                }
                else
                {
                    misPromocionXProducto = new BindingList <PromocionXProductoWS.promocionXProducto>(auxPromoXProd.ToList());
                }
                cargarTabla();
            }
            else
            {
                misPromocionXProducto = new BindingList <PromocionXProductoWS.promocionXProducto>();
                cargarTabla();
            }

            #region colores de seleccion
            dgvPromocionXProducto.ColumnHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.ColumnHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromocionXProducto.RowHeadersDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.RowHeadersDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);

            dgvPromocionXProducto.RowsDefaultCellStyle.SelectionBackColor = Program.colorR;
            dgvPromocionXProducto.RowsDefaultCellStyle.SelectionForeColor = ThemeColor.ChangeColorBrightness(Program.colorR, -0.7);
            #endregion
        }