Пример #1
0
 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);
     }
 }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
            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;
 }
Пример #7
0
 public AccountController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     hrUnitOfWork = unitOfWork;
 }
 public BenefitController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _hrUnitOfWork = unitOfWork;
 }
Пример #9
0
 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;
 }
Пример #14
0
 public KafeelController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _hrUnitOfWork = unitOfWork;
 }
Пример #15
0
 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);
 }
Пример #17
0
 public CheckListController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _hrUnitOfWork = unitOfWork;
 }
Пример #18
0
 /// <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";
 }
Пример #19
0
 public PersonFormController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _hrUnitOfWork = unitOfWork;
 }
Пример #20
0
 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;
 }
Пример #24
0
 public SendFormController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _hrUnitOfWork = unitOfWork;
 }
Пример #25
0
 public MobTerminationController(IHrUnitOfWork unitOfWork) : base(unitOfWork)
 {
     hrUnitOfWork = unitOfWork;
 }
Пример #26
0
 public AccountController(IHrUnitOfWork hrUnitOfWork) : base(hrUnitOfWork)
 {
     _hrUnitOfWork = hrUnitOfWork;
 }
Пример #27
0
 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;
 }