コード例 #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (lbNamesProject.SelectedIndex != -1)
            {
                var selName = lbNamesProject.SelectedItem.ToString();
                if (!IdentityNamesAML.Contains(selName))
                {
                    if (IsTemplate)
                    {
                        var listRoles = Inn.newItem("List", "edit");
                        listRoles.setAttribute("where", "keyed_name='Project Role'");
                        var listValue = Inn.newItem("Value", "add");
                        listValue.setProperty("value", selName);
                        listRoles.addRelationship(listValue);
                        var itm = listRoles.apply();
                    }
                    //else - don't allow the creation of identities. they must be authorized (licensed) users.
                }

                RefreshIndentiesAML();
                RefreshMppNames();
            }
        }
コード例 #2
0
        public void create_document_on_save()
        {
            // Arrange
            string partName = Guid.NewGuid().ToString("N");
            Item   context  = Inn.newItem("Part", "add");

            context.setProperty("item_number", partName);
            context = context.apply();
            var  item = new ServerMethods(context);
            Item doc  = Inn.newItem("Document", "get");

            doc.setProperty("item_number", partName);

            // Act
            var res = item.create_document_on_save();

            doc = doc.apply();

            // Assert
            Assert.False(res.isError());
            Assert.False(doc.isError());
            Assert.False(doc.isCollection());
            Assert.False(string.IsNullOrWhiteSpace(doc.getID()));
        }