日期:2014-05-17 浏览次数:20484 次
/// <summary>
/// 任务-批量删除
/// (2013.5.25)
/// </summary>
/// <param name="idArr"></param>
/// <returns></returns>
public static bool BatchDelete(string[] guidArr)
{
try
{
using (var db =new WEBVODEntities())
{
List<Task> taskList = db.Task.Where(a => guidArr.Contains(a.Guid)).ToList();
List<TaskDept> taskDeptList = db.TaskDept.Where(a => guidArr.Contains(a.TaskGuid)).ToList();
foreach (var task in taskList)
{
db.DeleteObject(task);
}
foreach (var taskDept in taskDeptList)
{
db.DeleteObject(taskDept);
}
db.SaveChanges();
return true;
}
}