Example #1
0
        private void ItemClickEventHandler_Add(object sender, EventArgs e)
        {
            //MessageBox.Show("click");
            frm_PKN PKN = new frm_PKN();

            PKN.ActStatus = "N";
            PKN.Show();
        }
Example #2
0
        private void ItemClickEventHandler_View(object sender, EventArgs e)
        {
            //MessageBox.Show("click");
            frm_PKN PKN = new frm_PKN();

            PKN.KQKNTemplateID = int.Parse(gridView1.GetFocusedRowCellValue("KQKNTemplateID").ToString());
            PKN.ActStatus      = "V";
            PKN.ID             = int.Parse(gridView1.GetFocusedRowCellValue("ID").ToString());
            PKN.SoPKN          = gridView1.GetFocusedRowCellValue("SoPKN").ToString();
            PKN.SoPNK          = gridView1.GetFocusedRowCellValue("SoPNK").ToString();
            PKN.Lan            = int.Parse(gridView1.GetFocusedRowCellValue("Lan").ToString());
            PKN.Show();
        }
Example #3
0
        //Luu du lieu edit vao list
        //class UserVal
        //{
        //    public UserVal(string col, int row, float value)
        //    {
        //        this.Col = col;
        //        this.Row = row;
        //        this.Value = value;

        //    }
        //    public string Col;
        //    public int Row;
        //    public float Value;
        //}

        //List<OF> OFList = new List<OF>();

        public F_Tracerbility()
        {
            InitializeComponent();

            Load += (s, e) =>
            {
                tbl_OF_FinishedTableAdapter.Fill(sYNC_NUTRICIELDataSet.tbl_OF_Finished);
                //gridControl1.DataSource = tbl_OF_FinishedTableAdapter.Fill(sYNC_NUTRICIELDataSet.tbl_OF_Finished);
                ControlsReadOnly(true);
            };

            //action1.View(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_View));
            //action1.CSV(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_CSV));
            action1.Report(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_Report));

            lkeCD_OF.EditValueChanged += (s, e) =>
            {
                if (lkeCD_OF.EditValue.ToString().Length > 0)
                {
                    gridControl3.DataSource = OFB.OF_ListBatch(lkeCD_OF.EditValue.ToString());
                    gridView3.BestFitColumns();

                    gridControl4.DataSource = COB.COA_Search_ByWO(lkeCD_OF.EditValue.ToString());
                    gridView4.BestFitColumns();

                    txtFGName.Text = lkeCD_OF.GetColumnValue("LB_MAT").ToString();
                    txtFGCode.Text = lkeCD_OF.GetColumnValue("CD_MAT").ToString();
                    txtFnhDte.Text = lkeCD_OF.GetColumnValue("DT_FIN").ToString();
                    txtMnfQty.Text = lkeCD_OF.GetColumnValue("QT_MVMT").ToString();
                    txtPlnQty.Text = lkeCD_OF.GetColumnValue("QT_PREV").ToString();
                    txtStdDte.Text = lkeCD_OF.GetColumnValue("DT_DEB").ToString();
                }
            };

            repositoryItemButtonEdit1.ButtonClick += (s, e) =>
            {
                if (e.Button.Caption == "PNK Number")
                {
                    if (gridView3.GetFocusedRowCellValue("SoPKN").ToString().Length > 0)
                    {
                        frm_PKN PKN = new frm_PKN();
                        PKN.ActStatus = "V";
                        PKN.SoPKN     = gridView3.GetFocusedRowCellValue("SoPKN").ToString();
                        PKN.SoLo      = gridView3.GetFocusedRowCellValue("NO_LOTORG").ToString();
                        PKN.Lan       = 1;
                        PKN.Show();
                    }
                    else
                    {
                        XtraMessageBox.Show("Your PKN is blank. Please contact QA for more information");
                    }
                }
            };

            repositoryItemButtonEdit2.ButtonClick += (s, e) =>
            {
                if (e.Button.Caption == "COA Number")
                {
                    if (gridView4.GetFocusedRowCellValue("SoCOA").ToString().Length > 0)
                    {
                        frm_COA COA = new frm_COA();
                        COA.SoCOA     = gridView4.GetFocusedRowCellValue("SoCOA").ToString();
                        COA.ActStatus = "V";
                        COA.CD_OF     = gridView4.GetFocusedRowCellValue("WO").ToString();
                        COA.Show();
                    }
                    else
                    {
                        XtraMessageBox.Show("Your COA is blank. Please contact QA for more information");
                    }
                }
            };

            //gridView4.RowClick += (s, e) =>
            //{
            //    frm_COA COA = new frm_COA();
            //    COA.SoCOA = gridView4.GetFocusedRowCellValue("SoCOA").ToString();
            //    COA.ActStatus = "V";
            //    COA.CD_OF = gridView4.GetFocusedRowCellValue("WO").ToString();
            //    COA.Show();
            //};

            gridView3.CustomDrawEmptyForeground += (s, e) =>
            {
                DevExpress.XtraGrid.Views.Grid.GridView view = s as DevExpress.XtraGrid.Views.Grid.GridView;

                if (view.RowCount != 0)
                {
                    return;
                }

                StringFormat drawFormat = new StringFormat();

                drawFormat.Alignment = drawFormat.LineAlignment = StringAlignment.Center;

                e.Graphics.DrawString(" No Analysis Report founded ", e.Appearance.Font, SystemBrushes.ControlDark, new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height), drawFormat);
            };

            gridView4.CustomDrawEmptyForeground += (s, e) =>
            {
                DevExpress.XtraGrid.Views.Grid.GridView view = s as DevExpress.XtraGrid.Views.Grid.GridView;

                if (view.RowCount != 0)
                {
                    return;
                }

                StringFormat drawFormat = new StringFormat();

                drawFormat.Alignment = drawFormat.LineAlignment = StringAlignment.Center;

                e.Graphics.DrawString(" No Analysis Report founded ", e.Appearance.Font, SystemBrushes.ControlDark, new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height), drawFormat);
            };
        }