//获取某类目的年度 public static string getClassYear(int classID) { string sqlstr = "select 年度 from 类目 where 类目ID =" + classID; string year = DataSql.GetSingle(sqlstr).ToString(); return(year); }
//获取某类目的保管期限 public static string getClassLimit(int classID) { string sqlstr = "select 保管期限 from 类目 where 类目ID =" + classID; string limit = DataSql.GetSingle(sqlstr).ToString(); return(limit); }
//根据目录ID获取一级类目ID public static int getTopClassIDByContentID(int contentID) { string sqlstr = "select 类目ID from 目录 where 目录ID =" + contentID; int topclassID = (int)DataSql.GetSingle(sqlstr); return(topclassID); }
//根据类目ID获取一级类目ID public static int getTopClassIDByClassID(int classID) { string sqlstr = "select 一级ID from 类目 where 类目ID =" + classID; int topclassID = (int)DataSql.GetSingle(sqlstr); return(topclassID); }
/// <summary> /// 插入案卷目录 /// </summary> /// <param name="ClassID">类目ID</param> /// <param name="ContentNum">目录号</param> /// <param name="Limite">保管期限</param> /// <param name="disTxt">说明</param> /// <returns>true 成功 false 失败</returns> public int InsertContent(int TopClassID, string ContentNum, string Limite, string TypeNum, string desTxt, int UserID) { strSql = new StringBuilder(); strSql.Append("insert into 案卷目录(一级类目ID,目录号,保管期限,科室代号,说明,UserID,InTime) values "); strSql.Append("(@TopClassID,@ContentNum,@Limite,@TypeNum,@desTxt,@UserID,@InTime)"); strSql.Append(";select @@IDENTITY;"); SqlParameter[] parameter = { new SqlParameter("@TopClassID", SqlDbType.Int, 4), new SqlParameter("@ContentNum", SqlDbType.NVarChar, 20), new SqlParameter("@Limite", SqlDbType.NVarChar, 10), new SqlParameter("@TypeNum", SqlDbType.NVarChar, 15), new SqlParameter("@desTxt", SqlDbType.NVarChar, 50), new SqlParameter("@UserID", SqlDbType.Int, 4), new SqlParameter("@InTime", SqlDbType.DateTime, 8) }; parameter[0].Value = TopClassID; parameter[1].Value = ContentNum.Trim(); parameter[2].Value = Limite.Trim(); parameter[3].Value = TypeNum.Trim(); parameter[4].Value = desTxt.Trim(); parameter[5].Value = UserID; parameter[6].Value = System.DateTime.Now; object obj = DataSql.GetSingle(strSql.ToString(), parameter); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }