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