-----------------------Webservice里面的方法-------------------------------------------------- public bool IsMake(string dis, string type, int oid) { bool flag = false; string sql = "select Top(1) * from Logbook where Distinction='{0}' and OperateID={1} order by DateTime desc"; sql = string.Format(sql, dis, oid); DataTable dst = ExecuteQuery(sql);
string sqlType = "select * from Type where TypeName='{0}' and Operate={1}"; sqlType = string.Format(sqlType, type, oid); DataTable dstType = ExecuteQuery(sqlType); if (dst != null && dstType != null && dst.Rows.Count > 0 && dstType.Rows.Count > 0) { DateTime tim = Convert.ToDateTime(dst.Rows[0]["DateTime"].ToString()); tim.AddMonths(Convert.ToInt32(dstType.Rows[0]["Cycle"].ToString())); string sqlReturn = "select * from Logbook where Distinction='{0}' and DateTime>='{1}' and DateTime<='{2}' and OperateID={3}"; sqlReturn = string.Format(sqlReturn, dis, dst.Rows[0]["DateTime"].ToString(), tim.ToString(), oid); DataTable dstRe = ExecuteQuery(sqlReturn); if (dstRe != null && dstRe.Rows.Count > 0) { flag = true; } } return flag; }