예제 #1
0
        private void InitializaLOVData()
        {
            try
            {
                //for post type
                using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                {
                    List <PostType> lstPostType = inDataBll.PostTypeList();
                    if (lstPostType != null)
                    {
                        lstPostType.Insert(0, new PostType {
                            SEQ_NO = string.Empty, NAME = "(All)"
                        });
                        this.luePostType.Properties.DataSource = lstPostType;

                        //set defautl
                        this.luePostType.EditValue = "NEW";
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #2
0
        private void GetResultUploadRevisionb()
        {
            DataTable dtbResult;

            try
            {
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                {
                    dtbResult = inDataBll.GetResultUploadRevision(this._SEQ_NO, this._USER_ID);
                }

                this.grdRetUpRevision.DataSource = dtbResult;
                this.dntRetUpRevision.DataSource = dtbResult;
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
예제 #3
0
        private void FGAdjustInInterfacePostData()
        {
            try
            {
                //ICollection<string> files;
                DataTable dtbPosted  = null;
                string    selectPath = string.Empty;
                string    resultMsg  = string.Empty;

                DialogResult result = this.fdbSelectFilePath.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    selectPath = this.fdbSelectFilePath.SelectedPath;
                    try
                    {
                        using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                        {
                            resultMsg = inDataBll.GetPostData("INTERFACE_PACK.IF_IN_ADJ_LIST", string.Empty, null, selectPath, ((frmMainMenu)this.ParentForm).UserID, out dtbPosted);
                        }

                        /*
                         * if (files.Count > 0)
                         * {
                         *  //copy to server
                         *  UiUtility.CopyFilesToServer(files);
                         *
                         *  this.OpenPath(files);
                         *
                         *  //Refresh screen
                         *  this.btnRefresh.PerformClick();
                         * }
                         * else
                         * {
                         *  XtraMessageBox.Show(this, "Post Data has Problem!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                         * }
                         * */
                    }
                    catch (Exception ex)
                    {
                        XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #4
0
        private void GetRevisionLastUpdate()
        {
            try
            {
                string result = string.Empty;

                using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                {
                    result = inDataBll.GetRevisionLastUpdate();
                }

                this.txtRevisionLastUpdate.Text = result;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #5
0
        private void FgAssemblyInterfaceData(string posttype, string wh_id, string productNo, string postRef,
                                             DateTime?fromDate, DateTime?toDate, DateTime?stkfDate, DateTime?stktDate)
        {
            try
            {
                base.ExecutionStart();
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                {
                    this.dtbAssemblyInfData = inDataBll.IfInAssemblyList(posttype, wh_id, productNo, postRef, fromDate, toDate, stkfDate, stktDate, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (this.dtbAssemblyInfData != null)
                {
                    this.ConditionsColumnView(this.grdAsmIn);
                }

                this.grdAsmIn.DataSource      = this.dtbAssemblyInfData;
                this.dntQryStkAsOn.DataSource = this.dtbAssemblyInfData;

                this.grdPostedData.DataSource = null;

                //check enable button
                this.CheckEnablePostData("[DATA_TYPE] = 'NEW'");
                base.ExecutionStop();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                this.grdAsmIn.DataSource      = null;
                this.dntQryStkAsOn.DataSource = null;

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                ((frmMainMenu)this.ParentForm).ExecuteTime.Caption = base.ExecuteTime;
                base.FinishedProcessing();
            }
        }
예제 #6
0
        private void InitializaLOVData()
        {
            try
            {
                //for post type
                using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                {
                    List <PostType> lstPostType = inDataBll.PostTypeList();
                    if (lstPostType != null)
                    {
                        lstPostType.Insert(0, new PostType {
                            SEQ_NO = string.Empty, NAME = "(All)"
                        });
                        this.luePostType.Properties.DataSource = lstPostType;

                        //set defautl
                        this.luePostType.EditValue = "NEW";
                    }

                    List <Warehouse> lstWH = inDataBll.GetWarehouse();
                    if (lstWH != null)
                    {
                        lstWH.Insert(0, new Warehouse {
                            SEQ_NO = string.Empty, NAME = "(All)"
                        });
                        this.lueWarehouse.Properties.DataSource = lstWH;
                    }
                }

                using (ProductionTypeBLL pdtBll = new ProductionTypeBLL())
                {
                    this.grvAsmIn_rps_PRODUCTION_TYPE.DataSource = pdtBll.GetProductionTypeList();
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #7
0
        private void UploadRevision(string userid)
        {
            DataTable dtbBomData;
            string    fullFilename, pathFile, filename;
            string    connectionString, queryString;

            using (OpenFileDialog fdlg = new OpenFileDialog {
                Title = "Open BOM. Revision File", InitialDirectory = @"My Documents:\", Filter = "New Excel files (*.csv)|*.csv|BOM. File (*.csv)|*.csv", FilterIndex = 2, RestoreDirectory = true
            })
            {
                if (fdlg.ShowDialog() == DialogResult.OK)
                {
                    if (!string.IsNullOrEmpty(fdlg.FileName))
                    {
                        fullFilename = fdlg.FileName;
                        FileInfo fi = new FileInfo(fullFilename);

                        pathFile = fi.DirectoryName;
                        filename = fi.Name;
                    }
                    else
                    {
                        fullFilename = string.Empty;
                        pathFile     = string.Empty;
                        filename     = string.Empty;
                    }
                }
                else
                {
                    fullFilename = string.Empty;
                    pathFile     = string.Empty;
                    filename     = string.Empty;
                }
            }


            if (!string.IsNullOrEmpty(fullFilename) && !string.IsNullOrEmpty(filename))
            {
                try
                {
                    StreamReader         StrWer = File.OpenText(fullFilename);
                    ICollection <string> values = new Collection <string>();
                    while (StrWer.EndOfStream == false)
                    {
                        values.Add(StrWer.ReadLine());
                    }

                    string seq = string.Empty;
                    using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                    {
                        seq = inDataBll.UploadRevision(filename, userid, values);
                    }

                    if (!string.IsNullOrEmpty(seq))
                    {
                        using (frmPopResultUpRevision fResultRevision = new frmPopResultUpRevision {
                            SEQ_NO = seq, USER_ID = userid
                        })
                        {
                            UiUtility.ShowPopupForm(fResultRevision, this, true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
            }
        }
예제 #8
0
        private void FGAssemblyInterfacePostData(DataTable dtbSelect)
        {
            try
            {
                //ICollection<string> files;
                DataTable dtbPosted    = null;
                string    selectPath   = string.Empty;
                string    fullfilename = string.Empty;

                DialogResult result = this.fdbSelectFilePath.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    selectPath = this.fdbSelectFilePath.SelectedPath;
                    try
                    {
                        using (InterfaceDataBLL inDataBll = new InterfaceDataBLL())
                        {
                            inDataBll.GetPostData("INTERFACE_PACK.IF_IN_ASEMBLY_LIST", string.Empty, dtbSelect, selectPath, ((frmMainMenu)this.ParentForm).UserID, out dtbPosted);
                        }

                        if (dtbPosted != null)
                        {
                            //    //get last update revision
                            this.GetRevisionLastUpdate();

                            this.BindingPostedData(dtbPosted, selectPath, out fullfilename);

                            UiUtility.CopyFilesToServer(new Collection <string>()
                            {
                                fullfilename
                            });

                            this.OpenExcelFile(fullfilename);

                            this.btnRefresh.PerformClick();
                        }
                        //if (files.Count > 0)
                        //{
                        //    //get last update revision
                        //    this.GetRevisionLastUpdate();

                        //    //copy to server
                        //    UiUtility.CopyFilesToServer(files);

                        //    this.OpenPath(files);

                        //    //Refresh screen
                        //    this.btnRefresh.PerformClick();
                        //}
                    }
                    catch (Exception ex)
                    {
                        XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }