public HydroMonitorWordVm() { this.OpenDirCmd = new DelegateCommand(OpenDir); this.WordMakeCmd = new DelegateCommand(WordMake); this.ChangeCmd = new DelegateCommand(Change); this.MakingTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0); config = new ProductPathConfig(); this.DirList = new ObservableCollection <ProductPath>(config.ListProductPath); PreAndSignConfig cf = new PreAndSignConfig(); this.MakingPerson = cf.Pas.PreName; this.templateName = Path.Combine(Directory.GetCurrentDirectory(), dir, templateFileName); FileInfo fileInfo = new FileInfo(this.templateName); if (!fileInfo.Exists) { this.templateName = null; } if (!File.Exists(this.templateName)) { this.templateName = null; } worker.DoWork += worker_DoWork; worker.RunWorkerCompleted += worker_RunWorkerCompleted; }
public WaterloggingWordVm() { this.OpenPicCmd = new DelegateCommand(OpenPic); this.OpenOutPathCmd = new DelegateCommand(OpenOutPath); this.WordMakeCmd = new DelegateCommand(WordMake); this.ChangeCmd = new DelegateCommand <object>(Change); config = new ProductPathConfig(); this.DirList = new ObservableCollection <ProductPath>(config.ListProductPath); this.templateName = Path.Combine(Directory.GetCurrentDirectory(), dir, templateFileName); FileInfo fileInfo = new FileInfo(this.templateName); if (!fileInfo.Exists) { this.templateName = null; } if (!File.Exists(this.templateName)) { this.templateName = null; } PreAndSignConfig cf = new PreAndSignConfig(); this.PrePeople = cf.Pas.PreName; this.SignPeople = cf.Pas.SignName; this.Section = new ProductVolumeConfig().productVolume.WaterloggingVolume.ToString(); }
public PreSignVm() { this.SaveConfigCmd = new DelegateCommand(SaveConfig); PreAndSignConfig config = new PreAndSignConfig(); this.PreName = config.Pas.PreName; this.SignName = config.Pas.SignName; }
public void SaveConfig() { if (this.preName == null || this.preName.Trim().Equals(string.Empty) || this.signName == null || this.signName.Trim().Equals(string.Empty)) { this.ConfigHint = "预报人和签发人不能为空!"; } else { PreAndSignConfig config = new PreAndSignConfig(); config.Pas.PreName = this.preName.Trim(); config.Pas.SignName = this.signName.Trim(); config.WriteConfigToFile(); this.ConfigHint = "配置保存成功!"; } }