Ejemplo n.º 1
0
        private void ItemClickEventHandler_TRACE(object sender, EventArgs e)
        {
            R_OF_Tracebility RTR = new R_OF_Tracebility();

            RTR.OF = gridView2.GetFocusedRowCellValue("CD_OF").ToString();
            RTR.Show();
        }
Ejemplo n.º 2
0
 private void ItemClickEventHandler_Report(object sender, EventArgs e)
 {
     if (lkeCD_OF.EditValue.ToString() != "[Please click and select Production Order]")
     {
         try
         {
             R_OF_Tracebility RTR = new R_OF_Tracebility();
             RTR.OF = lkeCD_OF.EditValue.ToString();
             RTR.Show();
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
Ejemplo n.º 3
0
        public F_OF_List()
        {
            InitializeComponent();

            Load += (s, e) =>
            {
                gridControl1.DataSource = _oFBUS.F_OF_List();
                gridView1.BestFitColumns();

                //2018-09-25
                //Load OF từ Nutriciel
                //DataTable dt2 = new DataTable();
                //dt2 = OFB.F_OF_Finished();
                //gridControl2.DataSource = dt2;
                //sYNC_NUTRICIELDataSet.tbl_OF_Finished.Clear();
                //gridControl2.DataSource = tbl_OF_FinishedTableAdapter.Fill(sYNC_NUTRICIELDataSet.tbl_OF_Finished);
                gridControl2.DataSource = _oFBUS.F_OF_Finished();
                gridView2.BestFitColumns();
                ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                ////Load dữ liệu từ MF lên grid
                ////gridControl2.DataSource = CSV.ConvertCsvStringToDataTable(true, @"D:\\Eresis\\EXCHANGES\\OUT\\MP_1199.CSV");
                ////gridControl2.DataSource =CSV.OpenCsvFileAsDataTable(@"D:\\Eresis\\EXCHANGES\\OUT\\MP_1199.CSV", false);

                this.repositoryItemLookUpEdit1.DataSource = _oFBUS.CD_OF_Finished();
            };

            action1.View(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_View));
            action1.CSV(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_CSV));
            action1.Report(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_Report));
            //action_Function1.PKN(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_PKN));
            //action_Function1.COA(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_COA));
            //action_Function1.TRACE(new DevExpress.XtraBars.ItemClickEventHandler(ItemClickEventHandler_TRACE));
            gridView1.DoubleClick += (s, e) =>
            {
                ////Lưu ý phải lớn hơn 1, >0 bị lỗi
                //if (CSV.ConvertCsvStringToDataTable(true, @"D:\\Eresis\\EXCHANGES\\OUT\\MP_" +
                //                    gridView1.GetFocusedRowCellValue("CD_OF").ToString() + ".CSV").Rows.Count > 1)
                //{
                //        gridControl2.DataSource = CSV.ConvertCsvStringToDataTable(true, @"D:\\Eresis\\EXCHANGES\\OUT\\MP_" +
                //                                gridView1.GetFocusedRowCellValue("CD_OF").ToString() + ".CSV");

                //        //Kiểm tra có lưu trong database chưa
                //        //Nếu chưa thì lưu
                //        if (RMB.RMUSED_Find(gridView1.GetFocusedRowCellValue("CD_OF").ToString()).Rows.Count <= 0)
                //        {
                //            //MessageBox.Show("gridView2.DataRowCount :" + gridView2.DataRowCount.ToString());
                //            for (int i = 0; i < gridView2.DataRowCount; i++)
                //            {
                //                //MessageBox.Show("i :" + i.ToString());
                //                RMB.RMUSED_INSERT(gridView2.GetDataRow(i));
                //            }
                //        }
                //}
                //else
                //    gridControl2.DataSource = null;
            };
            gridView2.DoubleClick += (s, e) =>
            {
                //if (gridView2.GetFocusedRowCellValue("CD_OF").ToString().Length > 0)
                //{
                //    gridControl3.DataSource = OFB.OF_ListBatch(gridView2.GetFocusedRowCellValue("CD_OF").ToString());
                //    gridView3.BestFitColumns();
                //    gridControl4.DataSource = COB.COA_Search_ByWO(gridView2.GetFocusedRowCellValue("CD_OF").ToString());
                //    gridView4.BestFitColumns();
                //}
            };
            btnUpdate.Click += (s, e) =>
            {
                foreach (OF item in OFList)
                {
                    _oFBUS.OF_Finished_UPDATE(
                        item.CD_OF,
                        item.TOL_QTY_PAK,
                        item.FUL_PAK_TYPE,
                        item.FUL_PAK_BAG,
                        item.LST_PAK_TYPE,
                        item.LST_PAK_BAG,
                        item.CONTAMINATION_PAK,
                        item.FRM_CD_OF,
                        item.REMAIN_PREV_CD_OF_QTY
                        );
                }
            };

            btnTracertbility.Click += (s, e) =>
            {
                R_OF_Tracebility RTR = new R_OF_Tracebility();
                RTR.OF = gridView2.GetFocusedRowCellValue("CD_OF").ToString();
                RTR.Show();
            };

            btnPrintPreview.Click += (s, e) =>
            {
                // Open the Preview window.
                gridControl2.ShowPrintPreview();
            };

            btnExportToXslx.Click += (s, e) =>
            {
                // Open the Preview window.
                gridControl2.ExportToXlsx(@"X:\\Display_OF_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
                XtraMessageBox.Show("Your file has been exported as the following path : Z:\\Display_OF_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
            };

            gridView2.CellValueChanged += (s, e) =>
            {
                OFList.Add(new OF(
                               gridView2.GetFocusedRowCellValue("CD_OF").ToString(),
                               gridView2.GetFocusedRowCellValue("TOL_QTY_PAK").ToString().Length == 0 ? 0 : float.Parse(gridView2.GetFocusedRowCellValue("TOL_QTY_PAK").ToString()),
                               gridView2.GetFocusedRowCellValue("FUL_PAK_TYPE").ToString(),
                               gridView2.GetFocusedRowCellValue("FUL_PAK_BAG").ToString().Length == 0 ? 0 : float.Parse(gridView2.GetFocusedRowCellValue("FUL_PAK_BAG").ToString()),
                               gridView2.GetFocusedRowCellValue("LST_PAK_TYPE").ToString(),
                               gridView2.GetFocusedRowCellValue("LST_PAK_BAG").ToString().Length == 0 ? 0 : float.Parse(gridView2.GetFocusedRowCellValue("LST_PAK_BAG").ToString()),
                               gridView2.GetFocusedRowCellValue("CONTAMINATION_PAK").ToString().Length == 0 ? 0 : float.Parse(gridView2.GetFocusedRowCellValue("CONTAMINATION_PAK").ToString()),
                               gridView2.GetFocusedRowCellValue("FRM_CD_OF").ToString(),
                               gridView2.GetFocusedRowCellValue("REMAIN_PREV_CD_OF_QTY").ToString().Length == 0 ? 0 : float.Parse(gridView2.GetFocusedRowCellValue("REMAIN_PREV_CD_OF_QTY").ToString())
                               ));
            };

            //gridView3.DoubleClick += (s, e) =>
            //{
            //    if(gridView3.GetFocusedRowCellValue("SoPKN").ToString()!="0")
            //    {
            //        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.Show();
            //    }

            //};

            //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("Vui lòng chọn WO bên trên ", 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("Vui lòng chọn WO bên trên ", e.Appearance.Font, SystemBrushes.ControlDark, new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height), drawFormat);

            //};
        }