Exemplo n.º 1
0
        void Actualizar(DateTime initDate, DateTime finDate)
        {
            while (tablaOrdenes.RowCount > 0)
            {
                tablaOrdenes.Rows.RemoveAt(0);
            }

            var ordenes = OrdenController.I.GetListaBetween(initDate, finDate);

            foreach (Orden item in ordenes)
            {
                datatable.Rows.Add(item.Id, item.Folio, item.Cliente.Nombre, OrdenStatusManager.ToString(item.Status));
            }

            tablaOrdenes.DataSource = datatable;

            tablaOrdenes.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
            tablaOrdenes.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            tablaOrdenes.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            tablaOrdenes.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            tablaOrdenes.Columns[0].Resizable    = DataGridViewTriState.False;
            tablaOrdenes.Columns[1].Resizable    = DataGridViewTriState.True;
            tablaOrdenes.Columns[2].Resizable    = DataGridViewTriState.True;
            tablaOrdenes.Columns[3].Resizable    = DataGridViewTriState.True;
            tablaOrdenes.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            tablaOrdenes.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            tablaOrdenes.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }
Exemplo n.º 2
0
 private void SrchDetailInfo_Load(object sender, EventArgs e)
 {
     lblID.Text            = orden.Id.ToString();
     lblFolio.Text         = orden.Folio.ToString();
     lblEstado.Text        = OrdenStatusManager.ToString(orden.Status);
     lblObservaciones.Text = orden.Observaciones;
     lblTelefono.Text      = c.Telefono;
     lblCliente.Text       = c.Nombre;
     lblDireccion.Text     = c.Direccion;
     lblRecepcion.Text     = orden.FechaRecepcion.ToString("dd/MM/yyyy");
     lblEntrega.Text       = orden.FechaEntrega.GetValueOrDefault(DateTime.MinValue).ToString("dd/MM/yyyy");
     lblMecanico.Text      = mecanicos;
     lblMet_Pago.Text      = TipoPagoManager.ToString(orden.TipoPago ?? -1);
     lblReferencia.Text    = orden.Referencia ?? "INDEFINIDA";
     lblEquipo.Text        = orden.Equipo;
 }
        private void DrawChart()
        {
            //chart1.Series.Clear();

            //string Serie = "Series1";
            var values = Enum.GetValues(typeof(OrdenStatus));

            int[]    y = new int[values.Length];
            string[] x = new string[values.Length];

            int i = 0;

            foreach (int ordenStatus in values)
            {
                x[i] = OrdenStatusManager.ToString(ordenStatus);
                y[i] = OrdenHistorialController.I.GetCountByStatusBetween(ordenStatus, _initDate, _finDate);
                i++;
            }

            //chart1.Series.Add(Serie);
            chart1.Series[0].Points.DataBindXY(x, y);
            chart1.ChartAreas[0].AxisX.LabelStyle.Angle        = -45;
            chart1.ChartAreas[0].AxisX.LabelStyle.ForeColor    = Color.FromKnownColor(KnownColor.ControlLight);
            chart1.ChartAreas[0].AxisY.LabelStyle.ForeColor    = Color.FromKnownColor(KnownColor.ControlLight);
            chart1.ChartAreas[0].AxisX.MajorTickMark.LineColor = Color.FromKnownColor(KnownColor.ControlDark);
            chart1.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.FromKnownColor(KnownColor.ControlDark);
            //chart1.Series[0].BorderWidth = 5;
            //chart1.Series[0].IsValueShownAsLabel = true;
            //chart1.Series[0]["RadarDrawingStyle"] = "Line";
            //chart1.Series[0]["CircularLabelsStyle"] = "Horizontal";
            //chart1.Series[Serie]["AreaDrawingStyle"] = AreaDrawingStyle[(AreaSelected) ? 0 : 1];
            //chart1.ChartAreas["ChartArea1"].AxisX.Maximum = esc;
            //chart1.ChartAreas["ChartArea1"].AxisY.Maximum = esc;
            //chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineWidth = 1;
            //chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineWidth = 1;
            //chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineColor = Color.LightGray;
            //chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineColor = Color.LightGray;
            //chart1.ChartAreas["ChartArea1"].AxisX.LineColor = chart1.BackColor;
            //chart1.ChartAreas["ChartArea1"].AxisY.LineColor = Color.LightGray;
            //chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;
        }
Exemplo n.º 4
0
 private void tablaOrdenes_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
 {
     if (tablaOrdenes.Columns[e.ColumnIndex].Name == "Estado")
     {
         if (tablaOrdenes.Rows[e.RowIndex].Cells["Estado"].Value.ToString() == OrdenStatusManager.ToString((int)OrdenStatus.CANCELADA))
         {
             tablaOrdenes.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Firebrick;
         }
         else
         {
             tablaOrdenes.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.ControlDark);
         }
     }
 }