Beispiel #1
0
        public FilterTask(Models.NotOvertimeManagement notOvertimeManagement)
        {
            InitEmployeeDAL(SPContext.Current.Web);

            this.Description = string.Format("{0} - {1}", notOvertimeManagement.Date.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), notOvertimeManagement.Requester.LookupValue);
            this.Requester   = notOvertimeManagement.Requester;
            var requesterInfo = _employeeInfoDAL.GetByID(notOvertimeManagement.Requester.LookupId);

            this.Department      = requesterInfo.Department;
            this.CreatedDate     = notOvertimeManagement.Created;
            this.DueDate         = notOvertimeManagement.RequestDueDate == DateTime.MinValue ? notOvertimeManagement.FromDate : notOvertimeManagement.RequestDueDate;// TODO
            this.ItemId          = notOvertimeManagement.ID;
            this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(NotOvertimeList.ListUrl, this.ItemId)}&Source=/SitePages/Overview.aspx";
            this.InitModule(NotOvertimeList.ListUrl);
        }
Beispiel #2
0
        /// <summary>
        /// Initialize from Not Overtime Management object.
        /// </summary>
        /// <param name="shiftManagement">The Not Overtime Management object.</param>
        public Delegation(Models.NotOvertimeManagement notOvertimeManagement, EmployeeInfo fromEmployee, SPWeb currentWeb = null) : this(currentWeb)
        {
            if (currentWeb == null)
            {
                currentWeb = SPContext.Current.Web;
            }
            InitEmployeeDAL(currentWeb);

            this.ListItemDescription = string.Format("{0} - {1}", notOvertimeManagement.Date.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), notOvertimeManagement.Requester.LookupValue);
            this.Requester           = notOvertimeManagement.Requester;
            var requesterInfo = _employeeInfoDAL.GetByID(notOvertimeManagement.Requester.LookupId);
            this.Department          = requesterInfo.Department;
            this.ListItemCreatedDate = notOvertimeManagement.Created;
            this.ListUrl             = NotOvertimeList.ListUrl;
            this.ListItemID          = notOvertimeManagement.ID;
            this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, this.ListItemID);
            this.InitModuleName(NotOvertimeList.ListUrl);
        }