| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772 |
- using MaterialDesignThemes.Wpf;
- using Prism.Commands;
- using Prism.Events;
- using Prism.Ioc;
- using Prism.Mvvm;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Web.Hosting;
- using TeamAAS_VP.Controls;
- using TeamAAS_VP.Enums;
- using TeamAAS_VP.Events;
- using TeamAAS_VP.Core;
- using TeamAAS_VP.Interfaces;
- using TeamAAS_VP.Models;
- using TeamAAS_VP.Views.Product;
- using TeamAAS_VP;
- using Microsoft.Win32;
- using System.Windows;
- using TeamAAS_VP.Resources.Languages;
- using TeamAAS_VP.Models.Robot;
- using TeamAAS_VP.Services;
- using TeamAAS_VP.Core.Robots;
- namespace TeamAAS_VP.ViewModels.Product
- {
- public class PalletManageViewModel : BindableBase, IDialogAware
- {
- IRegionManager _regionManager;
- IEventAggregator _eventAggregator;
- IContainerProvider _container;
- IDialogService _dialogService;
- IRobotService _robotService;
- IConfigService _configService;
-
- #region 属性
- public string Title => "Pallet";
- private ProductModel _SelectProduct;
- /// <summary>
- /// 选中的产品
- /// </summary>
- public ProductModel SelectProduct
- {
- get { return _SelectProduct; }
- set { SetProperty(ref _SelectProduct, value); }
- }
- private RobotPointStore _SelectedRobot;
- public RobotPointStore SelectedRobot
- {
- get { return _SelectedRobot; }
- set { SetProperty(ref _SelectedRobot, value); }
- }
- private ObservableCollection<Pallet> _Pallets;
- /// <summary>
- /// 托盘集合
- /// </summary>
- public ObservableCollection<Pallet> Pallets
- {
- get { return _Pallets; }
- set { SetProperty(ref _Pallets, value); }
- }
- private Pallet _SelectPallet;
- /// <summary>
- /// 选中的托盘
- /// </summary>
- public Pallet SelectPallet
- {
- get { return _SelectPallet; }
- set
- {
- SetProperty(ref _SelectPallet, value);
- if (value == null)
- return;
- Points = new ObservableCollection<RPoint>();
- Points.Add(value.P0);
- Points.Add(value.P1);
- Points.Add(value.P2);
- Row = value.Row;
- Column = value.Column;
- Arrangement = value.Arrangement;
- }
- }
- private RPoint _SelectPoint;
- public RPoint SelectPoint
- {
- get { return _SelectPoint; }
- set { SetProperty(ref _SelectPoint, value); }
- }
- private MotionCommand _SelectMotionCommand;
- /// <summary>
- /// 选中的运动指令
- /// </summary>
- public MotionCommand SelectMotionCommand
- {
- get { return _SelectMotionCommand; }
- set { SetProperty(ref _SelectMotionCommand, value); }
- }
- private int _Row;
- public int Row
- {
- get { return _Row; }
- set
- {
- SetProperty(ref _Row, value);
- if (SelectPallet != null)
- {
- SelectPallet.Row = value;
- _eventAggregator.GetEvent<PalletLayoutNotification>().Publish(SelectPallet);
- }
- }
- }
- private int _Column;
- public int Column
- {
- get { return _Column; }
- set
- {
- SetProperty(ref _Column, value);
- if (SelectPallet != null)
- {
- SelectPallet.Column = value;
- _eventAggregator.GetEvent<PalletLayoutNotification>().Publish(SelectPallet);
- }
- }
- }
- private PalletArrangement _Arrangement;
- public PalletArrangement Arrangement
- {
- get
- {
- return _Arrangement;
- }
- set
- {
- SetProperty(ref _Arrangement, value);
- if (SelectPallet != null)
- {
- SelectPallet.Arrangement = value;
- _eventAggregator.GetEvent<PalletLayoutNotification>().Publish(SelectPallet);
- }
- }
- }
- private ObservableCollection<RPoint> _Points;
- public ObservableCollection<RPoint> Points
- {
- get { return _Points; }
- set { SetProperty(ref _Points, value); }
- }
- public Management management { get; set; }
- private IRobot _Robot;
- public IRobot Robot
- {
- get { return _Robot; }
- set
- {
- SetProperty(ref _Robot, value);
- }
- }
- private double _Distance = 1;
- public double Distance
- {
- get { return _Distance; }
- set
- {
- SetProperty(ref _Distance, value);
- try
- {
- if (Robot == null)
- {
- return;
- }
- _configService.UpdateRobotStepDistance(Robot.Id, value);
- }
- catch (Exception)
- {
- }
- }
- }
- private bool CanRemove
- {
- get
- {
- if (SelectPallet != null)
- return true;
- else return false;
- }
- }
- private ObservableCollection<int> _Tools = new ObservableCollection<int>();
- /// <summary>
- /// 机器人Tool集合
- /// </summary>
- public ObservableCollection<int> Tools
- {
- get { return _Tools; }
- set { SetProperty(ref _Tools, value); }
- }
- private int _SelectTool;
- /// <summary>
- /// 选中的Tool
- /// </summary>
- public int SelectTool
- {
- get { return _SelectTool; }
- set
- {
- SetProperty(ref _SelectTool, value);
- if (value >= 0)
- {
- if (Robot != null && Robot.IsConnected)
- {
- try
- {
- Robot.SelectToolAsync(value);
- }
- catch (Exception)
- {
- }
- }
- }
- }
- }
- #endregion
- #region 命令
- private DelegateCommand _CreateCommand;
- public DelegateCommand CreateCommand =>
- _CreateCommand ?? (_CreateCommand = new DelegateCommand(ExecuteCreateCommand));
- private DelegateCommand _RemoveCommand;
- public DelegateCommand RemoveCommand =>
- _RemoveCommand ?? (_RemoveCommand = new DelegateCommand(ExecuteRemoveCommand).ObservesCanExecute(() => CanRemove).ObservesProperty(() => SelectPallet));
- private DelegateCommand _ProductSelectionChangedCommand;
- public DelegateCommand ProductSelectionChangedCommand =>
- _ProductSelectionChangedCommand ?? (_ProductSelectionChangedCommand = new DelegateCommand(ExecuteProductSelectionChangedCommand));
- private DelegateCommand _ConfirmCommand;
- public DelegateCommand ConfirmCommand =>
- _ConfirmCommand ?? (_ConfirmCommand = new DelegateCommand(ExecuteConfirmCommand));
- private DelegateCommand _CancelCommand;
- public DelegateCommand CancelCommand =>
- _CancelCommand ?? (_CancelCommand = new DelegateCommand(ExecuteCancelCommand));
- private DelegateCommand _CopyCommand;
- public DelegateCommand CopyCommand =>
- _CopyCommand ?? (_CopyCommand = new DelegateCommand(ExecuteCopyCommand));
- private DelegateCommand _EditNameCommand;
- public DelegateCommand EditNameCommand =>
- _EditNameCommand ?? (_EditNameCommand = new DelegateCommand(ExecuteEditNameCommand));
- private DelegateCommand<object> _JogCommand;
- public DelegateCommand<object> JogCommand =>
- _JogCommand ?? (_JogCommand = new DelegateCommand<object>(ExecuteJogCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand<object> _ExecuteMotion;
- public DelegateCommand<object> ExecuteMotion =>
- _ExecuteMotion ?? (_ExecuteMotion = new DelegateCommand<object>(ExecuteExecuteMotion).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand<RPoint> _TechPointCommand;
- public DelegateCommand<RPoint> TechPointCommand =>
- _TechPointCommand ?? (_TechPointCommand = new DelegateCommand<RPoint>(ExecuteTechPointCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand _CalculatePalletCommand;
- public DelegateCommand CalculatePalletCommand =>
- _CalculatePalletCommand ?? (_CalculatePalletCommand = new DelegateCommand(ExecuteCalculatePalletCommand));
- private DelegateCommand<string> _MotorCommand;
- public DelegateCommand<string> MotorCommand =>
- _MotorCommand ?? (_MotorCommand = new DelegateCommand<string>(ExecuteMotorCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand _ResetCommand;
- public DelegateCommand ResetCommand =>
- _ResetCommand ?? (_ResetCommand = new DelegateCommand(ExecuteResetCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand _sFreeCommand;
- public DelegateCommand sFreeCommand =>
- _sFreeCommand ?? (_sFreeCommand = new DelegateCommand(ExecutesFreeCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand _SLockCommand;
- public DelegateCommand SLockCommand =>
- _SLockCommand ?? (_SLockCommand = new DelegateCommand(ExecuteSLockCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
- private DelegateCommand _SavePalletImage;
- public DelegateCommand SavePalletImage =>
- _SavePalletImage ?? (_SavePalletImage = new DelegateCommand(ExecuteSavePalletImage));
- #endregion
- #region 事件
- public event Action<IDialogResult> RequestClose;
- #endregion
- public PalletManageViewModel(IRegionManager regionManager, IEventAggregator ea, IContainerProvider container, IDialogService dialogService,
- IRobotService robotService, IConfigService configService)
- {
- _regionManager = regionManager;
- _eventAggregator = ea;
- _container = container;
- _dialogService = dialogService;
- //订阅权限登录事件
- _eventAggregator.GetEvent<UserLoginNotification>().Subscribe(LoginChange);
- _robotService = robotService;
- _configService = configService;
- }
- #region 方法
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
- SelectProduct=parameters.GetValue<ProductModel>("SelectProduct");
- SelectedRobot= parameters.GetValue<RobotPointStore>("SelectedRobot");
- Robot = _robotService.GetRobot(SelectedRobot.Id);
- if (Robot is FanucRobot)
- {
- Tools = new ObservableCollection<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
- SelectTool = Robot.SelectedTool;
- }
- else
- {
- Tools = new ObservableCollection<int> { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
- SelectTool = Robot.SelectedTool;
- }
- Pallets = SelectedRobot.Pallets;
- management = _container.Resolve<Management>();
- this.Distance = _configService.GetRobotStepDistance(Robot.Id);
- }
- /// <summary>
- /// 创建托盘
- /// </summary>
- async void ExecuteCreateCommand()
- {
- //var view = new AddProduct() { Title = "创建托盘:", Item = "Name" };
- var view = new AddPalletView();
- //show the dialog
- var result = await DialogHost.Show(view, "RootDialog", null, null, null);
- if (result != null && result is AddPalletView vm && !string.IsNullOrEmpty(vm.PalletName))
- {
- Pallet pallet = new Pallet()
- {
- Id = Guid.NewGuid(),
- Name = vm.PalletName,
- Row = 2,
- Column = 2,
- P0 = new RPoint() { Number = 0 },
- P1 = new RPoint() { Number = 1 },
- P2 = new RPoint() { Number = 2 },
- Arrangement = PalletArrangement.Z,
- };
- if (!vm.IsCheckModel1)
- {
- pallet.Extend = new PalletExtend()
- {
- Pallet_Row = 2,
- Pallet_Column = 2,
- Pallet_X_Interval = 0,
- Pallet_Y_Interval = 0,
- CoordinateModel = vm.CoordinateModel
- };
- }
- Pallets.Add(pallet);
- SelectPallet = Pallets[Pallets.Count - 1];
- }
- //if (result != null && !string.IsNullOrEmpty(result.ToString()))
- //{
- // Pallets.Add(new Pallet()
- // {
- // Id = Guid.NewGuid(),
- // Name = result.ToString(),
- // Row=2,
- // Column=2,
- // P0 = new RPoint() { Number = 0 },
- // P1 = new RPoint() { Number = 1 },
- // P2 = new RPoint() { Number = 2 },
- // Arrangement=PalletArrangement.Z,
- // });
- // SelectPallet = Pallets[Pallets.Count - 1];
- //}
- }
- /// <summary>
- /// 移除托盘
- /// </summary>
- void ExecuteRemoveCommand()
- {
- if (SelectPallet != null)
- {
- Pallets.Remove(SelectPallet);
- }
- }
- /// <summary>
- /// 点击选择托盘时触发方法
- /// </summary>
- void ExecuteProductSelectionChangedCommand()
- {
- }
- /// <summary>
- /// 确定
- /// </summary>
- void ExecuteConfirmCommand()
- {
- IDialogParameters parameters = new DialogParameters();
- parameters.Add("Pallets", Pallets);
- RequestClose?.Invoke(new DialogResult(ButtonResult.OK, parameters));
- }
- /// <summary>
- /// 取消
- /// </summary>
- void ExecuteCancelCommand()
- {
- IDialogParameters parameters = new DialogParameters();
- parameters.Add("Pallets", Pallets);
- RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel, parameters));
- }
- /// <summary>
- /// 保存托盘图片
- /// </summary>
- void ExecuteSavePalletImage()
- {
- try
- {
- if (SelectPallet == null)
- {
- return;
- }
- SaveFileDialog dlg = new SaveFileDialog();
- dlg.Title = "Save Pallet Layout Image";
- dlg.DefaultExt = ".png";
- dlg.Filter = "Image (*.png)|*.png";
- if (dlg.ShowDialog() ?? false)
- {
- PalletTool palletTool = new PalletTool(SelectPallet);
- palletTool.DrawCoordinatesAndSaveImage(dlg.FileName);
- MessageBox.Show("OK");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- /// <summary>
- /// 复制
- /// </summary>
- void ExecuteCopyCommand()
- {
- }
- /// <summary>
- /// 修改托盘名称
- /// </summary>
- void ExecuteEditNameCommand()
- {
- }
- /// <summary>
- /// 点动
- /// </summary>
- /// <param name="obj"></param>
- private async void ExecuteJogCommand(object obj)
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- Robot.Timeout = 6000000;
- var items = ((string)obj).Split(':');
- switch (items[0])
- {
- case "X+":
- await Robot.JogAsync("X", double.Parse(items[1]));
- break;
- case "X-":
- await Robot.JogAsync("X", -double.Parse(items[1]));
- break;
- case "Y+":
- await Robot.JogAsync("Y", double.Parse(items[1]));
- break;
- case "Y-":
- await Robot.JogAsync("Y", -double.Parse(items[1]));
- break;
- case "Z+":
- await Robot.JogAsync("Z", double.Parse(items[1]));
- break;
- case "Z-":
- await Robot.JogAsync("Z", -double.Parse(items[1]));
- break;
- case "U+":
- await Robot.JogAsync("U", double.Parse(items[1]));
- break;
- case "U-":
- await Robot.JogAsync("U", -double.Parse(items[1]));
- break;
- case "V+":
- await Robot.JogAsync("V", double.Parse(items[1]));
- break;
- case "V-":
- await Robot.JogAsync("V", -double.Parse(items[1]));
- break;
- case "W+":
- await Robot.JogAsync("W", double.Parse(items[1]));
- break;
- case "W-":
- await Robot.JogAsync("W", -double.Parse(items[1]));
- break;
- default:
- break;
- }
- Robot.Timeout = 5000;
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 0.4 });
- }
- catch (Exception ex)
- {
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- LogHelper.WriteLogError("机器人点动时出错", ex);
- }
- }
- /// <summary>
- /// 执行运动
- /// </summary>
- /// <param name="obj"></param>
- async void ExecuteExecuteMotion(object parameter)
- {
- var values = (object[])parameter;
- var point = values[0] as RPoint;
- MotionCommand motionCmd = (MotionCommand)values[1];
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- Robot.Timeout = 6000000;
- switch (motionCmd)
- {
- case MotionCommand.Go:
- await Robot.GoAsync(point);
- break;
- case MotionCommand.Jump:
- await Robot.JumpAsync(point, 0);
- break;
- case MotionCommand.Move:
- await Robot.MoveAsync(point);
- break;
- }
- Robot.Timeout = 5000;
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- LogHelper.WriteLogError("机器人运动至目标点时出错", ex);
- }
- }
- /// <summary>
- /// 示教点位
- /// </summary>
- /// <param name="point"></param>
- async void ExecuteTechPointCommand(RPoint point)
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- var curpos = await Robot.GetRobotPosAsync();
- RPoint p0 = Points.FirstOrDefault(x => x.Number == point.Number);
- p0.X = curpos.X;
- p0.Y = curpos.Y;
- p0.Z = curpos.Z;
- p0.U = curpos.U;
- p0.V = curpos.V;
- p0.W = curpos.W;
- p0.Hand = curpos.Hand;
- p0.Local = curpos.Local;
- p0.Tool = curpos.Tool;
- p0 = curpos;
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- LogHelper.WriteLogError("示教机器人点时出错", ex);
- }
- }
- /// <summary>
- /// 计算托盘
- /// </summary>
- async void ExecuteCalculatePalletCommand()
- {
- try
- {
- var view = new CalculatePalletPos();
- ((CalculatePalletPosViewModel)view.DataContext).CurrentPallet = ((Pallet)SelectPallet).Clone();
- //show the dialog
- var result = await DialogHost.Show(view, "PalletCalculateDialog", null, null, null);
- if (result != null && result is bool)
- {
- if (((bool)result))
- {
- SelectPallet = ((CalculatePalletPosViewModel)view.DataContext).CurrentPallet.Clone();
- }
- }
- }
- catch (Exception ex)
- {
- LogHelper.WriteLogError("计算托盘时出错", ex);
- }
- }
- /// <summary>
- /// 电机
- /// </summary>
- /// <param name="obj"></param>
- private async void ExecuteMotorCommand(string obj)
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- await Robot.MotorAsync(Convert.ToBoolean(obj));
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- LogHelper.WriteLogError("机器人点击操作时出错!", ex);
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- }
- }
- /// <summary>
- /// 重置
- /// </summary>
- private async void ExecuteResetCommand()
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- await Robot.ResetAsync();
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- LogHelper.WriteLogError("重置机器人时出错!", ex);
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- }
- }
- /// <summary>
- /// 锁定刹车
- /// </summary>
- private async void ExecuteSLockCommand()
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- await Robot.SLockAsync();
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- LogHelper.WriteLogError("机器人锁定刹车时出错!", ex);
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- }
- }
- /// <summary>
- /// 释放刹车
- /// </summary>
- private async void ExecutesFreeCommand()
- {
- if (Robot == null || !Robot.IsConnected) return;
- try
- {
- await Robot.SFreeAsync();
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 1 });
- }
- catch (Exception ex)
- {
- LogHelper.WriteLogError("机器人释放刹车时出错!", ex);
- _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
- }
- }
- private bool CanExecute
- {
- get
- {
- if (Robot != null)
- {
- return Robot.CanExecute;
- }
- else
- {
- return false;
- }
- }
- }
- #endregion
- private bool _IsAllowEdit = false;
- public bool IsAllowEdit
- {
- get { return _IsAllowEdit; }
- set { SetProperty(ref _IsAllowEdit, value); }
- }
- private void LoginChange(Models.User user)
- {
- if (user.userPart == Enums.UserPart.Operator)
- {
- IsAllowEdit = false;
- }
- else
- {
- IsAllowEdit = true;
- }
- }
- }
- }
|