private void bindServiceInfo( long serviceId, Service service ) { set( "serviceId", serviceId ); set( "service.Name", service.Name ); // List参数用于设置默认选择项为List模板 set( "templateType", TemplateUtil.getServiceTemplates( service.Note, "List", ctx, templateService ) ); }
private List<ContentApp> getApps( Service service ) { List<ContentSection> sections = ContentSection.find( "ServiceId=" + service.Id ).list(); if (sections.Count == 0) return new List<ContentApp>(); String ids = strUtil.GetIds( sections ); if (strUtil.IsNullOrEmpty( ids )) return new List<ContentApp>(); return ContentApp.find( "Id in (" + ids + ")" ).list(); }
private void bindServiceThree( long serviceId, long templateId, Service service, ContentSectionTemplate template ) { set( "service.Id", serviceId ); set( "service.Name", service.Name ); set( "template.Id", templateId ); set( "template.Name", template.Name ); StringBuilder builder = new StringBuilder(); IList parms = service.GetParams(); for (int i = 0; i < parms.Count; i++) { ParamControl control = parms[i] as ParamControl; builder.Append( "<div>" ); builder.Append( control.Html ); builder.Append( "</div>" ); } set( "settingList", builder.ToString() ); }
private void bindSettingEdit( ContentSection section, Service service ) { StringBuilder builder = new StringBuilder(); IList parms = service.GetParams(); for (int i = 0; i < parms.Count; i++) { ParamControl control = parms[i] as ParamControl; control.Value = control.ChangeType( section.GetServiceParamValue( "param" + i ) ).ToString(); builder.Append( "<div>" ); builder.Append( control.Html ); builder.Append( "</div>" ); } set( "settingList", builder.ToString() ); }
private static Object getValue( Service service, KeyValuePair<String, String> pair ) { Dictionary<String, String> pd = service.GetParamDefault(); String valueType = pd[pair.Key]; if (valueType.Equals( "int" )) return cvt.ToInt( pair.Value ); return pair.Value; }