private bool IsDelegationNotApprovedYet(Delegation delegation, int currentUserInfoId, SPWeb web) { var isDelegationNotApprovedYet = false; string listUrl = delegation.ListUrl; int itemId = delegation.ListItemID; var queryString = $"<Where><Eq><FieldRef Name='ID'></FieldRef><Value Type='Integer'>{itemId.ToString(CultureInfo.InvariantCulture)}</Value></Eq></Where>"; SPList list = web.GetList(string.Format("{0}{1}", this.SiteUrl, listUrl)); var query = new SPQuery { Query = queryString }; var results = list.GetItems(query); if (results != null && results.Count > 0) { int fromEmployeeId = 0; var delegatedEmployee = DelegationManager.GetCurrentEmployeeProcessing(listUrl, results[0], web); if (delegatedEmployee != null) { fromEmployeeId = delegatedEmployee.LookupId; } if (fromEmployeeId > 0) { var isDelegation = DelegationPermissionManager.IsDelegation(fromEmployeeId, currentUserInfoId, listUrl, itemId, this.SiteUrl); if (isDelegation != null) { isDelegationNotApprovedYet = true; } } return(isDelegationNotApprovedYet); } return(false); }
public FilterTask(Models.VehicleManagement vehicleManagement) { string vehicleType = vehicleManagement.Type; if (CultureInfo.CurrentUICulture.LCID == 1066) { if (vehicleType.ToLower().IndexOf("company") >= 0) { vehicleType = ResourceHelper.GetLocalizedString("VehicleManagement_VehicleType_Choice_Company", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } else { vehicleType = ResourceHelper.GetLocalizedString("VehicleManagement_VehicleType_Choice_Private", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } } string fromDesc = ResourceHelper.GetLocalizedString("VehicleManagement_CommonFrom", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string toDesc = ResourceHelper.GetLocalizedString("VehicleManagement_CommonTo", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string fromVal = vehicleManagement.From.ToString(StringConstant.DateFormatddMMyyyyHHmm); string toVal = vehicleManagement.ToDate.ToString(StringConstant.DateFormatddMMyyyyHHmm); this.Description = string.Format("{0} - ({1}: {2} - {3}: {4})", vehicleType, fromDesc, fromVal, toDesc, toVal); this.Requester = vehicleManagement.Requester; this.Department = vehicleManagement.CommonDepartment; this.CreatedDate = vehicleManagement.Created; this.DueDate = vehicleManagement.RequestDueDate == DateTime.MinValue ? vehicleManagement.From : vehicleManagement.RequestDueDate; // TODO this.ItemId = vehicleManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(VehicleManagementList.ListUrl, vehicleManagement.ID)}&Source=/SitePages/Overview.aspx"; this.InitModule(VehicleManagementList.ListUrl); }
public Delegation(Models.VehicleManagement vehicleManagement, SPWeb currentWeb = null) : this(currentWeb) { //ModuleName = "Vehicle Registration Management"; //VietnameseModuleName = "Quản Lý Đăng Ký Đi Xe"; ListItemID = vehicleManagement.ID; ListUrl = StringConstant.VehicleManagementList.ListUrl; ListItemCreatedDate = vehicleManagement.Created; Requester = vehicleManagement.Requester; Department = vehicleManagement.CommonDepartment; string vehicleType = vehicleManagement.Type; if (CultureInfo.CurrentUICulture.LCID == 1066) { if (vehicleType.ToLower().IndexOf("company") >= 0) { vehicleType = ResourceHelper.GetLocalizedString("VehicleManagement_VehicleType_Choice_Company", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } else { vehicleType = ResourceHelper.GetLocalizedString("VehicleManagement_VehicleType_Choice_Private", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } } string fromDesc = ResourceHelper.GetLocalizedString("VehicleManagement_CommonFrom", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string toDesc = ResourceHelper.GetLocalizedString("VehicleManagement_CommonTo", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string fromVal = vehicleManagement.From.ToString(StringConstant.DateFormatddMMyyyyHHmm); string toVal = vehicleManagement.ToDate.ToString(StringConstant.DateFormatddMMyyyyHHmm); ListItemDescription = string.Format("{0} - ({1}: {2} - {3}: {4})", vehicleType, fromDesc, fromVal, toDesc, toVal); ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, vehicleManagement.ID); this.InitModuleName(VehicleManagementList.ListUrl); }
public FilterTask(Models.FreightManagement freightManagement) { string bringerVal = string.Empty; if (freightManagement.CompanyVehicle == true) { bringerVal = ResourceHelper.GetLocalizedString("FreightManagement_CompanyVehicle", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } else { LookupItem bringerLookupItem = freightManagement.Bringer; if (bringerLookupItem != null && bringerLookupItem.LookupId > 0) { bringerVal = bringerLookupItem.LookupValue; } else { bringerVal = freightManagement.BringerName; } } this.Description = string.Format("{0} - {1}", bringerVal, freightManagement.Reason); this.Requester = freightManagement.Requester; this.Department = freightManagement.Department; this.CreatedDate = freightManagement.Created; this.DueDate = freightManagement.RequestDueDate == DateTime.MinValue ? freightManagement.TransportTime : freightManagement.RequestDueDate; // TODO this.ItemId = freightManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(FreightManagementList.ListUrl, freightManagement.ID)}&Source=/SitePages/Overview.aspx"; this.InitModule(FreightManagementList.ListUrl); }
public Delegation(Models.FreightManagement freightManagement, SPWeb currentWeb = null) : this(currentWeb) { //ModuleName = "Freight Management"; //VietnameseModuleName = "Quản Lý Vận Chuyển Hàng Hóa"; ListItemID = freightManagement.ID; ListUrl = StringConstant.FreightManagementList.ListUrl; ListItemCreatedDate = freightManagement.Created; Requester = freightManagement.Requester; Department = freightManagement.Department; string bringerVal = string.Empty; if (freightManagement.CompanyVehicle == true) { bringerVal = ResourceHelper.GetLocalizedString("FreightManagement_CompanyVehicle", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); } else { LookupItem bringerLookupItem = freightManagement.Bringer; if (bringerLookupItem != null && bringerLookupItem.LookupId > 0) { bringerVal = bringerLookupItem.LookupValue; } else { bringerVal = freightManagement.BringerName; } } ListItemDescription = string.Format("{0} - {1}", bringerVal, freightManagement.Reason); ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, freightManagement.ID); this.InitModuleName(FreightManagementList.ListUrl); }
// Start is called before the first frame update void Start() { delMngr = GameObject.FindObjectOfType <DelegationManager>(); foreach (var actor in GameObject.FindObjectsOfType <DelegationActor>()) { registerActor(actor); } }
void Start() { delMnger = GameObject.FindObjectOfType <DelegationManager>(); actorMnger = GameObject.FindObjectOfType <ActorManager>(); // use the globale game event system to do something. // globalEventSystem.Quit += resetAssignments; }
/// <summary> /// When have new task, check assignee who has delegation or no. If have, insert into delegations list. /// </summary> /// <param name="properties">The SPItemEventProperties object.</param> private void UpdateDelegationOfNewTask(SPItemEventProperties properties) { string listUrl = properties.List.RootFolder.ServerRelativeUrl; int taskFromEmployeeId = 0; LookupItem currentEmployeeProcessing = DelegationManager.GetCurrentEmployeeProcessing(listUrl, properties.ListItem, properties.Web); if (currentEmployeeProcessing != null) { taskFromEmployeeId = currentEmployeeProcessing.LookupId; } if (taskFromEmployeeId > 0) { string webUrl = properties.WebUrl; var delegationOfNewTasks = DelegationPermissionManager.HasDelegationOfNewTasks(taskFromEmployeeId, listUrl, webUrl); if (delegationOfNewTasks != null) { foreach (var delegationOfNewTask in delegationOfNewTasks) { try { var delegationListItem = DelegationManager.GetDelegationListItem(listUrl, properties.ListItem, properties.Web); if (delegationListItem != null) { List <int> toEmployeeIds = delegationOfNewTask.ToEmployee.Select(e => e.LookupId).ToList(); bool isDelegationExisted = DelegationManager.IsDelegationExisted(taskFromEmployeeId, toEmployeeIds, listUrl, properties.ListItemId, delegationOfNewTask.FromDate, delegationOfNewTask.ToDate, properties.Web.Url); if (isDelegationExisted == true) { return; } delegationListItem.FromDate = delegationOfNewTask.FromDate; delegationListItem.ToDate = delegationOfNewTask.ToDate; delegationListItem.FromEmployee = delegationOfNewTask.FromEmployee; delegationListItem.ToEmployee = delegationOfNewTask.ToEmployee; StringBuilder toEmployeesBuilder = new StringBuilder(); foreach (var toEmployee in delegationListItem.ToEmployee) { toEmployeesBuilder.AppendFormat("{0}; ", toEmployee.LookupValue); } delegationListItem.Title = string.Format("{0} - {1}", delegationListItem.FromEmployee.LookupValue, toEmployeesBuilder.ToString()); var delegationsDAL = new DelegationsDAL(webUrl); int id = delegationsDAL.SaveItem(delegationListItem); if (id <= 0) { ULSLogging.LogError(new Exception("Updating for new delegation was unsuccessfully.")); } } } catch (Exception ex) { ULSLogging.LogError(ex); } } } } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
public FilterTask(Models.Request requestManagement) { this.Description = requestManagement.Title; this.Requester = requestManagement.CommonCreator; this.Department = requestManagement.Department; this.CreatedDate = requestManagement.Created; this.DueDate = requestManagement.RequestDueDate == DateTime.MinValue ? requestManagement.FinishDate : requestManagement.RequestDueDate;// TODO this.ItemId = requestManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl(RequestsList.Url, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(RequestsList.Url); }
public FilterTask(Models.EmployeeRequirementSheet recruitmentManagement) { this.Description = recruitmentManagement.Position; this.Requester = recruitmentManagement.CommonCreator; this.Department = recruitmentManagement.CommonDepartment; this.CreatedDate = recruitmentManagement.Created; this.DueDate = recruitmentManagement.RequestDueDate == DateTime.MinValue ? recruitmentManagement.AvailableTime : recruitmentManagement.RequestDueDate;// Policy: 15 ngay // TODO this.ItemId = recruitmentManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl(EmployeeRequirementSheetsList.Url, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(EmployeeRequirementSheetsList.Url); }
public FilterTask(Models.OverTimeManagement overtimeManagement) { this.Description = string.Format("{0} - {1}", overtimeManagement.CommonDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), overtimeManagement.Requester.LookupValue); this.Requester = overtimeManagement.Requester; this.Department = overtimeManagement.CommonDepartment; this.CreatedDate = overtimeManagement.Created; this.DueDate = overtimeManagement.RequestDueDate == DateTime.MinValue ? overtimeManagement.CommonDate : overtimeManagement.RequestDueDate; // TODO this.ItemId = overtimeManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(OverTimeManagementList.ListUrl, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(OverTimeManagementList.ListUrl); }
public FilterTask(Models.RequestForDiplomaSupply requestForDiplomaSupply) { this.Description = requestForDiplomaSupply.Position; this.Requester = requestForDiplomaSupply.CommonCreator; this.Department = requestForDiplomaSupply.CommonDepartment; this.CreatedDate = requestForDiplomaSupply.Created; this.DueDate = DateTime.MinValue; // TODO this.ItemId = requestForDiplomaSupply.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl(RequestForDiplomaSuppliesList.Url, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(RequestForDiplomaSuppliesList.Url); }
public FilterTask(ShiftManagement shiftManagement) { this.Description = string.Format("{0}/{1} - {2}", shiftManagement.Month, shiftManagement.Year, shiftManagement.Requester.LookupValue); this.Requester = shiftManagement.Requester; this.Department = shiftManagement.Department; this.CreatedDate = shiftManagement.Created; this.DueDate = DateTime.Now; this.ItemId = shiftManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(ShiftManagementList.ListUrl, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(ShiftManagementList.ListUrl); }
public FilterTask(Models.GuestReceptionManagement guestReceptionManagement) { this.Description = guestReceptionManagement.Title; this.Requester = guestReceptionManagement.CommonCreator; this.Department = guestReceptionManagement.CommonDepartment; this.CreatedDate = guestReceptionManagement.Created; this.DueDate = DateTime.MinValue; // TODO this.ItemId = guestReceptionManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl(GuestReceptionManagementList.Url, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(GuestReceptionManagementList.Url); }
public FilterTask(Models.RequisitionOfMeetingRoom requisitionOfMeetingRoom) { this.Description = requisitionOfMeetingRoom.Title; this.Requester = requisitionOfMeetingRoom.CommonCreator; this.Department = requisitionOfMeetingRoom.CommonDepartment; this.CreatedDate = requisitionOfMeetingRoom.Created; this.DueDate = DateTime.MinValue; // TODO this.ItemId = requisitionOfMeetingRoom.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl(RequisitionOfMeetingRoomList.Url, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(RequisitionOfMeetingRoomList.Url); }
/// <summary> /// Initialize from RequestForDiplomaSupply object. /// </summary> /// <param name="requestForDiplomaSupply">The RequestForDiplomaSupply object.</param> public Delegation(Models.RequestForDiplomaSupply requestForDiplomaSupply, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Request For Diploma Supply Management"; //this.VietnameseModuleName = "Quản Lý Phiếu Đề Nghị Bổ Sung Bằng Cấp"; this.ListItemDescription = string.Format("{0} - {1}", requestForDiplomaSupply.EmployeeName, requestForDiplomaSupply.Position); this.Requester = requestForDiplomaSupply.CommonCreator; this.Department = requestForDiplomaSupply.CommonDepartment; this.ListItemCreatedDate = requestForDiplomaSupply.Created; this.ListUrl = RequestForDiplomaSuppliesList.Url; this.ListItemID = requestForDiplomaSupply.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl(this.CurrentWeb, this.ListUrl, this.ListItemID); this.InitModuleName(RequestForDiplomaSuppliesList.Url); }
/// <summary> /// Initialize from Request object. /// </summary> /// <param name="request">The Request object.</param> public Delegation(Models.Request request, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Requests Management"; //this.VietnameseModuleName = "Quản Lý Phiếu Đề Nghị"; this.ListItemDescription = request.Title; this.Requester = request.CommonCreator; this.Department = request.Department; this.ListItemCreatedDate = request.Created; this.ListUrl = RequestsList.Url; this.ListItemID = request.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl(this.CurrentWeb, this.ListUrl, this.ListItemID); this.InitModuleName(RequestsList.Url); }
/// <summary> /// Initialize from EmployeeRequirementSheet object. /// </summary> /// <param name="employeeRequirementSheet">The EmployeeRequirementSheet object.</param> public Delegation(Models.EmployeeRequirementSheet employeeRequirementSheet, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Recruitment Management"; //this.VietnameseModuleName = "Quản Lý Yêu Cầu Tuyển Dụng"; this.ListItemDescription = employeeRequirementSheet.Position; this.Requester = employeeRequirementSheet.CommonCreator; this.Department = employeeRequirementSheet.CommonDepartment; this.ListItemCreatedDate = employeeRequirementSheet.Created; this.ListUrl = EmployeeRequirementSheetsList.Url; this.ListItemID = employeeRequirementSheet.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl(this.CurrentWeb, this.ListUrl, this.ListItemID); this.InitModuleName(EmployeeRequirementSheetsList.Url); }
/// <summary> /// Initialize from RequisitionOfMeetingRoom object. /// </summary> /// <param name="request">The RequisitionOfMeetingRoom object.</param> public Delegation(Models.RequisitionOfMeetingRoom requisitionOfMeetingRoom, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Requisition Of Meeting Room Management"; //this.VietnameseModuleName = "Quản Lý Yêu Cầu Phòng Họp"; this.ListItemDescription = requisitionOfMeetingRoom.Title; this.Requester = requisitionOfMeetingRoom.CommonCreator; this.Department = requisitionOfMeetingRoom.CommonDepartment; this.ListItemCreatedDate = requisitionOfMeetingRoom.Created; this.ListUrl = RequisitionOfMeetingRoomList.Url; this.ListItemID = requisitionOfMeetingRoom.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl(this.CurrentWeb, this.ListUrl, this.ListItemID); this.InitModuleName(RequisitionOfMeetingRoomList.Url); }
/// <summary> /// Initialize from GuestReceptionManagement object. /// </summary> /// <param name="request">The GuestReceptionManagement object.</param> public Delegation(Models.GuestReceptionManagement guestReceptionManagement, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Requirement For Guest Reception Management"; //this.VietnameseModuleName = "Quản Lý Yêu Đón Tiếp Khách"; this.ListItemDescription = guestReceptionManagement.Title; this.Requester = guestReceptionManagement.CommonCreator; this.Department = guestReceptionManagement.CommonDepartment; this.ListItemCreatedDate = guestReceptionManagement.Created; this.ListUrl = GuestReceptionManagementList.Url; this.ListItemID = guestReceptionManagement.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl(this.CurrentWeb, this.ListUrl, this.ListItemID); this.InitModuleName(GuestReceptionManagementList.Url); }
/// <summary> /// GetSelectedDelegationTasks /// </summary> /// <returns></returns> private List <Delegation> GetSelectedDelegationTasks() { var res = new List <Delegation>(); var delegationTasks = this.Page.Session[DelegationTasksSessionKey] as List <Delegation>; if (delegationTasks != null && delegationTasks.Count > 0) { string title = string.Format("{0} - {1}", this.ddlFromEmployee.SelectedItem.Text, this.ddlToEmployee.SelectedItem.Text); DateTime fromDate = this.dtFromDate.SelectedDate.Date; DateTime toDate = this.dtToDate.SelectedDate.Date; LookupItem fromEmployee = new LookupItem { LookupId = int.Parse(this.ddlFromEmployee.SelectedItem.Value), LookupValue = this.ddlFromEmployee.SelectedItem.Text }; List <LookupItem> toEmployees = new List <LookupItem>(); JavaScriptSerializer seriallizer = new JavaScriptSerializer(); var selectedToEmployees = seriallizer.Deserialize <List <int> >(this.hdSelectedToEmployees.Value); foreach (var toEmployee in selectedToEmployees) { LookupItem lookupItem = new LookupItem(); lookupItem.LookupId = toEmployee; toEmployees.Add(lookupItem); } foreach (GridViewRow gridViewRow in this.gridTasks.Rows) { if (gridViewRow.RowType == DataControlRowType.DataRow) { var cbSelect = gridViewRow.FindControl("cbSelect") as CheckBox; if (cbSelect.Checked) { Delegation delegation = delegationTasks[gridViewRow.RowIndex]; delegation.Title = title; delegation.FromDate = fromDate; delegation.ToDate = toDate; delegation.FromEmployee = fromEmployee; delegation.ToEmployee = toEmployees; var isExisted = DelegationManager.IsDelegationExisted(delegation, this.SiteUrl); if (!isExisted) { res.Add(delegation); } } } } } return(res); }
public FilterTask(ChangeShiftManagement changeShiftManagement) { InitEmployeeDAL(SPContext.Current.Web); this.Description = string.Format("{0}/{1} - {2}/{3}", changeShiftManagement.FromDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), changeShiftManagement.FromShift.LookupValue, changeShiftManagement.ToDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), changeShiftManagement.ToShift.LookupValue); this.Requester = changeShiftManagement.Requester; var requesterInfo = _employeeInfoDAL.GetByID(changeShiftManagement.Requester.LookupId); this.Department = requesterInfo.Department; this.CreatedDate = changeShiftManagement.Created; this.DueDate = changeShiftManagement.RequestDueDate == DateTime.MinValue ? changeShiftManagement.FromDate : changeShiftManagement.RequestDueDate; // TODO this.ItemId = changeShiftManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(ChangeShiftList.ListUrl, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(ChangeShiftList.ListUrl); }
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); }
/// <summary> /// Initialize from Overtime Management object. /// </summary> /// <param name="shiftManagement">The Overtime Management object.</param> public Delegation(Models.OverTimeManagement overtimeManagement, SPWeb currentWeb = null) : this(currentWeb) { if (currentWeb == null) { currentWeb = SPContext.Current.Web; } this.ListItemDescription = string.Format("{0} - {1}", overtimeManagement.CommonDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), overtimeManagement.Requester.LookupValue); this.Requester = overtimeManagement.Requester; this.Department = overtimeManagement.CommonDepartment; this.ListItemCreatedDate = overtimeManagement.Created; this.ListUrl = OverTimeManagementList.ListUrl; this.ListItemID = overtimeManagement.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, this.ListItemID); this.InitModuleName(OverTimeManagementList.ListUrl); }
public FilterTask(Models.LeaveManagement leaveManagement) { string requestFor = leaveManagement.RequestFor.LookupValue; string fromDesc = ResourceHelper.GetLocalizedString("LeaveList_From", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string toDesc = ResourceHelper.GetLocalizedString("LeaveList_To", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string fromVal = leaveManagement.From.ToString(StringConstant.DateFormatddMMyyyyHHmm); string toVal = leaveManagement.To.ToString(StringConstant.DateFormatddMMyyyyHHmm); this.Description = string.Format("{0} - ({1}: {2} - {3}: {4})", requestFor, fromDesc, fromVal, toDesc, toVal); this.Requester = leaveManagement.Requester; this.Department = leaveManagement.Department; this.CreatedDate = leaveManagement.Created; this.DueDate = leaveManagement.RequestDueDate == DateTime.MinValue ? leaveManagement.From : leaveManagement.RequestDueDate;// TODO this.ItemId = leaveManagement.ID; this.ItemApprovalUrl = $"{DelegationManager.BuildListItemApprovalUrl2(LeaveManagementList.ListUrl, this.ItemId)}&Source=/SitePages/Overview.aspx"; this.InitModule(LeaveManagementList.ListUrl); }
/// <summary> /// Initialize from Shift Management object. /// </summary> /// <param name="shiftManagement">The Shift Management object.</param> public Delegation(Models.ShiftManagement shiftManagement, SPWeb currentWeb = null) : this(currentWeb) { //this.ModuleName = "Shift Management"; //this.VietnameseModuleName = "Quản Lý Đi Ca"; if (currentWeb == null) { currentWeb = SPContext.Current.Web; } this.ListItemDescription = string.Format("{0}/{1} - {2}", shiftManagement.Month, shiftManagement.Year, shiftManagement.Requester.LookupValue); this.Requester = shiftManagement.Requester; this.Department = shiftManagement.Department; this.ListItemCreatedDate = shiftManagement.Created; this.ListUrl = ShiftManagementList.ListUrl; this.ListItemID = shiftManagement.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, this.ListItemID); this.InitModuleName(ShiftManagementList.ListUrl); }
/// <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); }
/// <summary> /// Initialize from Change Shift Management object. /// </summary> /// <param name="shiftManagement">The Change Shift Management object.</param> public Delegation(Models.ChangeShiftManagement changeShiftManagement, EmployeeInfo fromEmployee, SPWeb currentWeb = null) : this(currentWeb) { if (currentWeb == null) { currentWeb = SPContext.Current.Web; } InitEmployeeDAL(currentWeb); this.ListItemDescription = string.Format("{0}/{1} - {2}/{3}", changeShiftManagement.FromDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), changeShiftManagement.FromShift.LookupValue, changeShiftManagement.ToDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture), changeShiftManagement.ToShift.LookupValue); this.Requester = changeShiftManagement.Requester; var requesterInfo = _employeeInfoDAL.GetByID(changeShiftManagement.Requester.LookupId); this.Department = requesterInfo.Department; this.ListItemCreatedDate = changeShiftManagement.Created; this.ListUrl = ChangeShiftList.ListUrl; this.ListItemID = changeShiftManagement.ID; this.ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, this.ListItemID); this.InitModuleName(ChangeShiftList.ListUrl); }
public Delegation(Models.LeaveManagement leaveManagement, SPWeb currentWeb = null) : this(currentWeb) { //ModuleName = "Leave Management"; //VietnameseModuleName = "Quản Lý Nghỉ Phép"; ListItemID = leaveManagement.ID; ListUrl = StringConstant.LeaveManagementList.ListUrl; ListItemCreatedDate = leaveManagement.Created; Requester = leaveManagement.Requester; Department = leaveManagement.Department; string requestFor = leaveManagement.RequestFor.LookupValue; string fromDesc = ResourceHelper.GetLocalizedString("LeaveList_From", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string toDesc = ResourceHelper.GetLocalizedString("LeaveList_To", StringConstant.ResourcesFileLists, CultureInfo.CurrentUICulture.LCID); string fromVal = leaveManagement.From.ToString(StringConstant.DateFormatddMMyyyyHHmm); string toVal = leaveManagement.To.ToString(StringConstant.DateFormatddMMyyyyHHmm); ListItemDescription = string.Format("{0} - ({1}: {2} - {3}: {4})", requestFor, fromDesc, fromVal, toDesc, toVal); ListItemApprovalUrl = DelegationManager.BuildListItemApprovalUrl2(this.ListUrl, leaveManagement.ID); this.InitModuleName(LeaveManagementList.ListUrl); }