/// <summary> /// 定时执行业务 /// </summary> /// <param name="obj"></param> void executeTimer(object obj) { DateTime dt = DateTime.Today.AddDays(-1); NameObjectList ps = new NameObjectList(); ps.Add("开始日期", dt); ps.Add("结束日期", dt); QueryDataRes query = new QueryDataRes("基础类"); DataTable tab = query.getTable("考勤人员列表", null); if (null == tab || tab.Rows.Count < 1) { isTmRunning = false; return; } NameValueCollection data = new NameValueCollection(); data["服务"] = "考勤作业"; DataColumnCollection cols = tab.Columns; foreach (DataRow dr in tab.Rows) { foreach (DataColumn c in cols) { ps[c.ColumnName] = Convert.ToString(dr[c]); } try { bool b = query.ExecuteNonQuery("考勤人员列表", ps, ps, ps); if (b) { continue; } } catch (Exception ex) { foreach (string key in ps.AllKeys) { data.Add(key, Convert.ToString(ps[key])); } LogMessage(ex, data, EventLogEntryType.Error); continue; } foreach (string key in ps.AllKeys) { data.Add(key, Convert.ToString(ps[key])); } LogMessage("考勤作业失败!", data, EventLogEntryType.Warning); } isTmRunning = false; }
/// <summary> /// 根据单据类别和部门生成编号 /// </summary> /// <param name="billType">单据类型</param> /// <param name="deptCode">部门</param> /// <returns></returns> static public string GetBillSn(string billType, string deptCode) { if ("" == billType || "" == deptCode) { return(""); } NameObjectList paramList = new NameObjectList(); QueryDataRes query = QueryDataRes.CreateQuerySys(); paramList.Add("单据类型", billType); paramList.Add("部门", deptCode); //没有就创建一个 DataTable tab = query.getTable("单据流水号", paramList); if (tab.Rows.Count < 1 || null == tab.Rows[0]["流水号"]) { return(""); } return(tab.Rows[0]["流水号"].ToString()); }
/// <summary> /// This method iterates recursively through the tree to return only the slides /// contained in the tree. /// </summary> /// <param name="slides">Ref. The output <see cref="NameObjectList{Slide}"/> of slides.</param> /// <param name="node">The <see cref="TreeNode"/> to parse.</param> private void ParseNodeForSlides(ref NameObjectList <Slide> slides, TreeNode node) { // Check all child nodes foreach (TreeNode subNode in node.Nodes) { // If a slide is contained, add it to the list Slide slide = ((SlideshowTreeNode)subNode).Slide; if (slide != null) { slides.Add(slide.Name, slide); } // Iterate recursively this.ParseNodeForSlides(ref slides, subNode); } }
/// <summary> /// This method iterates recursively through the tree to return only the slides /// contained in the tree. /// </summary> /// <param name="slides">Ref. The output <see cref="NameObjectList{Slide}"/> of slides.</param> /// <param name="node">The <see cref="TreeNode"/> to parse.</param> private void ParseNodeForSlides(ref NameObjectList<Slide> slides, TreeNode node) { // Check all child nodes foreach (TreeNode subNode in node.Nodes) { // If a slide is contained, add it to the list Slide slide = ((SlideshowTreeNode)subNode).Slide; if (slide != null) { slides.Add(slide.Name, slide); } // Iterate recursively this.ParseNodeForSlides(ref slides, subNode); } }