void _SetProc(_CAgentInfo Agent_, SProc Proc_) { Agent_.ProcStat = (JsonDataObject)JsonParser.Parse(Proc_.Stat); Agent_.Item.SubItems[(Int32)EField.ProcName].Text = Proc_.Name; Agent_.Item.SubItems[(Int32)EField.ProcStat].Text = Proc_.Stat; lvAgents.Sort(); }
void _AddAgent(CKey Key_, SAgent Agent_, SProc Proc_) { var Agent = _AddAgent(Key_, Agent_); if (Agent == null) { throw new Exception("AddAgent Fail"); } _SetProc(Agent, Proc_); }
public static string Query(NameValueCollection queryString) { return(SProc.SelectForPage("SysQuery", queryString).ToJson().Replace(" 00:00:00", "")); }
public static string GetPersonalList(int?deptId, int?sectionId, string table, string colName, NameValueCollection queryString) { var isDate1 = DateTime.TryParse(queryString["StartDate"], out var startDate); var isDate2 = DateTime.TryParse(queryString["EndDate"], out var endDate); var noTrain = queryString["NoTrain"]; if (!isDate1) { startDate = new DateTime(1900, 1, 1); } if (!isDate2) { endDate = new DateTime(9999, 12, 31); } var fieldName = ""; switch (table) { case "VPersonal": // 个人信息 fieldName = "Birthday"; break; case "vvdivisionwork0": //分管工作 case "vvdivisionwork1": //重点工程 case "vvTrainLearn": //培训信息 fieldName = "StartDate"; break; case "vvInvestigate0": //平时考察 case "vvInvestigate1": //专项考察 case "vvInvestigate2": //年度考核 case "vvInvestigate3": //民主测评 case "vvInvestigate4": //民主推荐 case "VPatrolInspection": //巡查巡察 case "VPostsAndStaffInspection": //定岗定职 case "vvinspection": //督查信息 fieldName = "Date"; break; } var collection = queryString.RemoveKey("deptId", "sectionId", "StartDate", "EndDate", "NoTrain", "colName"); MDataTable result; if (table == "vvTrainLearn") { result = SProc.Select("S_SelectTrainLearn", "StartDate", queryString["StartDate"], "EndDate", queryString["EndDate"], "NoTrain", noTrain, "deptId", deptId); result.TableName = table; } else { using (var action = new MAction(table)) { var where = collection.ToWhere(out int page, out int pagesize, out string sort) + $" and {fieldName} between '{startDate}' and '{endDate}'" + " and (deptId like '" + (deptId ?? 0) + "%'" + " or sectionId like '" + (sectionId ?? 0) + "%'" + " or " + (deptId == 0 || deptId == null ? "1=1" : "1=0") + ")" + sort; result = action.Select(where, page, pagesize, "*"); } } return(GetResult(queryString, queryString["page"].ToInt(), result, colName)); }