Exemplo n.º 1
0
        /// <summary>
        /// Inserts the asynchronous with collection group js user.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public async Task <IProcessResult> InsertAsyncWithCollectionGroupJSUser(IConnectionInfo connectionInfo, CollectionGroup model)
        {
            IProcessResult result = await InsertAsync(connectionInfo, model);

            if (result.IsSuccess())
            {
                result = await CollectionGroupJSUserBusinessManager.Current.InsertAsync(connectionInfo, new CollectionGroupJSUser()
                {
                    CollectionGroupId = model.CollectionGroupId,
                    JSUserId          = connectionInfo.UserId
                });
            }

            return(result);
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Delete(int collectionItemId)
        {
            if (ModelState.IsValid)
            {
                IProcessResult result = await CollectionItemBusinessManager.Current.DeleteAsync(SecurityManager.Current.ConnectionInfo, new CollectionItem()
                {
                    CollectionItemId = collectionItemId
                });

                if (result.IsSuccess())
                {
                    return(Json(new { Success = true }));
                }
            }

            CollectionItem model = (await CollectionItemBusinessManager.Current.SelectAsync(SecurityManager.Current.ConnectionInfo,
                                                                                            new CollectionItem()
            {
                CollectionItemId = collectionItemId
            })).FirstOrDefault();

            return(await AddEditModal(model.CollectionGroupId, collectionItemId));
        }