public EditWindow(User.User aUser) { InitializeComponent(); operatePanel.Visibility = Visibility.Hidden; scrollViewerLog.Visibility = Visibility.Hidden; user = aUser; foreach (FunctionModular fm in user.grantedModulars) { System.Windows.Controls.Button btn = new System.Windows.Controls.Button(); btn.Content = fm.name; btn.Name = fm.id; btn.Click += this.buttonRepositorySelection_Click; btn.Height = 23; btn.Width = 135; btn.Margin = new Thickness(0, 10, 0, 0); wrapPanelRepositryButtons.Children.Add(btn); } /**** * 添加“文件规范”按钮 */ System.Windows.Controls.Button btn_wjgf = new System.Windows.Controls.Button(); btn_wjgf.Content = "文件规范"; btn_wjgf.Name = "wenjianguifan"; btn_wjgf.Click += this.buttonRepositorySelection_Click; btn_wjgf.Height = 23; btn_wjgf.Width = 135; btn_wjgf.Margin = new Thickness(0, 10, 0, 0); wrapPanelRepositryButtons.Children.Add(btn_wjgf); lblUsername.Content = user.name; System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); lblVersion.Content = assembly.GetName().Version.ToString(); lblDataTime.Content = DateTime.Today.ToString("yyyy-MM-dd") + " " + DateTime.Today.DayOfWeek.ToString(); iCurrentReposId = "zhongwenqikan"; iRepos = new ZWQK_MDB(); iRepos.user = user; lblTitle.Content = iRepos.title; setButtonDisable(); }
private void buttonRepositorySelection_Click(object sender, RoutedEventArgs e) { dockPanelInfo.Visibility = Visibility.Hidden; dockPanelInfo.Height = 0; operatePanel.Visibility = Visibility.Visible; wrapSYML.Visibility = Visibility.Hidden; wrapSYML.Height = 0; scrollViewerLog.Visibility = Visibility.Visible; scrollViewerLog.IsEnabled = true; scrollViewerLog.IsReadOnly = true; progressBar1.Value = 0; System.Windows.Controls.Button btn = sender as System.Windows.Controls.Button; if (!iCurrentReposId.Equals(btn.Name)) { if (iRepos != null) iRepos.clear(); iCurrentReposId = btn.Name; if (iCurrentReposId.Equals("zhongwenqikan")) iRepos = new ZWQK_MDB(); else if (iCurrentReposId.Equals("waiwenqikan")) iRepos = new WWQK_MDB(); else if (iCurrentReposId.Equals("zhongwenhuiyi")) { iRepos = new ZWHY_MDB(); } else if (iCurrentReposId.Equals("waiwenhuiyi")) { iRepos = new WWHY_MDB(); } else if (iCurrentReposId.Equals("nengyuanbaogao")) { iRepos = new NYBG_MDB(); } else if (iCurrentReposId.Equals("xueweilunwen")) { iRepos = new XWLW_MDB(); } else if (iCurrentReposId.Equals("dianlibaokan")) { //iRepos = new DLBK_MDB(); iRepos = new BDBK_MDB(); } else if (iCurrentReposId.Equals("jingjibaokan")) { iRepos = new JJBK_MDB(); } else if (iCurrentReposId.Equals("kejibaokan")) { iRepos = new KJBK_MDB(); } else if (iCurrentReposId.Equals("zonghebaokan")) { iRepos = new ZHBK_MDB(); } else if (iCurrentReposId.Equals("zhongguochengguo")) { iRepos = new ZGCG_MDB(); } else if (iCurrentReposId.Equals("guojiabiaozhun")) { iRepos = new GJBZ_MDB(); } else if (iCurrentReposId.Equals("hangyebiaozhun")) { iRepos = new HYBZ_MDB(); } else if (iCurrentReposId.Equals("guojibiaozhun")) { iRepos = new GJIBZ_MDB(); } else if (iCurrentReposId.Equals("guodianfagui")) { iRepos = new GDFG_MDB(); } else if (iCurrentReposId.Equals("zichanwenxian")) { iRepos = new ZCWX_MDB(); } else if (iCurrentReposId.Equals("kejichengguo")) { iRepos = new KJCG_MDB(); } else if (iCurrentReposId.Equals("kejibaogao")) { iRepos = new KJBG_MDB(); } else if (iCurrentReposId.Equals("guoyanbaogao")) { iRepos = new GYBG_MDB(); } else if (iCurrentReposId.Equals("kaochabaogao")) { iRepos = new KCBG_MDB(); } else if (iCurrentReposId.Equals("tushushouce")) { iRepos = new TSSC_MDB(); } else if (iCurrentReposId.Equals("wenjianguifan")) { iRepos = new WJGF_MDB(); } else if (iCurrentReposId.Equals("zhongwenqikanjingguan")) { iRepos = new ZWQKJG_MDB(); } else iRepos = new ZWQK_MDB(); /* 在此扩展 */ iRepos.user = user; lblTitle.Content = iRepos.title; this.txtSourceFolder.Text = ""; this.txtSourceFile.Text = ""; this.txtDestFolder.Text = ""; setButtonDisable(); setSymlButtonDisable(); this.btnOnekey.IsEnabled = false; } #if nodef if (iCurrentReposId.IndexOf("huiyi") >= 0) { wrapSYML.Visibility = Visibility.Visible; wrapSYML.Height = 45; } #endif }