示例#1
0
文件: FrmUser.cs 项目: yyan/winform
        /// <summary>
        /// 导入Excel的操作
        /// </summary>
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (!HasFunction("User/import"))
            {
                MessageDxUtil.ShowError(Const.NoAuthMsg);
                return;
            }

            //如果导入的Excel不指定部门,则默认使用选定的部门作为记录的部门
            TreeNode deptNode = this.treeDept.SelectedNode;

            if (deptNode != null)
            {
                SelectedDeptId = deptNode.Name;
            }
            else
            {
                MessageDxUtil.ShowTips("请选择组织机构节点,然后在进行导入,默认导入用户属于该部门节点");
                return;
            }

            string             templateFile = string.Format("{0}-模板.xls", moduleName);
            FrmImportExcelData dlg          = new FrmImportExcelData();

            dlg.SetTemplate(templateFile, System.IO.Path.Combine(Application.StartupPath, templateFile));
            dlg.OnDataSave    += new FrmImportExcelData.SaveDataHandler(ExcelData_OnDataSave);
            dlg.OnRefreshData += new EventHandler(ExcelData_OnRefreshData);
            dlg.ShowDialog();
        }
        /// <summary>
        /// 导入的操作
        /// </summary>
        private void ImportData()
        {
            string             templateFile = string.Format("{0}-模板.xls", moduleName);
            FrmImportExcelData dlg          = new FrmImportExcelData();

            dlg.SetTemplate(templateFile, System.IO.Path.Combine(Application.StartupPath, templateFile));
            dlg.OnDataSave    += new FrmImportExcelData.SaveDataHandler(ExcelData_OnDataSave);
            dlg.OnRefreshData += new EventHandler(ExcelData_OnRefreshData);
            dlg.ShowDialog();
        }
        /// <summary>
        /// 导入Excel的操作
        /// </summary>
        private void btnImport_Click(object sender, EventArgs e)
        {
            string             templateFile = string.Format("{0}-模板.xls", moduleName);
            FrmImportExcelData dlg          = new FrmImportExcelData();

            dlg.SetTemplate(templateFile, System.IO.Path.Combine(Application.StartupPath, templateFile));
            dlg.OnDataSave    += ExcelData_OnDataSave;
            dlg.OnRefreshData += ExcelData_OnRefreshData;
            dlg.ShowDialog();
        }
示例#4
0
        /// <summary>
        /// 导入Excel的操作
        /// </summary>
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (!HasFunction("User/Set/UserImport"))
            {
                MessageDxUtil.ShowError(Const.NoAuthMsg);
                return;
            }

            string             templateFile = string.Format("{0}-模板.xls", moduleName);
            FrmImportExcelData dlg          = new FrmImportExcelData();

            dlg.SetTemplate(templateFile, System.IO.Path.Combine(Application.StartupPath, templateFile));
            dlg.OnDataSave    += new FrmImportExcelData.SaveDataHandler(ExcelData_OnDataSave);
            dlg.OnRefreshData += new EventHandler(ExcelData_OnRefreshData);
            dlg.ShowDialog();
        }
示例#5
0
        public override void OnClick(object sender, EventArgs args)
        {
            FrmImportExcelData frm = new FrmImportExcelData(_context);

            frm.ShowDialog();
        }