Esempio n. 1
0
 public static Helpers.GeneralHelpers.SUBAPPLICATION_TYPES GetSubAppTypeForEdit(ContentURI uri)
 {
     Helpers.GeneralHelpers.SUBAPPLICATION_TYPES apptype = uri.URIDataManager.SubAppType;
     //category edits have an apptype of agreement, but categories need ServiceClassId to find app for edits
     if (uri.URINodeName == AppHelpers.Agreement.AGREEMENT_BASE_TYPES.servicebase.ToString() &&
         uri.URIDataManager.SubActionView
         == Helpers.GeneralHelpers.SUBACTION_VIEWS.categories.ToString())
     {
         if (uri.URIService != null)
         {
             if (uri.URIService.Service != null)
             {
                 ContentURI tempuri = new ContentURI();
                 Helpers.GeneralHelpers.SetAppTypes(uri.URIService.Service.ServiceClassId, tempuri);
                 apptype = tempuri.URIDataManager.SubAppType;
             }
         }
     }
     return(apptype);
 }
Esempio n. 2
0
        public static string GetForeignKeyName(Helpers.GeneralHelpers.APPLICATION_TYPES appType,
                                               Helpers.GeneralHelpers.SUBAPPLICATION_TYPES subAppType, string parentNodeName,
                                               bool isBaseKey)
        {
            string sForeignKeyName     = string.Empty;
            string sChildForeignName   = string.Empty;
            string sBaseForeignKeyName = string.Empty;

            switch (appType)
            {
            case Helpers.GeneralHelpers.APPLICATION_TYPES.accounts:
                AppHelpers.Accounts.GetChildForeignKeyName(parentNodeName,
                                                           out sForeignKeyName);
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.members:
                AppHelpers.Members.GetChildForeignKeyName(parentNodeName,
                                                          out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.networks:
                AppHelpers.Networks.GetChildForeignKeyName(parentNodeName,
                                                           out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.locals:
                AppHelpers.Locals.GetChildForeignKeyName(parentNodeName,
                                                         out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.addins:
                AppHelpers.AddIns.GetChildForeignKeyName(parentNodeName,
                                                         out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.agreements:
                AppHelpers.Agreement.GetChildForeignKeyNames(parentNodeName,
                                                             out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.prices:
                AppHelpers.Prices.GetChildForeignKeyName(subAppType, parentNodeName,
                                                         out sForeignKeyName);
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.economics1:
                AppHelpers.Economics1.GetChildForeignKeyName(subAppType, parentNodeName,
                                                             out sForeignKeyName);
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.devpacks:
                AppHelpers.DevPacks.GetChildForeignKeyName(parentNodeName,
                                                           out sChildForeignName, out sBaseForeignKeyName);
                if (isBaseKey == true)
                {
                    sForeignKeyName = sBaseForeignKeyName;
                }
                else
                {
                    sForeignKeyName = sChildForeignName;
                }
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.linkedviews:
                AppHelpers.LinkedViews.GetChildForeignKeyName(parentNodeName,
                                                              out sForeignKeyName);
                break;

            case Helpers.GeneralHelpers.APPLICATION_TYPES.resources:
                AppHelpers.Resources.GetChildForeignKeyName(parentNodeName,
                                                            out sForeignKeyName);
                break;

            default:
                //don't render any ui
                break;
            }
            return(sForeignKeyName);
        }