Exemplo n.º 1
0
        private void btnLapPhieu_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckOpenedTabs("Phiếu sửa chữa"))
                {
                    string       ngaySuaChua = String.Format("{0:MM/dd/yyyy}", DateTime.Now);
                    string       maPSC       = PhieuSuaChuaBLL.AutoMAPSC();
                    PhieuSuaChua psc         = new PhieuSuaChua(maPSC, txtBienSo.Text, DateTime.Now, 0);
                    PhieuSuaChuaBLL.ThemPhieuSuaChua(psc);

                    TabItem tab = tabControl.CreateTab("Phiếu sửa chữa");
                    tab.PredefinedColor = eTabItemColor.Yellow;
                    frmPhieuSuaChua _frmPhieuSuaChua = new frmPhieuSuaChua(tabControl, tab);
                    _frmPhieuSuaChua.maPSC         = maPSC;
                    _frmPhieuSuaChua.bienSo        = txtBienSo.Text;
                    _frmPhieuSuaChua.TopLevel      = false;
                    _frmPhieuSuaChua.Dock          = DockStyle.Fill;
                    _frmPhieuSuaChua.StartPosition = FormStartPosition.CenterParent;
                    _frmPhieuSuaChua.Show();
                    tab.AttachedControl.Controls.Add(_frmPhieuSuaChua);
                    tabControl.SelectedTabIndex = tabControl.Tabs.Count - 1;
                }
                else
                {
                    MessageBox.Show("Chức năng sửa chữa đang được tiến hành", "Thông báo");
                    tabControl.TabIndex = tabControl.Tabs.Count - 1;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void btnLapPhieu_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckOpenedTabs("Phiếu thu tiền"))
                {
                    TabItem tab = tabControl.CreateTab("Phiếu thu tiền");
                    tab.PredefinedColor = eTabItemColor.Yellow;

                    frmPhieuThuTien _frmPhieuThuTien = new frmPhieuThuTien(tabControl, tab);
                    _frmPhieuThuTien.GetThongTinXe(txtBienSo.Text);
                    _frmPhieuThuTien.TopLevel      = false;
                    _frmPhieuThuTien.Dock          = DockStyle.Fill;
                    _frmPhieuThuTien.StartPosition = FormStartPosition.CenterParent;
                    tab.AttachedControl.Controls.Add(_frmPhieuThuTien);
                    _frmPhieuThuTien.Show();
                    tabControl.SelectedTabIndex = tabControl.Tabs.Count - 1;
                }
                else
                {
                    MessageBox.Show("Chức năng thu tiền đang được tiến hành", "Thông báo");
                    tabControl.TabIndex = tabControl.Tabs.Count - 1;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi");
            }

            this.Close();
        }
Exemplo n.º 3
0
        int groupCount = 0; // global integer used by process group in the case that a block does not have a name or caption.
        #endregion

        /// <summary>
        /// Creates a new Tab page in the tab control.
        /// </summary>
        private void CreateTab(string caption)
        {
            TabItem item = tabControl.CreateTab(caption);

            tabControl.Margin = new Padding(0);

            isLoaded.Add(false);

            ThemedPanel intermediatePanel = new ThemedPanel();

            intermediatePanel.Dock       = DockStyle.Fill;
            intermediatePanel.AutoScroll = true;
            intermediatePanel.Margin     = new Padding(0);
            item.AttachedControl.Controls.Add(intermediatePanel);

            intermediatePanel.Scroll      += new ScrollEventHandler(intermediatePanel_Scroll);
            intermediatePanel.SizeChanged += new EventHandler(intermediatePanel_SizeChanged);

            FieldContainerPanel panel = new FieldContainerPanel();

            panel.AutoSize     = true;
            panel.AutoSizeMode = Prometheus.Controls.TagEditor.AutoSizeType.GrowAndShrink | Prometheus.Controls.TagEditor.AutoSizeType.WidthAndHeight;
            panel.Location     = new Point(0, 0);
            panel.Margin       = new Padding(0, 0, 0, 0);
            panel.Name         = "TagEditorTab";

            intermediatePanel.Controls.Add(panel);
            containers.Push(panel);
        }
Exemplo n.º 4
0
        public object ChartAdd(string testItem)
        {
            TabItem tim = doneTabControl.CreateTab(testItem);

            tim.Name = testItem;
            Chart chart = new Chart();

            chart.Name     = testItem;
            chart.Width    = 999;
            chart.Height   = 336;
            chart.Location = new Point(4, 0);
            Legend legend = new Legend("legend");

            legend.Title = "Legend";
            legend.Font  = new Font("Consolas", 11F,
                                    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            chart.Legends.Add(legend);


            ChartArea chartArea = new ChartArea("ChartArea1");

            chartArea.CursorX.IsUserEnabled          = true;
            chartArea.CursorX.IsUserSelectionEnabled = true;
            chartArea.CursorX.LineDashStyle          = ChartDashStyle.DashDotDot;
            chartArea.CursorY.IsUserEnabled          = true;
            chartArea.CursorY.IsUserSelectionEnabled = true;
            chartArea.CursorY.LineDashStyle          = ChartDashStyle.DashDotDot;
            chart.ChartAreas.Add(chartArea);
            tim.AttachedControl.Controls.Add(chart);
            chart.ChartAreas[0].AxisY.IsStartedFromZero = false;
            chart.Series.Clear();
            return(chart);
        }
Exemplo n.º 5
0
        public override object ChartAdd(string testItem)
        {
            TabItem tim = doneTabControl.CreateTab(testItem);

            tim.Name = testItem;
            ZedGraphControl zedGraph = new ZedGraphControl();

            zedGraph.AutoSizeMode = AutoSizeMode.GrowOnly;
            //zedGraph.Height = 237;
            //zedGraph.Width = 751;
            zedGraph.Dock     = DockStyle.Fill;
            zedGraph.Location = new Point(2, -1);


            GraphPane myPane = zedGraph.GraphPane;

            // Set the titles and axis labels

            myPane.Title.Text      = testItem;
            myPane.Title.IsVisible = false;
            //myPane.Title.FontSpec=
            myPane.XAxis.MajorGrid.IsVisible = true;
            myPane.XAxis.MajorGrid.DashOn    = 1000;
            myPane.YAxis.MajorGrid.DashOn    = 1000;

            myPane.YAxis.MajorGrid.IsVisible = true;
            myPane.XAxis.Title.IsVisible     = false;
            // myPane.XAxis.Title.Text = "X Value Figo";
            myPane.Chart.Border.IsVisible    = false; //首先设置边框为无
            myPane.XAxis.MajorTic.IsOpposite = false; //然后设置X轴对面轴大间隔为无
            myPane.XAxis.MinorTic.IsOpposite = false; //然后设置X轴对面轴大间隔为无
            myPane.YAxis.MajorTic.IsOpposite = false; //设置Y轴对面轴大间隔为无
            myPane.YAxis.MinorTic.IsOpposite = false; //设置Y轴对面轴小间隔为无
            myPane.YAxis.Title.IsVisible     = false;

            myPane.XAxis.MinorGrid.IsVisible = false;

            if (testItem.StartsWith("T"))
            {
                myPane.XAxis.Scale.MajorStep = 1;
                myPane.XAxis.Scale.Max       = 5.0;
            }
            else
            {
                myPane.XAxis.Scale.MajorStep = 5000000000;
                myPane.XAxis.Scale.Max       = 26500000000;
            }


            myPane.XAxis.ScaleFormatEvent += XAxis_ScaleFormatEvent;
            myPane.CurveList.Clear();
            tim.AttachedControl.Controls.Add(zedGraph);
            return(zedGraph);
        }
Exemplo n.º 6
0
        public override object ChartAdd(string testItem)
        {
            TabItem tim = doneTabControl.CreateTab(testItem);

            tim.Name = testItem;
            ChartControl donetChart = new ChartControl();

            donetChart.Name = testItem;
            donetChart.Dock = DockStyle.Fill;

            ChartXy chartXy = new ChartXy(testItem);

            chartXy.Legend.Visible     = true;
            chartXy.MatrixDisplayOrder = 0;
            //chartXy.MatrixDisplayBounds = new Rectangle(0, 0, 8, 6);

            // The following tells the chart control to align the start
            // and ending bounding columns with other charts that start/end
            // in the same columns.
            // ChartXy bb = (ChartXy)donetChart.ChartPanel.ChartContainers[0];

            chartXy.MatrixAlignStartColumn = true;
            chartXy.MatrixAlignEndColumn   = true;

            // Setup our Crosshair display.

            chartXy.ChartCrosshair.AxisOrientation = AxisOrientation.X;

            chartXy.ChartCrosshair.ShowValueXLine   = true;
            chartXy.ChartCrosshair.ShowValueYLine   = true;
            chartXy.ChartCrosshair.ShowValueYLabels = true;

            chartXy.ChartCrosshair.ShowCrosshairLabels = true;
            chartXy.ChartCrosshair.CrosshairLabelMode  = CrosshairLabelMode.NearestSeries;
            SetupChartStyle(chartXy);
            SetupContainerStyle(chartXy);
            SetupChartAxes(chartXy);
            SetupChartLegend(chartXy);
            donetChart.ChartPanel.ChartContainers.Add(chartXy);
            tim.AttachedControl.Controls.Add(donetChart);
            return(chartXy);



            throw new NotImplementedException();
        }
Exemplo n.º 7
0
        public void AgregarTap(Dictionary <int, string> ordenes, int id_p)
        {
            Conexion con = new Conexion();

            ID_packing    = id_p;
            lblXnIdp.Text = Convert.ToString(id_p);
            List <string> listCategoria = new List <string>();

            if (tabP.Tabs.Count == 0)
            {
                tabP.Size = new Size(1145, 400);
                //tabP.CloseButtonOnTabsVisible = true;
                tabP.TabItemClose += new DevComponents.DotNetBar.TabStrip.UserActionEventHandler(this.tabControl1_TabItemClose);
            }
            int x = 10, y = 25, increm = 280;

            foreach (int key in ordenes.Keys)     // recorre la lista
            {
                bool found = false;
                foreach (TabItem tab in tabP.Tabs) // recorre el tab para no repetir ordenes
                {
                    if (ordenes[key] == tab.Text)  // busca si ya existe un tab con la orden
                    {
                        found = true;              // si existe no la agrega
                        //MessageBox.Show("existe");
                    }
                }
                if (!found)
                {
                    newTab           = tabP.CreateTab(ordenes[key]);
                    panel            = (TabControlPanel)newTab.AttachedControl;
                    panel.AutoScroll = true;
                    listCategoria    = con.listaCat(key);
                    foreach (string s in listCategoria)
                    {
                        if (s == "TOPS")
                        {
                            ctrlGridDetalleTop ctT = new ctrlGridDetalleTop();
                            ctT.Name           = ordenes[key].ToString() + s;
                            ctT.lblXorden.Text = s;
                            ctT.Location       = new Point(x, y);
                            ctT.AutoScroll     = true;
                            panel.Controls.Add(ctT);
                            con.dgvT(ctT, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctT.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "BOTTOMS - DAM")
                        {
                            ctrlGridDetalleBD ctBD = new ctrlGridDetalleBD();

                            ctBD.Name           = ordenes[key].ToString() + s;
                            ctBD.lblXorden.Text = s;
                            ctBD.Location       = new Point(x, y);
                            panel.Controls.Add(ctBD);
                            con.dgvBD(ctBD, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctBD.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "BOTTOMS - CAB")
                        {
                            ctrlGridDetalleBC ctBC = new ctrlGridDetalleBC();
                            ctBC.Name           = ordenes[key].ToString() + s;
                            ctBC.lblXorden.Text = s;
                            ctBC.Location       = new Point(x, y);
                            panel.Controls.Add(ctBC);
                            con.dgvBC(ctBC, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctBC.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "UNITALLA")
                        {
                            ctrlGridDetalle ctU = new ctrlGridDetalle();
                            ctU.Name           = ordenes[key].ToString() + s;
                            ctU.lblXorden.Text = s;
                            ctU.Location       = new Point(x, y);
                            panel.Controls.Add(ctU);
                            con.dgvUN(ctU, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctU.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                    }
                    //Cont_art = Cont_art + conex.total_orden(key);
                    swBtnPack  = new DevComponents.DotNetBar.Controls.SwitchButton();
                    swBtnPack  = propiedades(ordenes[key]);
                    panel.Name = Convert.ToString(key);
                    panel.Controls.Add(swBtnPack);
                    panel.AutoScroll = true;

                    this.PnlTabs.Controls.Add(tabP);
                    conex.GeneraDetallePack(id_p, Convert.ToInt32(ordenes[key]));
                    found = false;
                    x     = 10; y = 25;
                }
            }

            if (esPendiente)
            {
                GeneraBrtn();
                if (ordenes.Count() > 0)
                {
                    try
                    {
                        DescontarEnGrid(ID_packing, conex.GET_MOVID(Convert.ToInt32(tabP.SelectedPanel.Name)));
                    }
                    catch (Exception ER)
                    {
                        MessageBox.Show("Error: Pendiente-DescontarEnGrid. " + ER.Message);
                    }
                }
            }

            //foreach (string ord in ListaOrd)
            //{
            //    newTab = tabP.CreateTab(ord);
            //    panel = (TabControlPanel)newTab.AttachedControl;
            //    panel.Controls.Add(new ctrlGridDetalle());
            //    this.Controls.Add(tabP);

            //}
        }
Exemplo n.º 8
0
        public override object ChartAdd(string testItem)
        {
            TabItem tim = doneTabControl.CreateTab(testItem);

            if (tim_Click != null)
            {
                tim.Click += tim_Click;
            }

            tim.Name = testItem;
            Chart chart = new Chart();

            // chart.Palette = ChartColorPalette.Bright;
            chart.Palette             = ChartColorPalette.None;
            chart.PaletteCustomColors = new Color[] { Color.Blue, Color.Green, Color.Black, Color.Brown, Color.Cyan, Color.Magenta,
                                                      Color.LightGreen, Color.Orange, Color.Peru, Color.DarkRed, Color.LightBlue, Color.SlateGray, Color.Red };
            chart.Name = testItem;
            chart.Dock = DockStyle.Fill;
            //chart.Width = 999;
            //chart.Height = 336;
            chart.Location = new Point(4, 0);
            if (testItem.StartsWith("T"))
            {
                chart.GetToolTipText += chart_GetToolTipTextTime;
            }
            else
            {
                chart.GetToolTipText += chart_GetToolTipTextFre;
            }



            ChartArea chartArea = new ChartArea("ChartArea1");

            chartArea.CursorX.IsUserEnabled          = true;
            chartArea.CursorX.IsUserSelectionEnabled = true;
            chartArea.CursorX.LineDashStyle          = ChartDashStyle.DashDotDot;
            chartArea.CursorY.IsUserEnabled          = true;
            chartArea.CursorY.IsUserSelectionEnabled = true;
            chartArea.CursorY.LineDashStyle          = ChartDashStyle.DashDotDot;
            //chartArea.Position.Auto = false;
            //chartArea.Position.Height = 98;
            //chartArea.Position.Width = 98;

            //chartArea.BackColor = Color.DarkGoldenrod;
            //chartArea.AxisX.MajorGrid.LineColor = Color.LawnGreen;
            //chartArea.AxisY.MajorGrid.LineColor = Color.LawnGreen;
            //chartArea.AxisX.MajorGrid.
            //chartArea.AxisX.MajorGrid.in
            chart.ChartAreas.Add(chartArea);

            Legend legend = new Legend("legend");

            legend.Title = "Legend";
            legend.Font  = new Font("Arial", 9F,
                                    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            //legend.InsideChartArea = "ChartArea1";

            legend.CellColumns.Clear();

            legend.CellColumns.Add(new LegendCellColumn()
            {
                Name       = "chbx",
                ColumnType = LegendCellColumnType.Text,
                Text       = "#CUSTOMPROPERTY(CHECK)",
                Font       = new Font("Segoe UI", 9, FontStyle.Bold),
                BackColor  = Color.Transparent
            });

            legend.CellColumns.Add(new LegendCellColumn()
            {
                Name       = "symbol",
                ColumnType = LegendCellColumnType.SeriesSymbol,
                BackColor  = Color.Transparent
            });
            LegendCellColumn a = new LegendCellColumn();

            //a.BackColor = Color.Transparent;

            legend.CellColumns.Add(new LegendCellColumn()
            {
                Name       = "title",
                ColumnType = LegendCellColumnType.Text,
                Text       = "#LEGENDTEXT",
                Alignment  = ContentAlignment.MiddleLeft,
                BackColor  = Color.Transparent
            });
            chart.Legends.Add(legend);
            chart.MouseDown += chart_MouseDown;
            tim.AttachedControl.Controls.Add(chart);
            chart.ChartAreas[0].AxisY.IsStartedFromZero = false;
            chart.Series.Clear();


            return(chart);
        }