public List <TaskInfo> GetTaskInfosBySponsor(User user) { List <TaskInfo> elements = new List <TaskInfo>(); string sql = "select * from TaskInfo where ','+Sponsor+',' like '%" + user.ID + "%'"; DataTable dt = sqlHelper.Query(sql); if (dt != null && dt.Rows.Count > 0) { FlowLogic ftl = FlowLogic.GetInstance(); for (int i = 0; i < dt.Rows.Count; i++) { TaskInfo element = new TaskInfo(Convert.ToInt32(dt.Rows[i]["ID"]), Convert.ToInt32(dt.Rows[i]["EntityId"]), ftl.GetFlow(Convert.ToInt32(dt.Rows[i]["FlowID"])), dt.Rows[i]["Sponsor"].ToString(), dt.Rows[i]["Remark"].ToString()); element.Remark = dt.Rows[i]["Remark"].ToString(); elements.Add(element); } } return(elements); }
public TaskInfo GetTaskInfoByEntityId(int entityId) { string sql = "select * from TaskInfo where EntityId=" + entityId; DataTable dt = sqlHelper.Query(sql); if (dt != null && dt.Rows.Count > 0) { FlowLogic ftl = FlowLogic.GetInstance(); TaskInfo element = new TaskInfo(Convert.ToInt32(dt.Rows[0]["ID"]), Convert.ToInt32(dt.Rows[0]["EntityId"]), ftl.GetFlow(Convert.ToInt32(dt.Rows[0]["FlowID"])), dt.Rows[0]["Sponsor"].ToString(), dt.Rows[0]["Remark"].ToString()); return(element); } return(null); }