当前位置: 首页>>代码示例>>C#>>正文


C# UnitOfWork.SetIsDelete方法代码示例

本文整理汇总了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
        }
开发者ID:dtafe,项目名称:vnr,代码行数:27,代码来源:Sal_ComputeCommissionServices.cs

示例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
        }
开发者ID:dtafe,项目名称:vnr,代码行数:36,代码来源:Sal_ComputePayrollServices.cs

示例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
        }
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Att_AttendanceServices.cs


注:本文中的UnitOfWork.SetIsDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。