コード例 #1
0
        public static void ValidateXSDInput(
            EditHelpers.EditHelper.ArgumentsEdits editArgs)
        {
            //no leading or trailing white spaces
            if (editArgs.EditAttValue == null)
            {
                editArgs.EditAttValue = string.Empty;
            }
            string sAttValue = editArgs.EditAttValue.Trim();

            if (editArgs.EditDataType != string.Empty)
            {
                ValidateXSDInput(editArgs.EditAttName, ref sAttValue,
                                 editArgs.EditDataType, editArgs.EditSize);
                editArgs.EditAttValue = sAttValue;
            }
            else
            {
                editArgs.EditAttValue = sAttValue;
            }
            if (editArgs.EditAttValue == string.Empty)
            {
                editArgs.EditAttValue = "0";
            }
        }
コード例 #2
0
ファイル: Agreement.cs プロジェクト: kpboyle1/devtreks
 public static void ChangeAttributesForInsertion(
     EditHelpers.EditHelper.ArgumentsEdits addsArguments,
     ContentURI selectedURI, XElement selectedElement)
 {
     //before inserting service nodes, change app-specfic attributes
     if (selectedURI.URINodeName
         == AppHelpers.Agreement.AGREEMENT_TYPES.service.ToString())
     {
         //accountid is always currently logged-in user (for all db-inserted contracts)
         selectedElement.SetAttributeValue(General.ACCOUNTID,
                                           addsArguments.URIToEdit.URIMember.ClubInUse.PKId.ToString());
         if (addsArguments.URIToEdit.URIDataManager.ServerSubActionType
             != Helpers.GeneralHelpers.SERVER_SUBACTION_TYPES.adddefaults)
         {
             //selections always false - they are not owned
             selectedElement.SetAttributeValue(ISOWNER, "0");
             int iAuthorizationLevel
                 = (int)AccountHelper.AUTHORIZATION_LEVELS.viewonly;
             //selections start as view only
             selectedElement.SetAttributeValue(Members.AUTHORIZATION_LEVEL,
                                               iAuthorizationLevel.ToString());
         }
         else
         {
             //default insertions are owned
             selectedElement.SetAttributeValue(ISOWNER, "1");
             int iAuthorizationLevel
                 = (int)AccountHelper.AUTHORIZATION_LEVELS.viewonly;
             //public can view but not edit
             selectedElement.SetAttributeValue(Members.AUTHORIZATION_LEVEL,
                                               iAuthorizationLevel.ToString());
         }
     }
 }
コード例 #3
0
 public static void GetParentOfRecursiveNodesId(
     EditHelpers.EditHelper.ArgumentsEdits addsArguments,
     out string recursiveParentKeyName, out string recursiveParentId)
 {
     recursiveParentKeyName = string.Empty;
     recursiveParentId      = string.Empty;
     if (addsArguments.URIToEdit.URIDataManager.Ancestors != null)
     {
         ContentURI groupURI = Helpers.LinqHelpers.GetContentURIByNodeName(
             addsArguments.URIToEdit.URIDataManager.Ancestors,
             DEVPACKS_TYPES.devpackgroup.ToString());
         if (groupURI != null)
         {
             recursiveParentKeyName = DEVPACKGROUPID;
             recursiveParentId      = groupURI.URIId.ToString();
         }
     }
 }