private void SendEmail(StoreRequestStatus PRS) { if (_presenter.GetSuperviser(PRS.Approver).IsAssignedJob != true) { EmailSender.Send(_presenter.GetSuperviser(PRS.Approver).Email, "Store Request", _presenter.GetUser(_presenter.CurrentStoreRequest.Requester).FullName + "' Request for Store Requisition. '" + _presenter.CurrentStoreRequest.RequestNo + "'"); } else { EmailSender.Send(_presenter.GetSuperviser(_presenter.GetAssignedJobbycurrentuser(PRS.Approver).AssignedTo).Email, "Purchase Request", _presenter.GetUser(_presenter.CurrentStoreRequest.Requester).FullName + "' Request for Store Requisition. '" + _presenter.CurrentStoreRequest.RequestNo + "'"); } }
private void SendEmail(StoreRequestStatus PRS) { if (_presenter.GetUser(PRS.Approver).IsAssignedJob != true) { EmailSender.Send(_presenter.GetUser(PRS.Approver).Email, "Store Request", _presenter.GetUser(_presenter.CurrentStoreRequest.Requester).FullName + " Requests for Store with Request No. " + (_presenter.CurrentStoreRequest.RequestNo).ToUpper()); } else { EmailSender.Send(_presenter.GetUser(_presenter.GetAssignedJobbycurrentuser(PRS.Approver).AssignedTo).Email, "Store Request", _presenter.GetUser(_presenter.CurrentStoreRequest.Requester).FullName + "Requests for Store with Request No." + (_presenter.CurrentStoreRequest.RequestNo).ToUpper()); } }
private void SendEmailRejected(StoreRequestStatus PRS) { EmailSender.Send(_presenter.GetUser(_presenter.CurrentStoreRequest.Requester).Email, "Store Request Rejection", "Your Store Request with Request No. - '" + (_presenter.CurrentStoreRequest.RequestNo.ToString()).ToUpper() + " was Rejected by " + _presenter.CurrentUser().FullName + " for this reason - '" + (PRS.RejectedReason).ToUpper() + "'"); if (PRS.WorkflowLevel > 1) { for (int i = 0; i + 1 < PRS.WorkflowLevel; i++) { EmailSender.Send(_presenter.GetUser(_presenter.CurrentStoreRequest.StoreRequestStatuses[i].Approver).Email, "Store Request Rejection", "Store Request with Request No. - '" + (_presenter.CurrentStoreRequest.RequestNo.ToString()).ToUpper() + "' made by " + (_presenter.GetUser(_presenter.CurrentStoreRequest.Requester).FullName).ToUpper() + " was Rejected by " + _presenter.CurrentUser().FullName + " for this reason - '" + (PRS.RejectedReason).ToUpper() + "'"); } } }
// PUBLIC METHODS: ------------------------------------------------------------------------ public static void LoadStoreModules() { REQUEST_STATUS = StoreRequestStatus.Requesting; UnityWebRequest request = UnityWebRequest.Get(STORE_API_URI); REQUEST_DATA = new RequestData(request, CallbackAPIStoreComplete); EditorApplication.update += StoreRequestUpdate; #if UNITY_2017_2_OR_NEWER REQUEST_DATA.request.SendWebRequest(); #else REQUEST_DATA.request.Send(); #endif }
private static void CallbackAPIStoreComplete(bool isError, string content) { if (isError) { REQUEST_STATUS = StoreRequestStatus.Error; REQUEST_DATA.error = content; } else { ReceivedData dataReceived = new ReceivedData(); EditorJsonUtility.FromJsonOverwrite(content, dataReceived); if (dataReceived != null) { List <Module> modules = new List <Module>(); for (int i = 0; i < dataReceived.catalogue.Length; ++i) { Module module = new Module(); module.moduleID = dataReceived.catalogue[i].mid; module.displayName = dataReceived.catalogue[i].name; module.description = dataReceived.catalogue[i].description; module.version = new Version(dataReceived.catalogue[i].version); module.tags = new string[dataReceived.catalogue[i].tags.Length]; for (int j = 0; j < dataReceived.catalogue[i].tags.Length; ++j) { module.tags[j] = dataReceived.catalogue[i].tags[j].name; } modules.Add(module); } ModuleManager.AddStoreModules(modules.ToArray()); REQUEST_STATUS = StoreRequestStatus.Complete; } else { REQUEST_STATUS = StoreRequestStatus.Error; REQUEST_DATA.error = "Unable to parse server response"; } } if (ModuleManagerWindow.WINDOW != null) { ModuleManagerWindow.WINDOW.Repaint(); } }
private void SaveStoreRequestStatus() { if (_presenter.CurrentStoreRequest.Id <= 0) { if (_presenter.GetApprovalSetting(RequestType.Store_Request.ToString().Replace('_', ' '), 0) != null) { int i = 1; foreach (ApprovalLevel AL in _presenter.GetApprovalSetting(RequestType.Store_Request.ToString().Replace('_', ' '), 0).ApprovalLevels) { StoreRequestStatus PRS = new StoreRequestStatus(); PRS.StoreRequest = _presenter.CurrentStoreRequest; if (AL.EmployeePosition.PositionName == "Superviser/Line Manager") { if (_presenter.CurrentUser().Superviser.Value != 0) { PRS.Approver = _presenter.CurrentUser().Superviser.Value; } else { PRS.ApprovalStatus = ApprovalStatus.Approved.ToString(); PRS.ApprovalDate = DateTime.Today.Date; } } else if (AL.EmployeePosition.PositionName == "Program Manager") { if (_presenter.CurrentStoreRequest.StoreRequestDetails[0].Project.Id != 0) { PRS.Approver = _presenter.GetProject(_presenter.CurrentStoreRequest.StoreRequestDetails[0].Project.Id).AppUser.Id; } } else { PRS.Approver = _presenter.Approver(AL.EmployeePosition.Id).Id; } PRS.WorkflowLevel = i; i++; _presenter.CurrentStoreRequest.StoreRequestStatuses.Add(PRS); } } else { pnlWarning.Visible = true; } } }