/// <summary> /// 修改 /// </summary> /// <param name="fun"></param> /// <returns></returns> public int Update(TaskSendeeModel fun) { string sql = "update CMT_CommandSendee set CommandID=@commandID,UserID=@userID,State=@state,CreateTime=@createTime,IsDel=@isDel where ID=@id"; SqlParameter[] pms = { new SqlParameter("@commandID", fun.CommandID), new SqlParameter("@userID", fun.UserID), new SqlParameter("@state", fun.State), new SqlParameter("@createTime", fun.CreateTime), new SqlParameter("@isDel", fun.IsDel), }; return((int)DBHelper.ExecuteNonQuery(sql, type, pms)); }
/// <summary> /// 根据单个ID进行获取 /// </summary> /// <param name="id"></param> /// <returns></returns> public TaskSendeeModel GetById(int id) { TaskSendeeModel taskDispense = null; string sql = string.Format("select ID,CommandID,UserID,State,CreateTime,IsDel from CMT_CommandSendee where ID={0}", id); using (SqlDataReader reader = DBHelper.ExecuteReader(sql, type)) { if (reader.HasRows) { if (reader.Read()) { taskDispense = new TaskSendeeModel(); taskDispense.Id = reader.GetInt32(0); taskDispense.CommandID = reader.GetInt32(2); } } } return(taskDispense); }
/// <summary> /// 修改 /// </summary> /// <param name="role"></param> /// <returns></returns> public int Update(TaskSendeeModel task) { return(dal.Update(task)); }