Beispiel #1
0
        public async Task CreateAreaAsync(AreaModel model)
        {
            var areaClient = GetAreaServiceClient(UserInfo.Username, UserInfo.Token);

            try
            {
                await areaClient.CreateAsync(new WcfAreaServiceReference.AreaDTO
                {
                    LayoutId    = model.LayoutId,
                    Description = model.Description,
                    CoordX      = model.CoordX,
                    CoordY      = model.CoordY
                });
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #2
0
        public async Task UpdateAreaAsync(AreaModel model)
        {
            var areaClient = GetAreaServiceClient(UserInfo.Username, UserInfo.Token);

            try
            {
                await areaClient.UpdateAsync(new WcfAreaServiceReference.AreaDTO
                {
                    Id          = model.Id,
                    LayoutId    = model.LayoutId,
                    Description = model.Description,
                    CoordX      = model.CoordX,
                    CoordY      = model.CoordY
                });
            }
            catch (Exception e)
            {
                if (e.Message.Equals("description must be unique"))
                {
                    var wm = IoC.Get <WindowManager>();
                    wm.ShowDialog(new ErrorViewModel(MyResources.DMBU));
                }
            }
        }