示例#1
0
 public void Menu(string text, string model, string cmd, WebMeta param)
 {
     this.Menu(new UIClick(param)
     {
         Text = text
     }.Send(model, cmd));
 }
示例#2
0
 public void BuildStyle(WebMeta style)
 {
     if (style != null && style.Count > 0)
     {
         _style.Copy(new UIStyle(style));
     }
 }
示例#3
0
 public void BuildFormat(WebMeta format)
 {
     if (format != null && format.Count > 0)
     {
         _data["format"] = format;
     }
 }
示例#4
0
        public static UIItem Create(WebMeta meta)
        {
            var item = new UIItem("", "");

            item.meta = meta;
            return(item);
        }
示例#5
0
 public UIStyle(WebMeta meta)
 {
     if (meta != null)
     {
         this.meta = meta;
     }
 }
示例#6
0
 /// <summary>
 /// 界面查询
 /// </summary>
 /// <param name="key">Section界面Key</param>
 /// <param name="query"></param>
 /// <returns></returns>
 public static UIClick Query(String key, WebMeta query)
 {
     return(new UIClick(new WebMeta().Put("key", key).Put("send", query))
     {
         Key = "Query"
     });
 }
示例#7
0
        public static UICell Create(String type, WebMeta data)
        {
            var celler = new UICeller(data);

            celler.Type = type;
            return(celler);
        }
示例#8
0
 public static UIClick IM(WebMeta im)
 {
     return(new UIClick(im)
     {
         Key = "IM"
     });
 }
示例#9
0
 /// <summary>
 /// 界面查询
 /// </summary>
 /// <param name="query">查询字典对</param>
 /// <returns></returns>
 public static UIClick Query(WebMeta query)
 {
     return(new UIClick(query)
     {
         Key = "Query"
     });
 }
示例#10
0
        public WebMeta AddUIIcon(String icon, string title, string desc, int color)
        {
            WebMeta v = new WebMeta();

            v["Icon"] = icon;
            if (color != 0)
            {
                if (color < 0x1000)
                {
                    v["Color"] = String.Format("#{0:x3}", color);
                }
                else
                {
                    v["Color"] = String.Format("#{0:x6}", color);
                }
            }
            if (String.IsNullOrEmpty(title) == false)
            {
                v["Title"] = title;
            }
            if (String.IsNullOrEmpty(desc) == false)
            {
                v["DefaultValue"] = desc;
            }
            v["Type"] = "UI";
            v["Name"] = UMC.Data.Utility.Parse62Encode(Guid.NewGuid().GetHashCode());
            this.dataSrouce.Add(v);
            return(v);
        }
示例#11
0
        WebMeta Image(WebRequest request)
        {
            var media_id = this.AsyncDialog("media_id", m =>
            {
                var f = Web.UIDialog.CreateDialog("File");
                f.Config.Put("Submit", new UIClick(new UMC.Web.WebMeta(request.Arguments.GetDictionary()).Put("media_id", "Value"))
                {
                    Command = request.Command,
                    Model   = request.Model
                });
                return(f);
            });
            var url    = new Uri(media_id);
            var urlKey = String.Format("UserResources/{0:YYMMDD}/{1}{2}", DateTime.Now, UMC.Data.Utility.TimeSpan(), url.AbsolutePath.Substring(url.AbsolutePath.LastIndexOf('/')));
            var webr   = UMC.Data.WebResource.Instance();


            var domain  = webr.WebDomain();
            var posmata = new UMC.Web.WebMeta();
            var cell    = UMC.Web.UICell.Create("CMSImage", posmata);

            posmata.Put("src", String.Format("{0}{1}", domain, urlKey));

            webr.Transfer(url, urlKey);
            cell.Style.Padding(10);
            return(new UMC.Web.WebMeta().Cell(cell));
        }
示例#12
0
        void OpenUrl(Uri url)
        {
            var meta = new UMC.Web.WebMeta();

            meta["type"]  = "OpenUrl";
            meta["value"] = url.AbsoluteUri;
            this.Context.Send(meta, true);
        }
示例#13
0
        /// <summary>
        /// 创建不用返回值客户端直接返回对话框
        /// </summary>
        /// <param name="value">对话框要返回的值,只能是String,或POSMeta类型</param>
        /// <returns></returns>
        public static UIFormDialog ReturnValue(WebMeta value)
        {
            var v = new POSFromValue();

            v.InputValues = value as WebMeta;

            return(v);
        }
示例#14
0
        WebMeta Text()
        {
            var webr = UMC.Data.WebResource.Instance();
            var data = new UMC.Web.WebMeta().Put("text", "插入文字");
            var cell = UICell.Create("CMSText", data);

            return(new UMC.Web.WebMeta().Cell(cell));
        }
示例#15
0
        public static UIClick Pager(String model, String cmd)
        {
            var key = new WebMeta().Put("model", model, "cmd", cmd);

            return(new UIClick(key)
            {
                Key = "Pager"
            });
        }
示例#16
0
        /// <summary>
        /// 增加一个图片
        /// </summary>
        /// <param name="src"></param>
        public void AddImage(Uri src)
        {
            WebMeta v = new WebMeta();

            v["Src"]  = src.AbsoluteUri;//.ToString();
            v["Type"] = "Image";
            v["Name"] = UMC.Data.Utility.Parse62Encode(Guid.NewGuid().GetHashCode());
            this.dataSrouce.Add(v);
        }
示例#17
0
        /// <summary>
        /// 文件上传,
        /// </summary>
        /// <param name="title"></param>
        /// <param name="Code"></param>
        /// <param name="defaultValue"></param>
        public WebMeta AddFiles(string title, string Code)
        {
            WebMeta v = new WebMeta();

            v["Title"] = title;
            v["Type"]  = "Files";
            v["Name"]  = Code;
            this.dataSrouce.Add(v);
            return(v);
        }
示例#18
0
        public WebMeta AddOption(string title, string code)
        {
            WebMeta v = new WebMeta();

            v["Title"] = title;
            v["Type"]  = "Option";
            v["Name"]  = code;
            this.dataSrouce.Add(v);
            return(v);
        }
示例#19
0
        /// <summary>
        /// 增加地址输入框
        /// </summary>
        /// <param name="title"></param>
        /// <param name="Code"></param>
        /// <param name="defaultValue"></param>
        public void AddAddress(string title, string Code, string defaultValue)
        {
            WebMeta v = new WebMeta();

            v["Title"]        = title;
            v["DefaultValue"] = defaultValue;
            v["Type"]         = "Address";
            v["Name"]         = Code;
            this.dataSrouce.Add(v);
        }
示例#20
0
        /// <summary>
        /// 增加提示,
        /// </summary>
        /// <param name="caption"></param>
        public void AddPrompt(string caption)
        {
            WebMeta v = new WebMeta();

            //v["Title"] = title;
            v["Text"] = caption;
            v["Type"] = "Prompt";
            v["Name"] = UMC.Data.Utility.Parse62Encode(Guid.NewGuid().GetHashCode());
            this.dataSrouce.Add(v);
        }
示例#21
0
        /// <summary>
        /// 增加数字输入框
        /// </summary>
        /// <param name="title"></param>
        /// <param name="Code"></param>
        /// <param name="defaultValue"></param>
        public void AddNumber(string title, string Code, float?defaultValue)
        {
            WebMeta v = new WebMeta();

            v["Title"]        = title;
            v["DefaultValue"] = defaultValue.ToString();
            v["Type"]         = "Number";
            v["Name"]         = Code;
            this.dataSrouce.Add(v);
        }
示例#22
0
 /// <summary>
 /// 界面查询
 /// </summary>
 /// <param name="query">查询字典对</param>
 /// <param name="cache">是否缓存</param>
 /// <returns></returns>
 public static UIClick Query(WebMeta query, bool cache)
 {
     return(cache ? new UIClick(new WebMeta(query).Put("cache", true))
     {
         Key = "Query"
     } : new UIClick(query)
     {
         Key = "Query"
     });
 }
示例#23
0
        /// <summary>
        /// 增加单选择框
        /// </summary>
        public void AddRadio(string title, string code, ListItemCollection items)
        {
            WebMeta v = new WebMeta();

            v.GetDictionary()["DataSource"] = items;
            v["Title"] = title;
            v["Type"]  = "RadioGroup";
            v["Name"]  = code;
            this.dataSrouce.Add(v);
        }
示例#24
0
        public static UIClick Pager(String model, String cmd, WebMeta search, String refreshEvent)
        {
            var key = new WebMeta().Put("model", model, "cmd", cmd).Put("search", search);

            key.Put("RefreshEvent", refreshEvent);
            return(new UIClick(key)
            {
                Key = "Pager"
            });
        }
示例#25
0
        /// <summary>
        /// 列表选择框,
        /// </summary>
        /// <param name="title"></param>
        /// <param name="code"></param>
        /// <param name="value"></param>
        public WebMeta AddOption(string title, string code, string value, String text)
        {
            WebMeta v = new WebMeta();

            v["Title"] = title;
            v.Put("Text", text).Put("DefaultValue", value);
            v["Type"] = "Option";
            v["Name"] = code;
            this.dataSrouce.Add(v);
            return(v);
        }
示例#26
0
        /// <summary>
        /// 事件提交方式参数配置,
        /// </summary>
        /// <param name="btnName">提交按钮名称</param>
        /// <param name="request">提交的当前指令有参数</param>
        /// <param name="colseEvent">对话框关闭的事件</param>
        public void Submit(string btnName, WebRequest request, params string[] colseEvent)
        {
            if (colseEvent.Length > 0)
            {
                this.Config.Put("CloseEvent", String.Join(",", colseEvent));
            }
            var pa = new WebMeta(request.Arguments.GetDictionary());

            submit = new WebMeta("model", request.Model, "cmd", request.Command, "text", btnName).Put("send", pa);
            Submit(btnName);
        }
示例#27
0
        /// <summary>
        /// 增加验收码输入框
        /// </summary>
        /// <param name="title"></param>
        /// <param name="code"></param>
        /// <param name="placeholder"></param>
        /// <returns></returns>
        public WebMeta AddVerify(String title, String code, String placeholder)
        {
            WebMeta v = new WebMeta();

            v["Title"]       = title;
            v["Type"]        = "Verify";
            v["Name"]        = code;
            v["placeholder"] = placeholder;
            this.dataSrouce.Add(v);
            return(v);
        }
示例#28
0
        /// <summary>
        /// 增加时间选择框
        /// </summary>
        /// <param name="title"></param>
        /// <param name="code"></param>
        public WebMeta AddTime(string title, string code, int hour, int minute)
        {
            WebMeta v = new WebMeta();//"DataSource", ds.ToArray());

            v["Title"]        = title;
            v["Type"]         = "Time";
            v["DefaultValue"] = String.Format("{0:00}:{1:00}", hour, minute);
            v["Name"]         = code;
            this.dataSrouce.Add(v);
            return(v);
        }
示例#29
0
        /// <summary>
        /// 增加确认提示
        /// </summary>
        /// <param name="caption"></param>
        public void AddConfirm(string caption, string name, string defaultValue)
        {
            WebMeta v = new WebMeta();

            //v["Title"] = title;
            v["Text"]         = caption;
            v["Type"]         = "Confirm";
            v["DefaultValue"] = defaultValue ?? "YES";
            v["Name"]         = name ?? "CONFIRM_NAME";// WebADNuke.Utils.Utility.Parse62Encode(Guid.NewGuid().GetHashCode());
            this.dataSrouce.Add(v);
        }
示例#30
0
        public WebMeta AddUI(String title, String name, string desc)
        {
            WebMeta v = new WebMeta();

            v["Title"]        = title;
            v["DefaultValue"] = desc;
            v["Type"]         = "UI";
            v["Name"]         = name;// WebADNuke.Utils.Utility.Parse62Encode(Guid.NewGuid().GetHashCode());
            this.dataSrouce.Add(v);
            return(v);
        }