/// <summary> /// 添加一个记录/对象,并返回新记录的主键值 /// </summary> /// <param name="entityPointInfo"></param> /// <returns></returns> public static Int32 Add(EtAtennalType etAtennalType) { int result = -1; DynamicParameters p = new DynamicParameters(); p.Add("@EDSID", etAtennalType.EDSID); p.Add("@Name", etAtennalType.Name); p.Add("@ID", 0, DbType.Int32, ParameterDirection.Output); using (var cnn = new SqlConnection(SQLDBHelper.ConnectionString)) { cnn.Open(); cnn.Execute("[dbo].[usp_InsertAtennalType]", p, null, null, CommandType.StoredProcedure); result = p.Get<int>("@ID"); cnn.Close(); } return result; }
/// <summary> /// 修改主键值一致的记录,并返回受影响行数 /// </summary> /// <param name="entityPdt">数据库相对应的对象实例</param> public static int Modify(EtAtennalType etAtennalType) { return(DALAtennalType.Modify(etAtennalType)); }
/// <summary> /// 添加一个对象,返回新对象ID号 /// </summary> /// <param name="entityPdt"></param> /// <returns></returns> public static Int32 Add(EtAtennalType etAtennalType) { return(DALAtennalType.Add(etAtennalType)); }