// 编译Excel文件或者后台Sql private bool CompileExcel(CommitCom c) { // 确定详细设计说明书文件 MacroType m; Detail d = Dls.FindByName(c); if (d == null) { log.WriteErrorLog("查找不到对应的详细设计说明书模块!"); return(false); } // 标定index bool Result = true; int index = Dls.IndexOf(d) + 1; // 先把存在的CError删除,以检测是否发生编译错误 if (File.Exists(Path.Combine(OutDir, "CError.txt"))) { File.Delete(Path.Combine(OutDir, "CError.txt")); } // 编译Excel 最耗时,对Excel检查是否需要编译,比较PC文件 bool bNew = false; DateTime t2 = File.GetLastWriteTime(c.sawfile.LocalPath); DateTime t1 = t2.AddSeconds(-1); if (c.ctype == ComType.SO) { foreach (string s in d.ProcFiles) { t1 = File.GetLastWriteTime(Path.Combine(OutDir, s)); if (DateTime.Compare(t1, t2) > 0) { bNew = true; break; } } } else if (c.ctype == ComType.Sql || c.ctype == ComType.FuncXml) { if (c.ctype == ComType.Sql) { t1 = File.GetLastWriteTime(Path.Combine(OutDir, d.SqlFile)); } else { t1 = File.GetLastWriteTime(Path.Combine(OutDir, d.XmlFile)); } if (DateTime.Compare(t1, t2) > 0) { bNew = true; } } if (bNew) { log.WriteLog("本地源代码时间晚于Excel文件时间,不需集成处理!" + c.cname + " " + c.ctype); return(true); } if (c.ctype == ComType.SO) { m = MacroType.ProC; } else if (c.ctype == ComType.Sql) { m = MacroType.SQL; } else if (c.ctype == ComType.FuncXml) { m = MacroType.FuncXml; } else { return(true); } Result = Exh.ScmRunExcelMacro(m, index, OutDir); if (!Result) { return(false); } else if (File.Exists(Path.Combine(OutDir, "CError.txt"))) { Result = false; log.WriteErrorLog("检测到编译错误文件 CError.txt,请确认!"); } return(Result); }
protected void BindValues() { //If the mode is add, apply the following; //else retrieve from DB if (Session[PubEntAdminManager.strPubGlobalMode] != null) { if (Session[PubEntAdminManager.strPubGlobalMode].ToString() == PubEntAdminManager.strPubGlobalAMode)//add { this.rdbtnListYesNoEveryOrder.No = true; this.rdbtnListYesNoShowInSearchRes.Yes = true; //this.ckboxListDisplayStatusExh.IsOrder = true; } else { MultiSelectListBoxItemCollection rcoll = PE_DAL.GetExhDisplayStatusByPubID(this.PubID); foreach (DisplayStatus p in rcoll) { ListItem matchItem = this.ckboxListDisplayStatusExh.Items.FindByValue(p.DisplayStatusID.ToString()); if (matchItem != null) { matchItem.Selected = true; } } ExhCollection l = PE_DAL.GetExhInterface(this.PubID); if (l.Count > 0) { Exh l_Exh = l[0]; if (l_Exh.EVERYORDER_EXHIBIT > 0) { this.rdbtnListYesNoEveryOrder.Yes = true; } else if (l_Exh.EVERYORDER_EXHIBIT == 0) { this.rdbtnListYesNoEveryOrder.No = true; } //if (!this.rdbtnListYesNoEveryOrder.Selected()) //{ // this.rdbtnListYesNoEveryOrder.No = true; // this.rdbtnListYesNoShowInSearchRes.Yes = true; //} if (l_Exh.ISSEARCHABLE_EXHIBIT > 0) { this.rdbtnListYesNoShowInSearchRes.Yes = true; } else if (l_Exh.ISSEARCHABLE_EXHIBIT == 0) { this.rdbtnListYesNoShowInSearchRes.No = true; } //this.rdbtnListYesNoEveryOrder.Yes = l_Exh.EVERYORDER_EXHIBIT ? true : false; //this.rdbtnListYesNoShowInSearchRes.Yes = l_Exh.ISSEARCHABLE_EXHIBIT ? true : false; this.txtMaxQtyExh.Text = l_Exh.MAXQTY_EXHIBIT.ToString(); this.txtMaxQtyIntl.Text = l_Exh.MAXINTL_EXHIBIT.ToString(); } rcoll = PE_DAL.GetKioskConfByPubID(this.PubID); this.listSeledConf.DataSource = rcoll; this.listSeledConf.DataTextField = "name"; this.listSeledConf.DataValueField = "id"; this.listSeledConf.DataBind(); MultiSelectListBoxItemCollection lstConfSource = this.listConf.DataSource; foreach (PubEntAdmin.BLL.Conf p in rcoll) { MultiSelectListBoxItem li = new MultiSelectListBoxItem(); li.Name = p.ConfName.ToString(); li.ID = p.ConfID; int count = lstConfSource.Count; for (int i = 0; i < count; i++) { MultiSelectListBoxItem item = lstConfSource[i]; if (item.Name == li.Name) { lstConfSource.RemoveAt(i); i--; count--; } } li = null; this.txtSeledConf.Text += p.ID + ","; } listConf.DataSource = lstConfSource; listConf.DataBind(); MultiSelectListBoxItemCollection rcollR = PE_DAL.GetKioskConfRotateByPubID(this.PubID); this.listRotate.DataSource = rcollR; this.listRotate.DataTextField = "name"; this.listRotate.DataValueField = "id"; this.listRotate.DataBind(); foreach (PubEntAdmin.BLL.Conf p in rcollR) { this.txtRotate.Text += p.ID + ","; } } } }