public bool JobChangeStatus(out string message) { message = "error"; try { TMSDbContext DbContext = new TMSDbContext(); DbContext.Database.CommandTimeout = Common.Constants.CommonConstants.TimeExcuteSql; DbContext.Database.ExecuteSqlCommand(Common.Constants.AbnormalQuery.ExcuteCheckTimeOut); var explanationRequest = _explanationRequestRepository.GetMulti(x => x.StatusRequestId == 1 || x.StatusRequestId == 5).ToList(); foreach (var item in explanationRequest) { if (_commonService.GetDateExRequestInPast(item.CreatedDate.Value) < DateTime.Now.Date) { item.StatusRequestId = 2; _explanationRequestRepository.Update(item); _explanationRequestService.Save(); } } log.Info("Job Change Status Run Success :" + DateTime.Now.ToString("dd'/'MM'/'yyyy HH:mm:ss")); message = "Success"; return(true); } catch (Exception ex) { message = "Error:" + ex.Message; return(false); } }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); timeDayRepository = new TimeDayRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); }
public void Initialize() { DbContext = new TMSDbContext(); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID1 = userManager.FindByName("lvtung").Id; UserID2 = "FakeID"; }
public void Initialize() { dbFactory = new DbFactory(); objAppUserRepository = new AppUserRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); DbContext = new TMSDbContext(); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID1 = userManager.FindByName("tqhuy").Id; UserID2 = "79187af0-b27b-486c-bfab-394981fe2b9233"; }
public void Initialize() { user = new AppUser { UserName = "******", FullName = "Le Van Dat", Email = "*****@*****.**" }; DbContext = new TMSDbContext(); }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); objRepository = new RequestRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID1 = userManager.FindByName("nvthang").Id; UserID2 = userManager.FindByName("admin").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); objAppUserRepository = new AppUserRepository(dbFactory); objUserOnsiteRepository = new UserOnsiteRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); UserID1 = "79187af0-b27b-486c-bfab-394981fe2b9233"; UserID2 = "79187af0-b27b-486c-bfab-394981fe2b9233"; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); listOTRepository = new ListOTRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); objServices = new ListOTService(listOTRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID2 = userManager.FindByName("vxthien").Id; UserID3 = userManager.FindByName("tqhuy").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); unitOfWork = new UnitOfWork(dbFactory); entitleDayRepository = new EntitleDayRepository(dbFactory); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID1 = userManager.FindByName("vxthien").Id; UserID2 = userManager.FindByName("tqhuy").Id; groupID1 = "1"; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); unitOfWork = new UnitOfWork(dbFactory); timeDayRepository = new TimeDayRepository(dbFactory); timeDayService = new TimeDayService(timeDayRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID2 = userManager.FindByName("nvthang").Id; UserID3 = userManager.FindByName("tqhuy").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); objRequestRepository = new ExplanationRequestRepository(dbFactory); statusRequestRepository = new StatusRequestRepository(dbFactory); objAppUserRepository = new AppUserRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); contextServices = new DelegationExplanationRequestService(objRequestRepository, statusRequestRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID1 = userManager.FindByName("nvthang").Id; UserID2 = userManager.FindByName("dmtuong").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); objRepository = new OTRequestRepository(dbFactory); statusRequestRepository = new StatusRequestRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); oTRequestUserRepository = new OTRequestUserRepository(dbFactory); objServices = new OTRequestService(oTRequestUserRepository, objRepository, statusRequestRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID2 = userManager.FindByName("vxthien").Id; UserID3 = userManager.FindByName("tqhuy").Id; UserID4 = userManager.FindByName("ltdat").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); objRequestRepository = new RequestRepository(dbFactory); statusRequestRepository = new StatusRequestRepository(dbFactory); objRequestTypeRepository = new RequestTypeRepository(dbFactory); objRequestReasonTypeRepository = new RequestReasonTypeRepository(dbFactory); objAppUserRepository = new AppUserRepository(dbFactory); objEntitleDayRepository = new EntitleDayRepository(dbFactory); objEntitleDayAppUserRepository = new EntitleDayAppUserRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); //contextServices = new RequestService(objRequestRepository, statusRequestRepository, objRequestTypeRepository, objRequestReasonTypeRepository, objAppUserRepository, objEntitleDayRepository,objEntitleDayAppUserRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); UserID2 = userManager.FindByName("nvthang").Id; UserID3 = userManager.FindByName("tqhuy").Id; }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); explanationRequestRepository = new ExplanationRequestRepository(dbFactory); timeSheetRepository = new FingerTimeSheetRepository(dbFactory); statusRequestRepository = new StatusRequestRepository(dbFactory); requestRepository = new RequestRepository(dbFactory); entitleDayAppUser = new EntitleDayAppUserRepository(dbFactory); groupRepository = new GroupRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); //explanationService = new ExplanationRequestService(explanationRequestRepository, timeSheetRepository, statusRequestRepository, requestRepository, entitleDayAppUser, unitOfWork, groupRepository); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); userId1 = userManager.FindByName("tqhuy").Id; userId2 = userManager.FindByName("lvtung").Id; userId3 = "FakeId"; userId4 = userManager.FindByName("dmtuong").Id; }
public void Initialize() { dbFactory = new DbFactory(); DbContext = new TMSDbContext(); explanationRequestRepository = new ExplanationRequestRepository(dbFactory); abnormalcaseRepository = new AbnormalCaseRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); //abnormalcaseService = new AbnormalCaseService(abnormalcaseRepository, explanationRequestRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); userId1 = userManager.FindByName("admin").Id; userId2 = userManager.FindByName("ltdat").Id; //approveID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); //rejectID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Reject").ID.ToString(); //cancelID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Cancel").ID.ToString(); //delegationID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Delegation").ID.ToString(); //pendingID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Pending").ID.ToString(); }
public void Initialize() { DbContext = new TMSDbContext(); dbFactory = new DbFactory(); timeSheetRepository = new TimeSheetRepository(dbFactory); statusRequestRepository = new StatusRequestRepository(dbFactory); AbnormalCaseRepository = new AbnormalCaseRepository(dbFactory); ExplanationRepository = new ExplanationRequestRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); timeSheetService = new TimeSheetService(timeSheetRepository, AbnormalCaseRepository, ExplanationRepository, unitOfWork); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); memberID = userManager.FindByName("tqhuy").Id; adminID = userManager.FindByName("dmtuong").Id; approveID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); rejectID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); cancelID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); delegationID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); pendingID = statusRequestRepository.GetSingleByCondition(x => x.Name == "Approved").ID.ToString(); }
public ApplicationUserStore(TMSDbContext context) : base(context) { }
public TMSController(TMSDbContext _context) { db = _context; }
public ExplanationRequestRepository(IDbFactory dbFactory) : base(dbFactory) { dbContext = new TMSDbContext(); }
private static void GetDataTimeSheetFromListDateOnePerson(List <DateTime> lstDate, string username) { TMSDbContext DbContext = new TMSDbContext(); IDbFactory dbFactory = new DbFactory(); IAppUserRepository appUserRepository = new AppUserRepository(dbFactory); IChildcareLeaveRepository childcareLeaveRepository = new ChildcareLeaveRepository(dbFactory); IFingerTimeSheetRepository fingerTimeSheetRepository = new FingerTimeSheetRepository(dbFactory); ITimeDayRepository timeDayRepository = new TimeDayRepository(dbFactory); IFingerTimeSheetTmpRepository tmpTimeSheetRepository = new FingerTimeSheetTmpRepository(dbFactory); IOTRequestRepository OTRequestRepository = new OTRequestRepository(dbFactory); IFingerMachineUserRepository fingerMachineUserRepository = new FingerMachineUserRepository(dbFactory); IOTRequestUserRepository otrequestUserRepository = new OTRequestUserRepository(dbFactory); IReportRepository reportRepository = new ReportRepository(dbFactory); UnitOfWork unitOfWork = new UnitOfWork(dbFactory); IRequestRepository requestRepository = new RequestRepository(dbFactory); IExplanationRequestRepository explanationRepository = new ExplanationRequestRepository(dbFactory); IAbnormalCaseRepository abnormalRepository = new AbnormalCaseRepository(dbFactory); IEntitleDayAppUserRepository entitledayRepository = new EntitleDayAppUserRepository(dbFactory); IUserOnsiteRepository userOnsiteRepository = new UserOnsiteRepository(dbFactory); ISystemConfigRepository systemConfigRepository = new SystemConfigRepository(dbFactory); IHolidayRepository holidayRepository = new HolidayRepository(dbFactory); ICommonService commonService = new CommonService(systemConfigRepository, timeDayRepository, holidayRepository, unitOfWork); ISystemService systemService = new SystemService(); FingerTimeSheetService fingerTimeSheetService = new FingerTimeSheetService(fingerTimeSheetRepository, tmpTimeSheetRepository, timeDayRepository, OTRequestRepository, fingerMachineUserRepository, otrequestUserRepository, appUserRepository, childcareLeaveRepository, reportRepository, unitOfWork, requestRepository, explanationRepository, abnormalRepository, entitledayRepository, userOnsiteRepository, systemService, commonService); var userId = DbContext.Users.Where(x => x.UserName.Equals(username)).Select(x => x.Id).FirstOrDefault(); var lstUserNo = DbContext.FingerMachineUsers.Where(x => x.UserId.Equals(userId)).Select(x => x.ID); var userInfo = DbContext.USERINFO.Where(x => lstUserNo.Contains(x.Badgenumber)).FirstOrDefault(); foreach (var datetime in lstDate) { var date = datetime.Date; var date1 = datetime.AddDays(1).Date; var listTimeSheet = DbContext.CHECKINOUT.Where(x => x.CHECKTIME >= date && x.CHECKTIME < date1 && x.USERID.Equals(userInfo.USERID)).ToList(); if (listTimeSheet.Count > 0) { var timeSheetId = DbContext.FingerTimeSheets.Where(x => x.DayOfCheck == datetime && lstUserNo.Contains(x.UserNo)).Select(x => x.ID).AsEnumerable(); if ((DbContext.ExplanationRequests.Where(x => timeSheetId.Contains(x.TimeSheetId)).FirstOrDefault() != null)) { explanationRepository.DeleteExplanation(timeSheetId.FirstOrDefault()); } if ((DbContext.AbnormalCases.Where(x => timeSheetId.Contains(x.TimeSheetID)).FirstOrDefault() != null)) { abnormalRepository.DeleteAbnormalCase(timeSheetId.FirstOrDefault()); } if ((DbContext.FingerTimeSheets.Where(x => timeSheetId.Contains(x.ID)).FirstOrDefault() != null)) { fingerTimeSheetRepository.DeleteFingerTimeSheet(timeSheetId.FirstOrDefault()); } tmpTimeSheetRepository.RemoveAllData(); foreach (var item in listTimeSheet) { FingerTimeSheetTmp tmp = new FingerTimeSheetTmp(); var user = DbContext.USERINFO.FirstOrDefault(x => x.USERID == item.USERID); if (user == null) { continue; } tmp.UserNo = user.Badgenumber; tmp.Date = item.CHECKTIME; tmp.AccName = DbContext.USERINFO.Where(x => x.USERID == item.USERID).Select(x => x.Name).FirstOrDefault(); tmpTimeSheetRepository.Add(tmp); } unitOfWork.Commit(); int count = 0; List <FingerTimeSheetTmpErrorModel> listModel = new List <FingerTimeSheetTmpErrorModel>(); var result = fingerTimeSheetService.ReImportTimeSheet(out count, DbContext, out listModel); if (result) { log.Info("reimport success"); } else { log.Info("reimport fail"); } } } }
public void Initialize() { DbContext = new TMSDbContext(); userManager = new UserManager <AppUser>(new UserStore <AppUser>(DbContext)); }
private static void GetDataTimeSheetFromListDate(List <DateTime> lstDate) { TMSDbContext DbContext = new TMSDbContext(); IDbFactory dbFactory = new DbFactory(); IAppUserRepository appUserRepository = new AppUserRepository(dbFactory); IChildcareLeaveRepository childcareLeaveRepository = new ChildcareLeaveRepository(dbFactory); IFingerTimeSheetRepository fingerTimeSheetRepository = new FingerTimeSheetRepository(dbFactory); ITimeDayRepository timeDayRepository = new TimeDayRepository(dbFactory); IFingerTimeSheetTmpRepository tmpTimeSheetRepository = new FingerTimeSheetTmpRepository(dbFactory); IOTRequestRepository OTRequestRepository = new OTRequestRepository(dbFactory); IFingerMachineUserRepository fingerMachineUserRepository = new FingerMachineUserRepository(dbFactory); IOTRequestUserRepository otrequestUserRepository = new OTRequestUserRepository(dbFactory); IReportRepository reportRepository = new ReportRepository(dbFactory); UnitOfWork unitOfWork = new UnitOfWork(dbFactory); IRequestRepository requestRepository = new RequestRepository(dbFactory); IExplanationRequestRepository explanationRepository = new ExplanationRequestRepository(dbFactory); IAbnormalCaseRepository abnormalRepository = new AbnormalCaseRepository(dbFactory); IEntitleDayAppUserRepository entitledayRepository = new EntitleDayAppUserRepository(dbFactory); IUserOnsiteRepository userOnsiteRepository = new UserOnsiteRepository(dbFactory); ISystemService systemService = new SystemService(); ISystemConfigRepository systemConfigRepository = new SystemConfigRepository(dbFactory); IHolidayRepository holidayRepository = new HolidayRepository(dbFactory); ICommonService commonService = new CommonService(systemConfigRepository, timeDayRepository, holidayRepository, unitOfWork); FingerTimeSheetService fingerTimeSheetService = new FingerTimeSheetService(fingerTimeSheetRepository, tmpTimeSheetRepository, timeDayRepository, OTRequestRepository, fingerMachineUserRepository, otrequestUserRepository, appUserRepository, childcareLeaveRepository, reportRepository, unitOfWork, requestRepository, explanationRepository, abnormalRepository, entitledayRepository, userOnsiteRepository, systemService, commonService); var listDateImportTimeSheet = new List <DateTime>(); try { foreach (var datetime in lstDate) { var date = datetime.Date; if (DbContext.FingerTimeSheets.Where(x => x.DayOfCheck == date).FirstOrDefault() == null) { listDateImportTimeSheet.Add(datetime); } } foreach (var datetime in listDateImportTimeSheet) { var date = datetime.Date; var date1 = datetime.AddDays(1).Date; var listTimeSheet = DbContext.CHECKINOUT.Where(x => x.CHECKTIME >= date && x.CHECKTIME < date1).ToList(); if (listTimeSheet.Count > 0) { tmpTimeSheetRepository.RemoveAllData(); List <FingerTimeSheetTmp> listTmp = new List <FingerTimeSheetTmp>(); foreach (var item in listTimeSheet) { FingerTimeSheetTmp tmp = new FingerTimeSheetTmp(); var user = DbContext.USERINFO.FirstOrDefault(x => x.USERID == item.USERID); if (user == null) { continue; } tmp.UserNo = user.Badgenumber; tmp.Date = item.CHECKTIME; tmp.AccName = DbContext.USERINFO.Where(x => x.USERID == item.USERID).Select(x => x.Name).FirstOrDefault(); tmpTimeSheetRepository.Add(tmp); listTmp.Add(tmp); } unitOfWork.Commit(); int count = 0; List <FingerTimeSheetTmpErrorModel> listModel = new List <FingerTimeSheetTmpErrorModel>(); var result = fingerTimeSheetService.ImportTimeSheet(out count, DbContext, out listModel); } } } catch (Exception e) { log.Error("ExData:" + e.Data); log.Error("ExMess:" + e.Message); } }
public ServiceController(TMSDbContext _context) { db = _context; /* var allreadyExist = db.TMS.Any(x => x.Id == 1); * if (!allreadyExist) * { * * * db.TMS.Add(new TMS { Name = "Gausdal", Category = "Transfleet" }); * db.SaveChanges(); * } * var allreadyExist1 = db.TMS.Any(x => x.Id == 2); * if (!allreadyExist1) * { * * db.TMS.Add(new TMS { Name = "Brødrene Dahl", Category = "Transfleet" }); * db.SaveChanges(); * } * var allreadyExist2 = db.TMS.Any(x => x.Id == 3); * if (!allreadyExist2) * { * db.TMS.Add(new TMS { Name = "Suldaltransport",Category = "LogNett"}); * db.SaveChanges(); * } * var allreadyExist3 = db.TMS.Any(x => x.Id == 4); * if (!allreadyExist3) * { * db.TMS.Add(new TMS { Name = "Movator", Category = "Transfleet" }); * db.SaveChanges(); * } * * * var allreadyExistServ = db.TF_Services.Any(x => x.Id == 1); * if (!allreadyExistServ) * { * * * db.TF_Services.Add(new TF_Services { Name = "Transfleetcoreservcie", DisplayName = "Transfleet CoreService",Status="Stopped" }); * db.SaveChanges(); * } * * var allreadyExistServ1 = db.TF_Services.Any(x => x.Id == 2); * if (!allreadyExistServ1) * { * * * db.TF_Services.Add(new TF_Services { Name = "Transfleetxdbimport", DisplayName = "Transfleet Xdb import",Status = "stoppet" }); * db.SaveChanges(); * } * var allreadyExistServ2 = db.TF_Services.Any(x => x.Id == 3); * if (!allreadyExistServ2) * { * * * db.TF_Services.Add(new TF_Services { Name = "Transfleetdbxexport", DisplayName = "Transfleet Dbx export",Status = "Running" }); * db.SaveChanges(); * } * var allreadyExistServ3 = db.TF_Services.Any(x => x.Id == 4); * if (!allreadyExistServ3) * { * * * db.TF_Services.Add(new TF_Services { Name = "Transfleetfileconverter", DisplayName = "Transfleet Fileconverter ",Status="Running" }); * db.SaveChanges(); * } * * * var allreadyExistJoinTable = db.RunningServices.Any(x => x.Id == 1); * if (!allreadyExistJoinTable) * { * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id=1,ServiceId=1, Status = "Stopped" }); * * * db.SaveChanges(); * } * var allreadyExistJoinTable1 = db.RunningServices.Any(x => x.Id == 2); * if (!allreadyExistJoinTable1) * { * * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 1, ServiceId = 2, Status = "Running" }); * * db.SaveChanges(); * } * var allreadyExistJoinTable2 = db.RunningServices.Any(x => x.Id == 3); * if (!allreadyExistJoinTable2) * { * * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 1, ServiceId = 3, Status = "Stopped" }); * * db.SaveChanges(); * } * var allreadyExistJoinTable3 = db.RunningServices.Any(x => x.Id == 4); * if (!allreadyExistJoinTable3) * { * * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 2, ServiceId = 3, Status = "Stopped" }); * * db.SaveChanges(); * } * var allreadyExistJoinTable4 = db.RunningServices.Any(x => x.Id == 5); * if (!allreadyExistJoinTable4) * { * * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 3, ServiceId = 3, Status = "Stopped" }); * * db.SaveChanges(); * } * * var allreadyExistJoinTable5 = db.RunningServices.Any(x => x.Id == 6); * if (!allreadyExistJoinTable5) * { * * * * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 4, ServiceId = 3, Status = "Stopped" }); * * db.SaveChanges(); * } * var allreadyExistJoinTable6 = db.RunningServices.Any(x => x.Id == 7); * if (!allreadyExistJoinTable6) * { * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 1, ServiceId = 5, Status = "Running" }); * db.RunningServices.Add(new ServicesRunningOnTMS { TMS_Id = 1, ServiceId = 6, Status = "Running" }); * * db.SaveChanges(); * * * * }*/ }
public bool ImportTimeSheet(out string message, DateTime dateJobExcute) { message = "error"; DateTime yesterday = dateJobExcute.AddDays(-1).Date; TMSDbContext DbContext = new TMSDbContext(); try { var listTimeSheet = DbContext.CHECKINOUT.Where(x => x.CHECKTIME >= yesterday && x.CHECKTIME < dateJobExcute).ToList(); if (listTimeSheet.Count > 0) { _tmpTimeSheetRepository.RemoveAllData(); List <FingerTimeSheetTmp> listTmp = new List <FingerTimeSheetTmp>(); foreach (var item in listTimeSheet) { FingerTimeSheetTmp tmp = new FingerTimeSheetTmp(); var user = DbContext.USERINFO.FirstOrDefault(x => x.USERID == item.USERID); if (user == null) { continue; } tmp.UserNo = user.Badgenumber; tmp.Date = item.CHECKTIME; tmp.AccName = DbContext.USERINFO.Where(x => x.USERID == item.USERID).Select(x => x.Name).FirstOrDefault(); _tmpTimeSheetRepository.Add(tmp); listTmp.Add(tmp); } _unitOfWork.Commit(); //import to table finger timesheet int countSuccess = 0; List <FingerTimeSheetTmpErrorModel> listModel = new List <FingerTimeSheetTmpErrorModel>(); if (_fingerTSService.ImportTimeSheet(out countSuccess, DbContext, out listModel)) { message = "Success"; log.Info("Job Time Sheet Run Success :" + DateTime.Now.ToString("dd'/'MM'/'yyyy HH:mm:ss")); return(true); } else { message = ""; StringBuilder sb = new StringBuilder(); foreach (var item in listModel) { sb.AppendLine(item.Error); } message = sb.ToString(); return(false); } } else { message = "FingerTimeSheetTmp table has no data !"; return(true); } } catch (Exception ex) { message = ex.Message; log.Error(ex.Message); if (ex.StackTrace != null) { log.Info(ex.StackTrace); } return(false); } }
public RequestsController(TMSDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public MessageController(IHubContext <MessageHub> messageHubContext, TMSDbContext _context)//, TMSDbContext _context { db = _context; _messageHubContext = messageHubContext; }
public BasicRepository(TMSDbContext context) { this.context = context; db = this.context.Set <T>(); }
public TaskRepository(TMSDbContext context) { this.context = context; db = this.context.Set <Task>(); }
public TMSDbContext Init() { return(dbContext ?? (dbContext = new TMSDbContext())); }