本文整理汇总了C#中UnitOfWork.SetIsDelete方法的典型用法代码示例。如果您正苦于以下问题:C# UnitOfWork.SetIsDelete方法的具体用法?C# UnitOfWork.SetIsDelete怎么用?C# UnitOfWork.SetIsDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitOfWork
的用法示例。
在下文中一共展示了UnitOfWork.SetIsDelete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeletePayrollTable
private bool DeletePayrollTable(List<Guid> listProfileID, Guid cutOffDurationID)
{
#region Delete PayrollTable
try
{
using (var context = new VnrHrmDataContext())
{
var unitOfWork = new UnitOfWork(context);
int pageSize = 2000;//tối đa là 2100 parameter
int result = 0;
foreach (var listProfileIDBySize in listProfileID.Chunk(pageSize))
{
result += unitOfWork.SetIsDelete(context.Sal_PayCommission.Where(m => m.CutoffDurationID != null && m.ProfileID != null && !m.IsDelete.HasValue && (Guid)m.CutoffDurationID == cutOffDurationID && listProfileIDBySize.Contains((Guid)m.ProfileID)));
}
return true;
}
}
catch (Exception)
{
return false;
}
#endregion
}
示例2: DeletePayrollTable
private bool DeletePayrollTable(List<Guid> listProfileID, Guid cutOffDurationID, bool Settlement, TraceLogManager FileLog)
{
#region Delete PayrollTable
try
{
if (!Settlement)
{
using (var context = new VnrHrmDataContext())
{
var unitOfWork = new UnitOfWork(context);
int pageSize = 2000;//tối đa là 2100 parameter
int result = 0;
DateTime DatetimeStart = DateTime.Now;
foreach (var listProfileIDBySize in listProfileID.Chunk(pageSize))
{
result += unitOfWork.SetIsDelete(context.Sal_PayrollTable.Where(d => !d.IsDelete.HasValue
&& d.CutOffDurationID == cutOffDurationID && listProfileIDBySize.Contains(d.ProfileID)));
}
FileLog.WriteLog("", "Delete Old Data Payroll", Common.ComputeTime(DatetimeStart, DateTime.Now));
return true;
}
}
else
{
return true;
}
}
catch (Exception)
{
return false;
}
#endregion
}
示例3: DeleteAttendance
private DataErrorCode DeleteAttendance(DateTime monthYear, Guid cutOffDurationID, List<Guid> listProfileID)
{
#region Delete Attendance
try
{
using (var context = new VnrHrmDataContext())
{
var unitOfWork = new UnitOfWork(context);
int pageSize = 2000;//tối đa là 2100 parameter
int result = 0;
foreach (var listProfileIDBySize in listProfileID.Chunk(pageSize))
{
result += unitOfWork.SetIsDelete(context.Att_AttendanceTable.Where(d => !d.IsDelete.HasValue && d.MonthYear == monthYear
&& d.CutOffDurationID == cutOffDurationID && listProfileIDBySize.Contains(d.ProfileID)));
}
return DataErrorCode.Success;
}
}
catch (Exception)
{
return DataErrorCode.Error;
}
#endregion
}