Exemple #1
0
 internal Operator(OperatorConfig config, IDbDataSource source,
                   IInputData input, IFieldInfo[] keys)
     : this(config)
 {
     string queryString = GetQueryString(keys);
     CreateContent(config, source, input, queryString);
 }
Exemple #2
0
 private Operator(OperatorConfig config)
 {
     Id          = config.Id;
     Caption     = config.Caption.ToString(ObjectUtil.SysCulture);
     Info        = config.Info;
     ConfirmData = config.ConfirmData == null ? null
         : config.ConfirmData.ToString(ObjectUtil.SysCulture);
     IconClass = config.IconClass;
 }
Exemple #3
0
 private void CreateContent(OperatorConfig config, object source, IInputData input, string queryString)
 {
     if (config.Content != null)
     {
         Content = Expression.Execute(config.Content, source);
         if (config.UseKey)
         {
             Content = UriUtil.AppendQueryString(Content, queryString);
         }
     }
     else
     {
         //string sourceStr = input.SourceInfo.CcSource;
         //if (Info != null)
         //{
         //    if (Info.Contains(RightConst.INSERT))
         //        Content = string.Format(ObjectUtil.SysCulture,
         //            "insert/{0}.c", sourceStr).AppVirutalPath();
         //    else if (Info.Contains(RightConst.UPDATE))
         //        Content = string.Format(ObjectUtil.SysCulture,
         //            "update/{0}.c?{1}", sourceStr, queryString).AppVirutalPath();
         //    else if (Info.Contains(RightConst.DELETE))
         //        Content = string.Format(ObjectUtil.SysCulture,
         //            "delete/{0}.c?{1}", sourceStr, queryString).AppVirutalPath();
         //}
         string sourceStr = input.SourceInfo.Source;
         if (Info != null)
         {
             if (Info.Contains(RightConst.INSERT))
             {
                 Content = string.Format(ObjectUtil.SysCulture,
                                         "c/xml/insert/{0}", sourceStr).AppVirutalPath();
             }
             else if (Info.Contains(RightConst.UPDATE))
             {
                 Content = string.Format(ObjectUtil.SysCulture,
                                         "c/xml/update/{0}?{1}", sourceStr, queryString).AppVirutalPath();
             }
             else if (Info.Contains(RightConst.DELETE))
             {
                 Content = string.Format(ObjectUtil.SysCulture,
                                         "c/xml/delete/{0}?{1}", sourceStr, queryString).AppVirutalPath();
             }
         }
     }
     if (config.DialogTitle == null)
     {
         DialogTitle = Caption;
     }
     else
     {
         DialogTitle = Expression.Execute(config.DialogTitle, source);
     }
 }
Exemple #4
0
 internal Operator(OperatorConfig config, ISource source, IInputData input)
     : this(config)
 {
     CreateContent(config, source, input, ID_STR);
 }
 public void CreateOperator()
 {
     OperatorConfig = Operator.CreateObject();
 }