/// <summary>
        /// Gets default value for box module user label.
        /// </summary>
        public override string GetDefaultUserLabel(BoxModuleI boxModule)
        {
            //get atom`s userLabel
            string atomsUserLabel = "???";
            BoxModulePrx atomBoxModulePrx;
            if (Ferda.Modules.Boxes.SocketConnections.TryGetBoxModulePrx(boxModule, "AtomSetting", out atomBoxModulePrx))
            {
                string[] atomDefaultUserLabel = atomBoxModulePrx.getDefaultUserLabel();
                if (atomDefaultUserLabel.Length > 0)
                    atomsUserLabel = atomDefaultUserLabel[0];
            }

            GaceTypeEnum gaceType = (GaceTypeEnum)Enum.Parse(typeof(GaceTypeEnum), boxModule.GetPropertyString("GaceType"));
            string gaceTypeShort = "";
            switch (gaceType)
            {
                case GaceTypeEnum.Positive:
                    break;
                case GaceTypeEnum.Negative:
                    gaceTypeShort = Constants.Negation.ToString();
                    break;
                case GaceTypeEnum.Both:
                    gaceTypeShort = Constants.LeftFunctionBracket + Constants.Negation.ToString() + Constants.RightFunctionBracket;
                    break;
                default:
                    throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(gaceType);
            }
            LiteralTypeEnum literalType = (LiteralTypeEnum)Enum.Parse(typeof(LiteralTypeEnum), boxModule.GetPropertyString("LiteralType"));
            string shortLiteralType = this.GetPropertyOptionShortLocalizedLabel("LiteralType", literalType.ToString(), boxModule.LocalePrefs);
            return gaceTypeShort + atomsUserLabel + shortLiteralType;
        }
 /// <summary>
 /// Gets default value for box module user label.
 /// </summary>
 public override string GetDefaultUserLabel(BoxModuleI boxModule)
 {
     string nameInLiterals = boxModule.GetPropertyString("NameInLiterals");
     if (!String.IsNullOrEmpty(nameInLiterals))
         return nameInLiterals;
     Ice.ObjectPrx objectPrx;
     if (Ferda.Modules.Boxes.SocketConnections.TryGetObjectPrx(boxModule, "ColumnOrDerivedColumn", out objectPrx))
     {
         ColumnFunctionsPrx columnFunctionsPrx =
             ColumnFunctionsPrxHelper.checkedCast(objectPrx);
         return columnFunctionsPrx.getColumnInfo().columnSelectExpression;
     }
     return null;
 }
        /// <summary>
        /// Gets default value for box module user label.
        /// </summary>
        public override string GetDefaultUserLabel(BoxModuleI boxModule)
        {
            CoefficientTypeEnum coefficientType = (CoefficientTypeEnum)Enum.Parse(typeof(CoefficientTypeEnum), boxModule.GetPropertyString("CoefficientType"));
            string shortCoefficientType = this.GetPropertyOptionShortLocalizedLabel("CoefficientType", coefficientType.ToString(), boxModule.LocalePrefs);

            //get attribute`s userLabel
            string attributesUserLabel = "???";
            BoxModulePrx attributeBoxModulePrx;
            if (Ferda.Modules.Boxes.SocketConnections.TryGetBoxModulePrx(boxModule, "Attribute", out attributeBoxModulePrx))
            {
                string[] attributeDefaultUserLabel = attributeBoxModulePrx.getDefaultUserLabel();
                if (attributeDefaultUserLabel.Length > 0)
                    attributesUserLabel = attributeDefaultUserLabel[0];
            }

            string result;
            switch (coefficientType)
            {
                case CoefficientTypeEnum.OneParticularCategory:
                    result = (attributesUserLabel != "???") ? attributesUserLabel : shortCoefficientType;
                    result += Constants.LeftFunctionBracket
                        + boxModule.GetPropertyString("Category")
                        + Constants.RightFunctionBracket;
                    break;
                default:
                    result =
                        attributesUserLabel
                        + Constants.LeftFunctionBracket
                        + shortCoefficientType
                        + Constants.LeftEnum
                        + boxModule.GetPropertyLong("MinLen").ToString()
                        + Constants.RangeSeparator
                        + boxModule.GetPropertyLong("MaxLen").ToString()
                        + Constants.RightEnum
                        + Constants.RightFunctionBracket;
                    break;
            }
            return result;
        }
 /// <summary>
 /// Gets default value for box module user label.
 /// </summary>
 public override string GetDefaultUserLabel(BoxModuleI boxModule)
 {
     string odbcConnectionString = boxModule.GetPropertyString(OdbcConnectionStringPropertyName);
     if (!String.IsNullOrEmpty(odbcConnectionString))
     {
         string[] itemsOfConnectionString = odbcConnectionString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
         if (itemsOfConnectionString != null)
             foreach (string item in itemsOfConnectionString)
             {
                 if (!String.IsNullOrEmpty(item))
                 {
                     item.Trim();
                     if (item.StartsWith("DSN=", StringComparison.OrdinalIgnoreCase))
                         return item.Substring(4);
                 }
             }
         if (odbcConnectionString.Length <= 20)
             return odbcConnectionString;
         else
             return odbcConnectionString.Substring(0, 17) + "...";
     }
     return null;
 }
 /// <summary>
 /// Gets default value for box module user label.
 /// </summary>
 public override string GetDefaultUserLabel(BoxModuleI boxModule)
 {
     return boxModule.GetPropertyString(DataMatrixNamePropertyName);
 }
        private void TestConnectionStringAction(BoxModuleI boxModule)
        {
            bool isConnectionStringValid = false;
            try
            {
                Ferda.Modules.Helpers.Data.Database.TestConnectionString(
                    boxModule.GetPropertyString(OdbcConnectionStringPropertyName),
                    boxModule.StringIceIdentity);
                isConnectionStringValid = true;
            }
            catch (BadParamsError ex)
            {
                if (ex.restrictionType != restrictionTypeEnum.DbConnectionString)
                    throw ex;
            }

            if (isConnectionStringValid)
                // test succeed
                boxModule.OutputMessage(
                    Ferda.ModulesManager.MsgType.Info,
                    "ActionTestConnectionString",
                    "ActionTestConnectionStringSucceed");
            else
                // test failed
                boxModule.OutputMessage(
                    Ferda.ModulesManager.MsgType.Warning,
                    "ActionTestConnectionString",
                    "ActionTestConnectionStringFailed");
        }
 public override void Validate(BoxModuleI boxModule)
 {
     Ferda.Modules.Helpers.Data.Database.TestConnectionString(
         boxModule.GetPropertyString(OdbcConnectionStringPropertyName),
         boxModule.StringIceIdentity);
 }
 /// <summary>
 /// Gets default value for box module user label.
 /// </summary>
 public override string GetDefaultUserLabel(BoxModuleI boxModule)
 {
     return boxModule.GetPropertyString(ColumnSelectExpressionPropertyName);
 }