コード例 #1
0
        public override void FitColumns()
        {
            List <DataGridViewColumn> cols = new List <DataGridViewColumn>();
            CurrencyManager           cm;

            //Formato de Partidas_DGW
            cm = (CurrencyManager)BindingContext[Partidas_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            ProductoPartida.Tag = 1;

            cols.Add(ProductoPartida);

            ControlsMng.MaximizeColumns(Partidas_DGW, cols);

            //Formato de Stock_Grid
            cm = (CurrencyManager)BindingContext[Stock_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            ObservacionesStock.Tag = 1;

            cols.Add(ObservacionesStock);

            ControlsMng.MaximizeColumns(Stock_DGW, cols);

            //Formato de FacturasCostes_DGW
            cols.Clear();
            AcreedorFCoste.Tag = 1;

            cols.Add(AcreedorFCoste);

            ControlsMng.MaximizeColumns(FacturasCostes_DGW, cols);

            //Formato de ConceptosCostes_DGW
            cols.Clear();
            ConceptoConceptoCoste.Tag = 1;

            cols.Add(ConceptoConceptoCoste);

            ControlsMng.MaximizeColumns(ConceptosCostes_DGW, cols);

            //Formato de FGastos_DGW
            cols.Clear();
            AcreedorFGasto.Tag = 1;

            cols.Add(AcreedorFGasto);

            ControlsMng.MaximizeColumns(ExpensesInvoices_DGW, cols);

            //Formato de GastosGenericos_DGW
            cm = (CurrencyManager)BindingContext[InvoicedExpenses_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            DescripcionGastoGenerico.Tag = 1;

            cols.Add(DescripcionGastoGenerico);

            ControlsMng.MaximizeColumns(InvoicedExpenses_DGW, cols);

            //Formato de OtrosGastos_DGW
            cm = (CurrencyManager)BindingContext[Expenses_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            DescripcionOtroGasto.Tag = 1;

            cols.Add(DescripcionOtroGasto);

            ControlsMng.MaximizeColumns(Expenses_DGW, cols);

            //Formato de FacturasE_DGW
            cm = (CurrencyManager)BindingContext[FacturasE_DGW.DataSource];
            cm.SuspendBinding();

            cols = new List <DataGridViewColumn>();
            ClienteFacturaE.Tag = 1;

            cols.Add(ClienteFacturaE);

            ControlsMng.MaximizeColumns(FacturasE_DGW, cols);

            //Formato de ConceptosE_DGW
            cm = (CurrencyManager)BindingContext[ConceptosE_DGW.DataSource];
            cm.SuspendBinding();

            cols = new List <DataGridViewColumn>();
            DescripcionConceptoE.Tag = 1;

            cols.Add(DescripcionConceptoE);

            ControlsMng.MaximizeColumns(ConceptosE_DGW, cols);

            //Formato de Beneficios_DGW
            cm = (CurrencyManager)BindingContext[Benefits_DGW.DataSource];
            cm.SuspendBinding();

            cols          = new List <DataGridViewColumn>();
            BeProduct.Tag = 1;

            cols.Add(BeProduct);
            ControlsMng.MaximizeColumns(Benefits_DGW, cols);
        }
コード例 #2
0
        public override void FormatControls()
        {
            if (Tabla == null)
            {
                return;
            }

            base.FormatControls();

            List <DataGridViewColumn> cols = new List <DataGridViewColumn>();

            switch (_tipo_expediente)
            {
            case moleQule.Store.Structs.ETipoExpediente.Almacen:

                this.Icon = Properties.Resources.store;

                Kilos.DefaultCellStyle.Format       = "N0";
                StockKilos.DefaultCellStyle.Format  = "N0";
                StockBultos.DefaultCellStyle.Format = "N2";

                PuertoOrigen.Visible         = false;
                PuertoDestino.Visible        = false;
                Proveedor.Visible            = false;
                NombreCliente.Visible        = false;
                Naviera.Visible              = false;
                NombreTransOrigen.Visible    = false;
                NombreTransDest.Visible      = false;
                Contenedor.Visible           = false;
                FechaDespachoDestino.Visible = false;
                FechaEmbarque.Visible        = false;
                FechaLlegadaMuelle.Visible   = false;
                FechaSalidaMuelle.Visible    = false;
                FechaRegresoMuelle.Visible   = false;

                Observaciones.Tag = 0.6;
                TipoMercancia.Tag = 0.4;

                cols.Add(Observaciones);
                cols.Add(TipoMercancia);

                break;

            case moleQule.Store.Structs.ETipoExpediente.Alimentacion:

                this.Icon = Properties.Resources.alimentacion;

                Kilos.DefaultCellStyle.Format       = "N0";
                StockKilos.DefaultCellStyle.Format  = "N0";
                StockBultos.DefaultCellStyle.Format = "N2";

                Observaciones.Tag = 0.3;
                Proveedor.Tag     = 0.2;
                NombreCliente.Tag = 0.15;
                TipoMercancia.Tag = 0.35;

                cols.Add(Observaciones);
                cols.Add(Proveedor);
                cols.Add(NombreCliente);
                cols.Add(TipoMercancia);

                break;

            case moleQule.Store.Structs.ETipoExpediente.Ganado:
                try
                {
                    this.Icon = Properties.Resources.ganado;

                    Tabla.Columns.Remove(TipoMercancia.Name);
                    Tabla.Columns.Remove(StockKilos.Name);
                    Tabla.Columns.Remove(StockBultos.Name);

                    Kilos.HeaderText       = "Cabezas";
                    Kilos.Width            = TextRenderer.MeasureText("Cabezas ", this.Font).Width;
                    Kilos.DataPropertyName = "NCabezas";

                    Observaciones.Tag = 0.6;
                    Proveedor.Tag     = 0.2;
                    NombreCliente.Tag = 0.2;

                    cols.Add(Observaciones);
                    cols.Add(Proveedor);
                    cols.Add(NombreCliente);
                }
                catch { }
                break;

            case moleQule.Store.Structs.ETipoExpediente.Maquinaria:
                try
                {
                    this.Icon = Properties.Resources.maquinaria;

                    Tabla.Columns.Remove(TipoMercancia.Name);
                    Tabla.Columns.Remove(StockKilos.Name);
                    Tabla.Columns.Remove(StockBultos.Name);

                    Kilos.HeaderText       = "Máquinas";
                    Kilos.Width            = TextRenderer.MeasureText("Máquinas ", this.Font).Width;
                    Kilos.DataPropertyName = "NMaquinas";

                    Observaciones.Tag = 0.6;
                    Proveedor.Tag     = 0.2;
                    NombreCliente.Tag = 0.2;

                    cols.Add(Observaciones);
                    cols.Add(Proveedor);
                    cols.Add(NombreCliente);
                }
                catch { }
                break;

            case moleQule.Store.Structs.ETipoExpediente.Project:
            case moleQule.Store.Structs.ETipoExpediente.Work:

                this.Icon = (_tipo_expediente == moleQule.Store.Structs.ETipoExpediente.Work)
                                    ? Properties.Resources.work
                                    : Properties.Resources.project;

                TipoMercancia.HeaderText = "Descripción";

                Kilos.DefaultCellStyle.Format       = "N0";
                StockKilos.DefaultCellStyle.Format  = "N0";
                StockBultos.DefaultCellStyle.Format = "N2";
                Kilos.Visible       = false;
                StockKilos.Visible  = false;
                StockBultos.Visible = false;

                PuertoOrigen.Visible         = false;
                PuertoDestino.Visible        = false;
                Proveedor.Visible            = false;
                Naviera.Visible              = false;
                NombreTransOrigen.Visible    = false;
                NombreTransDest.Visible      = false;
                Contenedor.Visible           = false;
                FechaDespachoDestino.Visible = false;
                FechaLlegadaMuelle.Visible   = false;
                FechaSalidaMuelle.Visible    = false;

                FechaEmbarque.Visible         = true;
                FechaEmbarque.HeaderText      = "Fecha Inicio";
                FechaRegresoMuelle.Visible    = true;
                FechaRegresoMuelle.HeaderText = "Fecha Fin";

                NombreCliente.Tag = 0.2;
                Observaciones.Tag = 0.4;
                TipoMercancia.Tag = 0.4;

                cols.Add(NombreCliente);
                cols.Add(Observaciones);
                cols.Add(TipoMercancia);

                break;

            case moleQule.Store.Structs.ETipoExpediente.Todos:
                try
                {
                    TipoMercancia.Tag = 0.3;
                    Observaciones.Tag = 0.3;
                    Proveedor.Tag     = 0.2;
                    NombreCliente.Tag = 0.2;

                    cols.Add(TipoMercancia);
                    cols.Add(Observaciones);
                    cols.Add(Proveedor);
                    cols.Add(NombreCliente);
                }
                catch { }
                break;
            }

            ControlsMng.MaximizeColumns(Tabla, cols);

            Face.ControlTools.Instance.CopyBasicStyle(CompleteStyle);
            CompleteStyle.BackColor = Color.Gainsboro;

            Face.ControlTools.Instance.CopyBasicStyle(MarkedStyle);
            MarkedStyle.BackColor = Color.LightGreen;

            Face.ControlTools.Instance.CopyBasicStyle(UnmarkedStyle);
            UnmarkedStyle.ForeColor          = Color.Transparent;
            UnmarkedStyle.SelectionForeColor = Color.Transparent;
        }
コード例 #3
0
        public override void FitColumns()
        {
            base.FitColumns();

            List <DataGridViewColumn> cols;
            CurrencyManager           cm;

            cm = (CurrencyManager)BindingContext[Works_DGW.DataSource];
            cm.SuspendBinding();

            cols = new List <DataGridViewColumn>();
            WoDescription.Tag = 0.4;
            WoComments.Tag    = 0.6;

            cols.Add(WoDescription);
            cols.Add(WoComments);

            ControlsMng.MaximizeColumns(Works_DGW, cols);

            cm = (CurrencyManager)BindingContext[WorkReport_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRComments.Tag = 1;

            cols.Add(WRComments);

            ControlsMng.MaximizeColumns(WorkReport_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRStaff_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRStResource.Tag = 1;

            cols.Add(WRStResource);

            ControlsMng.MaximizeColumns(WRStaff_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRStaffWorks_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRStWoResource.Tag = 1;

            cols.Add(WRStWoResource);

            ControlsMng.MaximizeColumns(WRStaffWorks_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRTools_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRToResource.Tag = 1;

            cols.Add(WRToResource);

            ControlsMng.MaximizeColumns(WRTools_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRToolsWorks_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRToWoResource.Tag = 1;

            cols.Add(WRToWoResource);

            ControlsMng.MaximizeColumns(WRToolsWorks_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRDeliveries_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRDeComments.Tag = 1;

            cols.Add(WRDeComments);

            ControlsMng.MaximizeColumns(WRDeliveries_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRDeliveriesWorks_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRDeWoComments.Tag = 1;

            cols.Add(WRDeWoComments);

            ControlsMng.MaximizeColumns(WRDeliveriesWorks_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRCategories_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRCaCategory.Tag = 1;

            cols.Add(WRCaCategory);

            ControlsMng.MaximizeColumns(WRCategories_DGW, cols);
        }
コード例 #4
0
        public override void FitColumns()
        {
            base.FitColumns();

            List <DataGridViewColumn> cols;
            CurrencyManager           cm;

            cm = (CurrencyManager)BindingContext[WorkReport_DGW.DataSource];
            cm.SuspendBinding();

            cols           = new List <DataGridViewColumn>();
            WRComments.Tag = 1;

            cols.Add(WRComments);

            ControlsMng.MaximizeColumns(WorkReport_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRStaff_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRStaffResource.Tag = 1;

            cols.Add(WRStaffResource);

            ControlsMng.MaximizeColumns(WRStaff_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRTools_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRToolsResource.Tag = 1;

            cols.Add(WRToolsResource);

            ControlsMng.MaximizeColumns(WRTools_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRDeliveries_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRDeliveriesComments.Tag = 1;

            cols.Add(WRDeliveriesComments);

            ControlsMng.MaximizeColumns(WRDeliveries_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRCategories_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRCategoriesCategory.Tag = 1;

            cols.Add(WRCategoriesCategory);

            ControlsMng.MaximizeColumns(WRCategories_DGW, cols);

            cm = (CurrencyManager)BindingContext[WRCategoriesDetail_DGW.DataSource];
            cm.SuspendBinding();

            cols.Clear();
            WRCategoriesDetailCategory.Tag = 1;

            cols.Add(WRCategoriesDetailCategory);

            ControlsMng.MaximizeColumns(WRCategoriesDetail_DGW, cols);
        }