Example #1
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);
            }
        }
        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);
            }
        }