Ejemplo n.º 1
0
 public NewSaveJointCommand(IConstructionRepository repo, JointNewEditViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
     this.ctx       = ctx;
 }
Ejemplo n.º 2
0
        public JointNewEditXtraForm(Guid id)
        {
            this.id = id;

            InitializeComponent();

            SetControlsTextLength();
            viewModel = (JointNewEditViewModel)Program
                        .Kernel
                        .Get <JointNewEditViewModel>(
                new ConstructorArgument("id", id));
            viewModel.ModifiableView         = this;
            viewModel.ValidatableView        = this;
            loweringDate.Properties.NullText = String.Empty;
            loweringDate.Properties.NullDate = DateTime.MinValue;
            CannotOpenForViewing             = id == Guid.Empty;

            #region --- Colouring of required controls, IsEditMode, uppercasing ---
            jointNumber.SetRequiredText();
            SetAlwaysReadOnly(jointStatus);
            firstJointElement.SetRequiredText();
            secondJointElement.SetRequiredText();
            IsEditMode = ctx.HasAccess(global::Domain.Entity.Security.Privileges.EditJoint);
            jointNumber.SetAsIdentifier();
            firstJointElement.SetAsIdentifier();
            secondJointElement.SetAsIdentifier();
            attachmentsButton.Enabled = true;
            #endregion
        }
Ejemplo n.º 3
0
        public void SetupForm(IList <construction.Joint> joints, JointNewEditViewModel viewModel)
        {
            BindingList <construction.Joint> bindingList = new BindingList <construction.Joint>(joints);

            this.joints    = bindingList;
            this.viewModel = viewModel;
        }
Ejemplo n.º 4
0
 public JointCutCommand(
     IConstructionRepository repo,
     JointNewEditViewModel viewModel,
     IUserNotify notify)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
 }
Ejemplo n.º 5
0
 private void JointNewEditXtraForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     commandManager.Dispose();
     viewModel.Dispose();
     viewModel = null;
 }
Ejemplo n.º 6
0
 public QuickSearchCommand(JointNewEditViewModel vm, IJointRepository repo, IUserNotify notify)
 {
     viewModel   = vm;
     this.repo   = repo;
     this.notify = notify;
 }
Ejemplo n.º 7
0
        public JointNewEditXtraForm(Guid id)
        {
            this.Id = id;

            InitializeComponent();

            SetControlsTextLength();
            viewModel = (JointNewEditViewModel)Program
                        .Kernel
                        .Get <JointNewEditViewModel>(
                new ConstructorArgument("id", id));
            viewModel.ModifiableView         = this;
            viewModel.ValidatableView        = this;
            loweringDate.Properties.NullText = String.Empty;
            loweringDate.Properties.NullDate = DateTime.MinValue;
            CannotOpenForViewing             = id == Guid.Empty;

            #region --- Colouring of required controls, IsEditMode, uppercasing, digits befor decimal point ---
            jointNumber.SetRequiredText();
            SetAlwaysReadOnly(jointStatus);
            firstJointElement.SetRequiredText();
            secondJointElement.SetRequiredText();
            jointNumber.SetAsIdentifier();
            searchNumber.SetAsIdentifier();
            firstJointElement.SetAsLookUpIdentifier();
            secondJointElement.SetAsLookUpIdentifier();
            distanceFromPK.SetFloatMask(Constants.DigitsBeforeDecimalPoint);
            GPSLat.SetGPSMaskLatitude(Constants.DigitsAfterDecimalPointForGPS, Constants.MaxLatitude);
            GPSLong.SetGPSMaskLongitude(Constants.DigitsAfterDecimalPointForGPS, Constants.MaxLongitude);

            seaLevel.SetFloatMask(Constants.DigitsBeforeDecimalPoint, canBeNegative: true);
            attachmentsButton.Enabled = true;

            SetConditional(jointNumber, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(firstJointElement, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(secondJointElement, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(secondJointElement, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(controlOperations, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(loweringDate, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            SetConditional(PKNumber, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });
            SetConditional(distanceFromPK, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });
            SetConditional(GPSLat, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });
            SetConditional(GPSLong, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });
            SetConditional(seaLevel, delegate(bool editMode)
            {
                return(viewModel.JointIsActive);
            });

            #endregion
        }
Ejemplo n.º 8
0
 public JointSelectDialog(IList <construction.Joint> joints, JointNewEditViewModel viewModel)
 {
     InitializeComponent();
     SetupForm(joints, viewModel);
 }
Ejemplo n.º 9
0
 public ExtractOperationsCommand(IConstructionRepository repo, JointNewEditViewModel viewModel)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
 }