/// <summary> /// 根据groupID得到所有用途 /// </summary> /// <param name="groupID"></param> /// <returns></returns> public static List<Usage> GetUsageList() { List<Usage> usageList = new List<Usage>(); foreach (DataRow row in UsageTable.Rows) { Usage u = new Usage(); u.usageID = int.Parse(row["UsageID"].ToString()); u.usageName = row["UsageName"].ToString(); u.usageDesc = row["UsageDesc"].ToString(); usageList.Add(u); } return usageList; }
/// <summary> /// 添加某项用途 /// </summary> /// <param name="groupID"></param> /// <returns></returns> public static bool AddUsage(Usage us) { //SqlParameter[] Parameters = new SqlParameter[3]; //Parameters[0] = new SqlParameter("@UsageName", SqlDbType.NVarChar); //Parameters[1] = new SqlParameter("@UsageDesc", SqlDbType.NVarChar); //Parameters[2] = new SqlParameter("@GroupID", SqlDbType.UniqueIdentifier); //Parameters[0].Value = us.UsageName; //Parameters[1].Value = us.UsageDesc; //Parameters[2].Value = us.GroupID; //int result = SqlHelper.ExecuteNonQuery(SqlHelper.SqlCon_QJVRMS, CommandType.StoredProcedure, "Usage_AddUsage", Parameters); //return result == 1; QJVRMS.Business.BaseInfoWS.BaseInfoService bis = new QJVRMS.Business.BaseInfoWS.BaseInfoService(); return bis.AddUsage(us.UsageName, us.UsageDesc); }