Esempio n. 1
0
        public override void OnSaveData()
        {
            //see notes above!!
            try
            {
                JarsResourceGroup saveObj = defaultBindingSource.Current as JarsResourceGroup;
                //var upList = new List<OperativeGroup>() { saveOp };
                var store = new StoreResourceGroup()
                {
                    Group = saveObj.ConvertTo <ResourceGroupDto>()
                };
                var resp = ServiceClient.Post(store);

                //if the response was good, then notify the others.
                if (resp.ResponseStatus == null)
                {
                    saveObj = resp.Group.ConvertTo <JarsResourceGroup>();
                    Context.ServiceClient.Post(new ResourceGroupsNotification()
                    {
                        FromUserName = Context.LoggedInUser.UserName,
                        Selector     = SelectorTypes.store,
                        Ids          = new List <int>()
                        {
                            resp.Group.Id
                        }
                    });
                }
                base.OnSaveData();
            }
            catch (Exception exS)
            {
                OnExceptionEvent(exS);
            }
        }