Beispiel #1
0
        private void form_ConfirmClick(string shopID, string path, MemberImportForm form)
        {
            importShopID = shopID;
            importPath   = path;



            string fileExt = Path.GetExtension(path);

            if (fileExt != ".xlsx" && fileExt != ".xls")
            {
                ShowMessage("你所选择文件格式不正确,请重新上传文件!");
                return;
            }
            if (GlobalMessageBox.Show("是否开始导入" + System.IO.Path.GetFileName(path), "友情提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                importPath = null;
                importForm.Cancel();
                return;
            }

            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoImport);
                cb.BeginInvoke(null, null);
            }
            catch (Exception ex)
            {
                CommonGlobalUtil.ShowError(ex);
            }
        }
Beispiel #2
0
        private void baseButtonImport_Click(object sender, EventArgs e)
        {
            importForm = new MemberImportForm();
            importForm.CloseWhenEscape = false;
            importForm.ConfirmClick   += form_ConfirmClick;
            if (importForm.ShowDialog() != DialogResult.OK)
            {
                importShopID = string.Empty;
                importPath   = string.Empty;
                return;
            }

            //importPath = importForm.Path;
            //importShopID = importForm.ShopID;
        }