public virtual void ProjectsAccountingChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (e.NewValue == false) { _obj.GrantRightsToProject = false; } }
public virtual void IsManyAddresseesChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (_obj.IsManyAddressees == true) { Functions.OutgoingDocumentBase.ClearAndFillFirstAddressee(_obj); _obj.Correspondent = Parties.PublicFunctions.Counterparty.Remote.GetDistributionListCounterparty(); _obj.DistributionCorrespondent = _obj.Correspondent.Name; _obj.DeliveryMethod = null; _obj.Addressee = null; } else if (_obj.IsManyAddressees == false) { var addressee = _obj.Addressees.OrderBy(a => a.Number).FirstOrDefault(a => a.Correspondent != null); if (addressee != null) { _obj.Correspondent = addressee.Correspondent; _obj.DeliveryMethod = addressee.DeliveryMethod; _obj.Addressee = addressee.Addressee; } else { _obj.Correspondent = null; _obj.DeliveryMethod = null; _obj.Addressee = null; } Functions.OutgoingDocumentBase.ClearAndFillFirstAddressee(_obj); } }
public virtual void AllowSendToReworkChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (e.NewValue.Value == e.OldValue) { return; } Functions.ApprovalStage.SetRequiredProperties(_obj); Functions.ApprovalStage.SetPropertiesVisibility(_obj); Functions.ApprovalStage.SetPropertiesAvailability(_obj); if (e.NewValue == true) { _obj.ReworkType = _obj.StageType == StageType.SimpleAgr ? _obj.ReworkType = ApprovalStage.ReworkType.AfterAll : _obj.ReworkType = ApprovalStage.ReworkType.AfterComplete; _obj.ReworkPerformerType = Docflow.ApprovalStage.ReworkPerformerType.FromRule; } else { _obj.ReworkType = null; _obj.ReworkPerformerType = null; _obj.ReworkPerformer = null; _obj.ReworkApprovalRole = null; _obj.AllowChangeReworkPerformer = false; } }
public virtual void IsAdjustmentChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { FillName(); if (e.NewValue == false) { _obj.Corrected = null; } }
public virtual void IsUnderControlChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { _obj.State.Properties.Supervisor.IsEnabled = e.NewValue ?? false; _obj.Supervisor = e.NewValue.Value ? Docflow.PublicFunctions.PersonalSetting.GetSupervisor(Docflow.PublicFunctions.PersonalSetting.GetPersonalSettings(Employees.Current)) : null; Functions.ActionItemExecutionTask.SetRequiredProperties(_obj); }
public virtual void IsAutoCalcSupervisorChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { _obj.State.Properties.Supervisor.IsEnabled = !(e.NewValue ?? false); if (!_obj.State.Properties.Supervisor.IsEnabled) { _obj.Supervisor = null; } }
public virtual void ExchangeBoxesIsDefaultChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (e.NewValue == true) { foreach (var boxLine in _obj.Counterparty.ExchangeBoxes.Where(x => Equals(_obj.Box, x.Box) && !Equals(x, _obj))) { boxLine.IsDefault = false; } } }
public virtual void IsConfirmSigningChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (e.NewValue.Value == e.OldValue) { return; } Functions.ApprovalStage.SetPropertiesVisibility(_obj); Functions.ApprovalStage.SetPropertiesAvailability(_obj); Functions.ApprovalStage.SetRequiredProperties(_obj); _obj.AssigneeType = AssigneeType.Role; if (e.NewValue == true) { _obj.ApprovalRole = Functions.ApprovalRoleBase.GetRole(Docflow.ApprovalRoleBase.Type.SignAssistant); } else { _obj.ApprovalRole = Functions.ApprovalRoleBase.GetRole(Docflow.ApprovalRoleBase.Type.Signatory); } }
public virtual void IsAutomaticRenewalChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { Functions.ContractBase.SetRequiredProperties(_obj); }
public virtual void NeedRestrictVisibilityChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { Functions.VisibilitySetting.SetRequiredProperties(_obj); }
public virtual void IsCompoundActionItemChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { if (e.OldValue != e.NewValue) { // Заполнить данные из составного поручения в обычное и наоборот. if (e.NewValue.Value) { // Составное поручение. _obj.ActionItemParts.Clear(); _obj.FinalDeadline = _obj.Deadline; if (_obj.Assignee != null) { var newJob = _obj.ActionItemParts.AddNew(); newJob.Assignee = _obj.Assignee; } foreach (var job in _obj.CoAssignees) { var newJob = _obj.ActionItemParts.AddNew(); newJob.Assignee = job.Assignee; } } else { // Не составное поручение. var actionItemPart = _obj.ActionItemParts.OrderBy(x => x.Number).FirstOrDefault(); if (_obj.FinalDeadline != null) { _obj.Deadline = _obj.FinalDeadline; } else if (actionItemPart != null) { _obj.Deadline = actionItemPart.Deadline; } else { _obj.Deadline = null; } if (actionItemPart != null) { _obj.Assignee = actionItemPart.Assignee; } else { _obj.Assignee = null; } _obj.CoAssignees.Clear(); foreach (var job in _obj.ActionItemParts.OrderBy(x => x.Number).Skip(1)) { if (job.Assignee != null && !_obj.CoAssignees.Select(z => z.Assignee).Contains(job.Assignee)) { _obj.CoAssignees.AddNew().Assignee = job.Assignee; } } if (string.IsNullOrEmpty(_obj.ActionItem) && actionItemPart != null) { _obj.ActionItem = actionItemPart.ActionItemPart; } // Чистим грид в составном, чтобы не мешать валидации. _obj.ActionItemParts.Clear(); } // Установить тему. var subjectTemplate = _obj.IsCompoundActionItem == true ? ActionItemExecutionTasks.Resources.ComponentActionItemExecutionSubject : ActionItemExecutionTasks.Resources.TaskSubject; _obj.Subject = Functions.ActionItemExecutionTask.GetActionItemExecutionSubject(_obj, subjectTemplate); } Functions.ActionItemExecutionTask.SetRequiredProperties(_obj); _obj.State.Controls.Control.Refresh(); }
public virtual void NeedNotifyExpiredAssignmentsChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e) { Sungero.Company.PublicFunctions.Employee.SetRequiredProperties(_obj); }