public RolesController(IHrUnitOfWork hrUnitOfWork) : base(hrUnitOfWork) { db = new UserContext(); RoleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(new IdentityDbContext("HrContext"))); UserManager = new UserManager <IdentityUser>(new UserStore <IdentityUser>(new IdentityDbContext("HrContext"))); _hrUnitOfWork = hrUnitOfWork; }
public AddNotifyLetters(IHrUnitOfWork _unitofwork, NotifyLetter _Record, string _Language) { unitofwork = _unitofwork; Language = _Language; if (_Record != null) { RecordsList.Add(_Record); } }
public static bool ExtendContractMethod(IHrUnitOfWork unitofwork, string Language, out string ErrorMessage) { bool Result = false; ErrorMessage = ""; try { // Get All employees The will Send Email to whose contract Finish and before No of days var Employments = unitofwork.EmployeeRepository.SendMailEmployees(); List <NotifyLetter> NotifyLettersList = new List <NotifyLetter>(); foreach (var item in Employments) { string NotifySource = "", Description = ""; if (item.Renew) { NotifySource = Constants.Sources.RenewContract; Description = MsgUtils.Instance.Trls("Contract has been renewed", Language); } else { NotifySource = Constants.Sources.ContractFinish; Description = MsgUtils.Instance.Trls("Contract has been finished", Language); } bool IsSentBefore = unitofwork.NotifyLetterRepository.IsNotificationSent(item.EmpId, DateTime.Today.Date, NotifySource); if (!IsSentBefore) { NotifyLetter NL = new NotifyLetter() { CompanyId = item.CompanyId, EmpId = item.EmpId, NotifyDate = DateTime.Today, NotifySource = NotifySource, SourceId = item.Id.ToString(), Sent = false, EventDate = item.EndDate, Description = Description }; NotifyLettersList.Add(NL); //unitofwork.NotifyLetterRepository.Add(NL); } } string DefaultErrorMessage = MsgUtils.Instance.Trls("NotifyLetterNotSent", Language); AddNotifyLetters AddNotifyLetters = new AddNotifyLetters(unitofwork, NotifyLettersList, Language); Result = AddNotifyLetters.Run(out ErrorMessage, DefaultErrorMessage); } catch { } return(Result); }
public AutoMapper(AutoMapperParm p, IHrUnitOfWork unitofwork, IIdentity identity) { Parm = p; HrUnitOfWork = unitofwork; SourceProperties = p.Source.GetType().GetProperties(); DestionationProperties = p.Destination == null ? null : p.Destination.GetType().GetProperties(); Identity = identity; company = Identity.GetDefaultCompany(); // get all notificatios for current object Notifications = HrUnitOfWork.NotificationRepository.GetNotifications(company, p.ObjectName, p.Version); }
public static bool IsValid(IHrUnitOfWork _hrUnitOfWork, string EmpIds, string Source, int SourceId, DateTime StartTime, DateTime EndTime, DateTime DateToCheck, string Language, out string ErrorMessage) { ErrorMessage = string.Empty; bool IsValid = true; var Tasks = _hrUnitOfWork.MeetingRepository.GetEmployeeSchedual(EmpIds, StartTime, EndTime, Source, SourceId, Language).Select(a => a.Tasks).ToList(); foreach (var item in Tasks) { if (item.Select(s => s.EndTime).FirstOrDefault() != null) { if (item.FirstOrDefault().StartTime != null) { if (item.FirstOrDefault().Source.Equals(StringEnum.GetStringValue(Constants.Enumerations.ScheduleSourcesEnum.Leave))) { IsValid = false; } if (item.FirstOrDefault().Source.Equals(StringEnum.GetStringValue(Constants.Enumerations.ScheduleSourcesEnum.AssignOrder))) { IsValid = false; } if (IsValid) { var Task_StartDateTime = item.Select(s => s.StartTime).FirstOrDefault(); var Task_EndDateTime = item.Select(s => s.EndTime).FirstOrDefault(); var StartDateTime = StartTime; var EndDateTime = EndTime; List <DateTimeGroup> DateTimeGroupList = new List <DateTimeGroup>(); DateTimeGroupList.Add(new DateTimeGroup() { StartDate = StartDateTime, EndDate = EndDateTime }); DateTimeGroupList.Add(new DateTimeGroup() { StartDate = Convert.ToDateTime(Task_StartDateTime), EndDate = Convert.ToDateTime(Task_EndDateTime) }); IsValid = DateTimeServices.CheckConflict(DateTimeGroupList); } if (!IsValid) { ErrorMessage = GetErrorMessage(item.FirstOrDefault(), Language); return(IsValid); } } } } return(true); }
public BranchController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public AccountController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { hrUnitOfWork = unitOfWork; }
public BenefitController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public SecurityController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { hrUnitOfWork = unitOfWork; }
public LeavePostingController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public NotifyLettersController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public RequestsController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public PayRollGradesController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public KafeelController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public BudgetController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public UtilitiesController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { hrUnitOfWork = unitOfWork; filesHelper = new FilesHelper(DeleteURL, DeleteType, StorageRoot, UrlBase, tempPath, serverMapPath); }
public CheckListController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
/// <summary> /// Initializes a new instance of the <see cref="BaseController"/> class. /// </summary> /// <param name="unitOfWork">The unit of work.</param> protected BaseController(IHrUnitOfWork unitOfWork) { HrUnitOfWork = unitOfWork; ServerValidationEnabled = System.Configuration.ConfigurationManager.AppSettings["ServerValidationEnabled"] == "true"; }
public PersonFormController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public CandidatesController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public LoanTypeController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public PositionController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public ComplaintController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public SendFormController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public MobTerminationController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { hrUnitOfWork = unitOfWork; }
public AccountController(IHrUnitOfWork hrUnitOfWork) : base(hrUnitOfWork) { _hrUnitOfWork = hrUnitOfWork; }
public AssignOrderController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { hrUnitOfWork = unitOfWork; }
public TasksController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public TrainingController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }
public SalaryItemController(IHrUnitOfWork unitOfWork) : base(unitOfWork) { _hrUnitOfWork = unitOfWork; }