static void Main() { var container = new Container(); var appDomainDirectory = AppDomain.CurrentDomain.BaseDirectory; var assembliesToLoad = new List<string>(); foreach (var fileName in Directory.EnumerateFiles(appDomainDirectory).Select(s => s.Replace(appDomainDirectory, string.Empty))) { if (fileName.StartsWith("Banking") && fileName.EndsWith(".dll")) { assembliesToLoad.Add(fileName); } } var assemblies = new[] { Assembly.GetExecutingAssembly() }.ToList(); assemblies.AddRange(assembliesToLoad.Select(Assembly.LoadFrom)); var types = assemblies.SelectMany(a => a.GetTypes()); foreach (var type in types) { if (type.IsClass && type.GetInterfaces().Any() && !type.IsNested) { foreach (var @interface in type.GetInterfaces()) { if (@interface.FullName.StartsWith("Banking")) { try { container.Register(@interface, type); } catch (Exception) { } } } } } container.Verify(); if (!File.Exists("datastore.txt")) { File.Create("datastore.txt").Close(); } ApplicationFacade.Configure(container.GetInstance<AccountBalanceController>, container.GetInstance<HomeController>); var controller = container.GetInstance<HomeController>(); controller.GetHomeView(); }
public IEnumerable<IronPythonTypeWrapper> GetTypesFromScript(ScriptSource script, IEnumerable<Type> injectTypes = null) { CompiledCode code = script.Compile(); var scope = _engine.CreateScope(); var types = new[] {typeof (IronPythonImportDefinition)}.ToList(); if (injectTypes != null) { types.AddRange(injectTypes); } foreach (Type type in types) { scope.InjectType(type); } using (var libStream = GetType().Assembly.GetManifestResourceStream("Altman.Pex.lib.py")) using ( var libText = new StreamReader(libStream)) { var libSource = _engine.CreateScriptSourceFromString(libText.ReadToEnd()); libSource.Execute(scope); } // "force" all classes to be new style classes dynamic metaclass; if (!scope.TryGetVariable("__metaclass__", out metaclass)) { scope.SetVariable("__metaclass__", _engine.GetBuiltinModule().GetVariable("type")); } scope.SetVariable("clr", _engine.GetClrModule()); code.Execute(scope); var pluginClasses = scope.GetItems() .Where(kvp => kvp.Value is PythonType && !kvp.Key.StartsWith("__")) .Select(kvp => new IronPythonTypeWrapper(_engine, kvp.Key, kvp.Value, scope.GetVariableHandle(kvp.Key))) .Where(kvp => !types.Contains(kvp.Type)); return pluginClasses; }
protected void RegisterContactFields() { var columnSelectorData = new[] { new { name = "firstName", title = CRMContactResource.FirstName }, new { name = "lastName", title = CRMContactResource.LastName }, new { name = "jobTitle", title = CRMContactResource.JobTitle }, new { name = "companyName", title = CRMContactResource.CompanyName }, new { name = "about", title = CRMContactResource.About } }.ToList(); foreach (ContactInfoType infoTypeEnum in Enum.GetValues(typeof(ContactInfoType))) { var localName = String.Format("contactInfo_{0}_{1}", infoTypeEnum, ContactInfo.GetDefaultCategory(infoTypeEnum)); var localTitle = infoTypeEnum.ToLocalizedString(); if (infoTypeEnum == ContactInfoType.Address) foreach (AddressPart addressPartEnum in Enum.GetValues(typeof(AddressPart))) columnSelectorData.Add(new { name = String.Format(localName + "_{0}_{1}", addressPartEnum, (int)AddressCategory.Work), title = String.Format(localTitle + " {0}", addressPartEnum.ToLocalizedString().ToLower()) }); else columnSelectorData.Add(new { name = localName, title = localTitle }); } columnSelectorData.AddRange(Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Contact) .FindAll(customField => customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode() })); var tagList = Global.DaoFactory.GetTagDao().GetAllTags(EntityType.Contact); if (tagList.Length > 0) { TagList = tagList.ToList(); Page.RegisterInlineScript(String.Format(" var tagList = {0}; ", JavaScriptSerializer.Serialize(TagList.Select(tagName => new { name = "tag_" + tagName.HtmlEncode(), title = tagName.HtmlEncode() }))), onReady: false); } Page.RegisterInlineScript(String.Format(" var columnSelectorData = {0}; ", JavaScriptSerializer.Serialize(columnSelectorData)), onReady: false); }
private void ParseFile(string filename, uint depth, ref System.Collections.Generic.List<string> outputfiles) { SFWorkflow.WFFileType.FileType type = SFWorkflow.WFFileType.GetFileType(filename); if (type == SFWorkflow.WFFileType.FileType.OlePowerPoint) { uint fileidx = 0; System.Collections.Generic.List<string> pptfiles = new System.Collections.Generic.List<string>(); DIaLOGIKa.b2xtranslator.StructuredStorage.Reader.StructuredStorageReader ssr = new DIaLOGIKa.b2xtranslator.StructuredStorage.Reader.StructuredStorageReader(filename); DIaLOGIKa.b2xtranslator.PptFileFormat.PowerpointDocument ppt = new DIaLOGIKa.b2xtranslator.PptFileFormat.PowerpointDocument(ssr); foreach (uint persistId in ppt.PersistObjectDirectory.Keys) { UInt32 offset = ppt.PersistObjectDirectory[persistId]; ppt.PowerpointDocumentStream.Seek(offset, System.IO.SeekOrigin.Begin); DIaLOGIKa.b2xtranslator.PptFileFormat.ExOleObjStgAtom obj = DIaLOGIKa.b2xtranslator.OfficeDrawing.Record.ReadRecord(ppt.PowerpointDocumentStream) as DIaLOGIKa.b2xtranslator.PptFileFormat.ExOleObjStgAtom; if (obj != null) { string filedir = string.Format("{0}\\{1}", System.IO.Directory.GetParent(filename).FullName, SFWorkflow.WFUtilities.GetNextDirectoryNumber(System.IO.Directory.GetParent(filename).FullName)); if (!System.IO.Directory.Exists(filedir)) System.IO.Directory.CreateDirectory(filedir); if (System.IO.Directory.Exists(filedir)) { byte[] data = obj.DecompressData(); System.IO.MemoryStream ms = new System.IO.MemoryStream(data); SFWorkflow.WFFileType.FileType oletype = SFWorkflow.WFFileType.GetOleFileType(data); if (oletype == WFFileType.FileType.OlePackage || oletype == WFFileType.FileType.OleContents) { using (OpenMcdf.CompoundFile cf = new OpenMcdf.CompoundFile(ms)) { WriteStorage(cf.RootStorage, filedir, depth, ref pptfiles); } } else { string filenm = String.Format("{0}\\pptembed{1}", filedir, fileidx); using (System.IO.FileStream fs = new System.IO.FileStream(filenm, System.IO.FileMode.Create, System.IO.FileAccess.Write)) { byte[] buffer = new byte[1024]; int len; while ((len = ms.Read(buffer, 0, buffer.Length)) > 0) { fs.Write(buffer, 0, len); } pptfiles.Add(filenm); } fileidx++; ms.Close(); ms.Dispose(); } } } } #if false foreach (DIaLOGIKa.b2xtranslator.PptFileFormat.ExOleEmbedContainer ole in ppt.OleObjects.Values) { string filedir = string.Format("{0}\\{1}", System.IO.Directory.GetParent(filename).FullName, diridx++); if (!System.IO.Directory.Exists(filedir)) System.IO.Directory.CreateDirectory(filedir); if (System.IO.Directory.Exists(filedir)) { string filenm = String.Format("{0}\\pptembed{1}", filedir, ole.SiblingIdx); try { System.IO.FileStream fss = new System.IO.FileStream(filenm, System.IO.FileMode.Create, System.IO.FileAccess.Write); byte[] data = ole.stgAtom.DecompressData(); fss.Write(data, 0, data.Length); fss.Flush(); fss.Close(); fss.Dispose(); pptfiles.Add(filenm); } catch (Exception ex) { } } } #endif foreach (DIaLOGIKa.b2xtranslator.OfficeDrawing.Record record in ppt.PicturesContainer._pictures.Values) //.Where(x => x.TypeCode == 0xF01C || x.TypeCode == 0xF01D || x.TypeCode == 0xF01E || x.TypeCode == 0xF01F || x.TypeCode == 0xF029 || x.TypeCode == 0xF02A)) { string filedir = string.Format("{0}\\{1}", System.IO.Directory.GetParent(filename).FullName, "PPTPictures"); //, SFWorkflow.WFUtilities.GetNextDirectoryNumber(System.IO.Directory.GetParent(filename).FullName)); if (!System.IO.Directory.Exists(filedir)) System.IO.Directory.CreateDirectory(filedir); if (System.IO.Directory.Exists(filedir)) { string extension = string.Empty; int skip = 0; switch (record.TypeCode) { case 0xF01A: extension = ".emf"; break; case 0xF01B: extension = ".wmf"; break; case 0xF01C: extension = ".pict"; break; case 0xF01D: case 0xF02A: extension = ".jpg"; skip = 17; break; case 0xF01E: extension = ".png"; skip = 17; break; case 0xF01F: extension = ".dib"; break; case 0xF029: extension = ".tiff"; break; } string filenm = String.Format("{0}\\pptembed{1}{2}", filedir, fileidx++, extension); using(System.IO.FileStream fs = new System.IO.FileStream(filenm, System.IO.FileMode.Create, System.IO.FileAccess.Write)) { // need to skip 17 byte header in raw data stream byte[] data = ((extension == ".emf" || extension == ".wmf")) ? ((DIaLOGIKa.b2xtranslator.OfficeDrawing.MetafilePictBlip)record).Decrompress() : record.RawData.Skip(skip).ToArray(); fs.Write(data, 0, data.Length); fs.Flush(); fs.Close(); fs.Dispose(); pptfiles.Add(filenm); } } } ssr.Close(); ssr.Dispose(); outputfiles.AddRange(pptfiles); depth--; if (depth > 0) { foreach(string fn in pptfiles) ParseFile(fn, depth, ref outputfiles); } } else { using (OpenMcdf.CompoundFile cf = new OpenMcdf.CompoundFile(filename)) { WriteStorage(cf.RootStorage, System.IO.Directory.GetParent(filename).FullName, depth, ref outputfiles); } } }
IEnumerable<string> GetArguments(string source, string destination, RsyncOptions options) { if (options == null) options = new RsyncOptions(); var args = new[] {defaultParams}.ToList(); if (options.Key != null) args.Add($"-e \"'{_sshBinPath}' {sshKeyParams} -i '{HandlePath(options.Key)}'\""); if (options.AdditionalArguments != null) args.AddRange(options.AdditionalArguments); args.Add(HandlePath(source).EscapePath()); args.Add(HandlePath(destination).EscapePath()); return args; }
public IViewEngine CreateModulesViewEngine(CreateModulesViewEngineParams parameters) { var areaFormats = new[] { "~/Core/{2}/Views/{1}/{0}.cshtml", "~/Modules/{2}/Views/{1}/{0}.cshtml" }; //Logger.Debug("AreaFormats (module): \r\n\t-{0}", string.Join("\r\n\t-", areaFormats)); //基本上不再用了 //var universalFormats = parameters.VirtualPaths // .SelectMany(x => new[] { // x + "/Views/{0}.cshtml", // }) // .ToArray(); var viewFormat = new[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.cshtml" }; var masterLocationFormat = new[] { "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.cshtml" }; var areaMasterLocationFormats = new[] { "~/Core/{2}/Views/Shared/{0}.cshtml", "~/Modules/{2}/Views/Shared/{0}.cshtml" }.ToList(); var partialViewFormats = parameters.VirtualPaths .SelectMany(x => new[] { x + "/Views/Shared/{0}.cshtml", }).ToArray(); ; areaMasterLocationFormats.AddRange(parameters.VirtualPaths .SelectMany(x => new[] { x + "/Views/Shared/{0}.cshtml", })); //Logger.Debug("UniversalFormats (module): \r\n\t-{0}", string.Join("\r\n\t-", universalFormats)); var viewEngine = new RazorViewEngine { MasterLocationFormats = masterLocationFormat, ViewLocationFormats = viewFormat, PartialViewLocationFormats = partialViewFormats, AreaMasterLocationFormats = areaMasterLocationFormats.ToArray(), AreaViewLocationFormats = areaFormats, AreaPartialViewLocationFormats = areaFormats, }; return viewEngine; }
/// <summary> /// Finds the task in folder. /// </summary> /// <param name="fld">The folder.</param> /// <param name="taskName">The wildcard expression to compare task names with.</param> /// <param name="results">The results.</param> /// <param name="recurse">if set to <c>true</c> recurse folders.</param> /// <returns>True if any tasks are found, False if not.</returns> private bool FindTaskInFolder(TaskFolder fld, System.Text.RegularExpressions.Regex taskName, ref System.Collections.Generic.List<Task> results, bool recurse = true) { results.AddRange(fld.GetTasks(taskName)); if (recurse) { foreach (var f in fld.SubFolders) { if (FindTaskInFolder(f, taskName, ref results, recurse)) return true; } } return false; }
// added by .net follower (http://dotnetfollower.com) /*******************************/ /// <summary> /// Sets the capacity for the specified ArrayList /// </summary> /// <param name="vector">The ArrayList which capacity will be set</param> /// <param name="newCapacity">The new capacity value</param> // public static void SetCapacity(System.Collections.ArrayList vector, int newCapacity) // commented by .net follower (http://dotnetfollower.com) public static void SetCapacity(System.Collections.Generic.List<Object> vector, int newCapacity) { if (newCapacity > vector.Count) vector.AddRange(new Array[newCapacity-vector.Count]); else if (newCapacity < vector.Count) vector.RemoveRange(newCapacity, vector.Count - newCapacity); vector.Capacity = newCapacity; }
protected override IEnumerable<KeyValuePair<string, object>> GetClientVariables(HttpContext context) { var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "firstName", title = CRMContactResource.FirstName, isHeader = false }, new { name = "lastName", title = CRMContactResource.LastName, isHeader = false }, new { name = "title", title = CRMContactResource.JobTitle, isHeader = false }, new { name = "companyName", title = CRMContactResource.CompanyName, isHeader = false }, new { name = "contactStage", title = CRMContactResource.ContactStage, isHeader = false }, new { name = "contactType", title = CRMContactResource.ContactType, isHeader = false }, new { name = "notes", title = CRMContactResource.About, isHeader = false } }.ToList(); foreach (ContactInfoType infoTypeEnum in Enum.GetValues(typeof(ContactInfoType))) foreach (Enum categoryEnum in Enum.GetValues(ContactInfo.GetCategory(infoTypeEnum))) { var localName = String.Format("contactInfo_{0}_{1}", infoTypeEnum, Convert.ToInt32(categoryEnum)); var localTitle = String.Format("{1} ({0})", categoryEnum.ToLocalizedString().ToLower(), infoTypeEnum.ToLocalizedString()); if (infoTypeEnum == ContactInfoType.Address) foreach (AddressPart addressPartEnum in Enum.GetValues(typeof(AddressPart))) columnSelectorData.Add(new { name = String.Format(localName + "_{0}", addressPartEnum), title = String.Format(localTitle + " {0}", addressPartEnum.ToLocalizedString().ToLower()), isHeader = false }); else columnSelectorData.Add(new { name = localName, title = localTitle, isHeader = false }); } var fieldsDescription = Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Company); Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Person).ForEach(item => { var alreadyContains = fieldsDescription.Any(field => field.ID == item.ID); if (!alreadyContains) fieldsDescription.Add(item); }); columnSelectorData.AddRange(fieldsDescription .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMContactResource.ContactTags, isHeader = true }, new { name = "tag", title = CRMContactResource.ContactTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 10), isHeader = false }, }.ToList() ); yield return RegisterObject("columnSelectorData", columnSelectorData); }
protected void Page_Load(object sender, EventArgs e) { Utility.RegisterTypeForAjax(typeof(ImportFromCSVView)); Page.ClientScript.RegisterClientScriptInclude(GetType(), "ajaxupload_script", WebPath.GetPath("js/ajaxupload.3.5.js")); var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "firstName", title = CRMContactResource.FirstName, isHeader = false }, new { name = "lastName", title = CRMContactResource.LastName, isHeader = false }, new { name = "title", title = CRMContactResource.JobTitle, isHeader = false }, new { name = "companyName", title = CRMContactResource.CompanyName, isHeader = false }, new { name = "notes", title = CRMContactResource.About, isHeader = false }, new { name = "tag", title = CRMContactResource.Tags, isHeader = false } }.ToList(); foreach (ContactInfoType infoTypeEnum in Enum.GetValues(typeof(ContactInfoType))) foreach (Enum categoryEnum in Enum.GetValues(ContactInfo.GetCategory(infoTypeEnum))) { var localName = String.Format("contactInfo_{0}_{1}", infoTypeEnum, Convert.ToInt32(categoryEnum)); var localTitle = String.Format("{1} ({0})", categoryEnum.ToLocalizedString().ToLower(), infoTypeEnum.ToLocalizedString()); if (infoTypeEnum == ContactInfoType.Address) foreach (AddressPart addressPartEnum in Enum.GetValues(typeof(AddressPart))) columnSelectorData.Add(new { name = String.Format(localName + "_{0}", addressPartEnum), title = String.Format(localTitle + " {0}", addressPartEnum.ToLocalizedString().ToLower()), isHeader = false }); else columnSelectorData.Add(new { name = localName, title = localTitle, isHeader = false }); } columnSelectorData.AddRange(Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Contact).FindAll(customField => customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea || customField.FieldType == CustomFieldType.Heading) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); Page.ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), String.Format(" var {0} = {1}; ", "columnSelectorData", JavaScriptSerializer.Serialize(columnSelectorData)), true); var privatePanel = (PrivatePanel)Page.LoadControl(PrivatePanel.Location); privatePanel.CheckBoxLabel = CRMContactResource.PrivatePanelCheckBoxLabelForContact; privatePanel.IsPrivateItem = false; var usersWhoHasAccess = new List<string> { CustomNamingPeople.Substitute<CRMCommonResource>("CurrentUser").HtmlEncode() }; privatePanel.UsersWhoHasAccess = usersWhoHasAccess; privatePanel.DisabledUsers = new List<Guid> { SecurityContext.CurrentAccount.ID }; privatePanel.HideNotifyPanel = true; _phPrivatePanel.Controls.Add(privatePanel); }
public void Save(System.Collections.Specialized.StringCollection values) { values.Clear(); values.AddRange(_files.ToArray()); }
/*******************************/ /// <summary> /// Sets the capacity for the specified ArrayList /// </summary> /// <param name="vector">The ArrayList which capacity will be set</param> /// <param name="newCapacity">The new capacity value</param> internal static void SetCapacity(System.Collections.ArrayList vector, int newCapacity) { if (newCapacity > vector.Count) vector.AddRange(new Array[newCapacity-vector.Count]); else if (newCapacity < vector.Count) vector.RemoveRange(newCapacity, vector.Count - newCapacity); vector.Capacity = newCapacity; }
private List<string> GetSourceFieldNames() { if (this.SourceSchemaFields != null && this.SourceSchemaFields.Any()) { return this.SourceSchemaFields.Select(x => x.GetFieldFullName(false)).ToList(); } List<string> sourceFields = new[] { "[Title]", "[TcmId]", "[ID]" }.ToList(); if (!string.IsNullOrEmpty(this.SourceSchemaUri)) { List<ItemFieldDefinitionData> sourceComponentFields = Functions.GetSchemaFields(this.SourceSchemaUri); List<ItemFieldDefinitionData> sourceMetadataFields = Functions.GetSchemaMetadataFields(this.SourceSchemaUri); this.SourceSchemaFields = Functions.GetAllFields(sourceComponentFields, sourceMetadataFields, false, false); sourceFields.AddRange(this.SourceSchemaFields.Select(x => x.GetFieldFullName(false)).ToList()); } return sourceFields; }
protected void InitForContacts() { StartImportLabel = CRMContactResource.StartImport; ImportFromCSVStepOneHeaderLabel = CRMContactResource.ImportFromCSVStepOneHeader; ImportFromCSVStepTwoHeaderLabel = CRMContactResource.ImportFromCSVStepTwoHeader; ImportFromCSVStepOneDescriptionLabel = CRMContactResource.ImportFromCSVStepOneDescription; ImportFromCSVStepTwoDescriptionLabel = CRMContactResource.ImportFromCSVStepTwoDescription; ImportStartingPanelHeaderLabel = CRMContactResource.ImportStartingPanelHeader; ImportStartingPanelDescriptionLabel = CRMContactResource.ImportStartingPanelDescription; ImportStartingPanelButtonLabel = CRMContactResource.ImportStartingPanelButton; ImportImgSrc = WebImageSupplier.GetAbsoluteWebPath("import_contacts.png", ProductEntryPoint.ID); var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "firstName", title = CRMContactResource.FirstName, isHeader = false }, new { name = "lastName", title = CRMContactResource.LastName, isHeader = false }, new { name = "title", title = CRMContactResource.JobTitle, isHeader = false }, new { name = "companyName", title = CRMContactResource.CompanyName, isHeader = false }, new { name = "contactStage", title = CRMContactResource.ContactStage, isHeader = false }, new { name = "contactType", title = CRMContactResource.ContactType, isHeader = false }, new { name = "notes", title = CRMContactResource.About, isHeader = false } }.ToList(); foreach (ContactInfoType infoTypeEnum in Enum.GetValues(typeof(ContactInfoType))) foreach (Enum categoryEnum in Enum.GetValues(ContactInfo.GetCategory(infoTypeEnum))) { var localName = String.Format("contactInfo_{0}_{1}", infoTypeEnum, Convert.ToInt32(categoryEnum)); var localTitle = String.Format("{1} ({0})", categoryEnum.ToLocalizedString().ToLower(), infoTypeEnum.ToLocalizedString()); if (infoTypeEnum == ContactInfoType.Address) foreach (AddressPart addressPartEnum in Enum.GetValues(typeof(AddressPart))) columnSelectorData.Add(new { name = String.Format(localName + "_{0}", addressPartEnum), title = String.Format(localTitle + " {0}", addressPartEnum.ToLocalizedString().ToLower()), isHeader = false }); else columnSelectorData.Add(new { name = localName, title = localTitle, isHeader = false }); } var fieldsDescription = Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Company); Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Person).ForEach(item => { var alreadyContains = fieldsDescription.Any(field => field.ID == item.ID); if (!alreadyContains) fieldsDescription.Add(item); }); columnSelectorData.AddRange(fieldsDescription.FindAll(customField => customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea || customField.FieldType == CustomFieldType.Heading) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMContactResource.ContactTags, isHeader = true }, new { name = "tag", title = CRMContactResource.ContactTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 10), isHeader = false }, }.ToList() ); Page.RegisterInlineScript(String.Format(" var columnSelectorData = {0}; ", JavaScriptSerializer.Serialize(columnSelectorData)), onReady: false); RegisterClientScriptHelper.DataUserSelectorListView(Page, "_ImportContactsManager", null, null, true); }
internal static void GetAddInInfo(GXProtocolAddIn addIn, out Type deviceType, System.Collections.Generic.List<Type> types) { deviceType = addIn.GetDeviceType(); types.Add(typeof(Gurux.Communication.ChecksumType)); types.Add(typeof(PartialReadType)); types.Add(typeof(PartialReadType)); types.Add(deviceType); Type[] tmp = addIn.GetCategoryTypes(null); if (tmp != null && tmp.Length != 0) { types.AddRange(tmp); } tmp = addIn.GetTableTypes(null); if (tmp != null && tmp.Length != 0) { types.AddRange(tmp); } tmp = addIn.GetPropertyTypes(null); if (tmp != null && tmp.Length != 0) { types.AddRange(tmp); } tmp = addIn.GetExtraTypes(null); if (tmp != null && tmp.Length != 0) { types.AddRange(tmp); } }
protected override IEnumerable<KeyValuePair<string, object>> GetClientVariables(HttpContext context) { var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "title", title = CRMDealResource.NameDeal, isHeader = false }, new { name = "client", title = CRMDealResource.ClientDeal, isHeader = false }, new { name = "description", title = CRMDealResource.DescriptionDeal, isHeader = false }, new { name = "bid_currency", title = CRMCommonResource.Currency, isHeader = false }, new { name = "bid_amount", title = CRMDealResource.DealAmount, isHeader = false }, new { name = "bid_type", title = CRMDealResource.BidType, isHeader = false }, new { name = "per_period_value", title = CRMDealResource.BidTypePeriod, isHeader = false }, new { name = "responsible", title = CRMDealResource.ResponsibleDeal, isHeader = false }, new { name = "expected_close_date", title = CRMJSResource.ExpectedCloseDate, isHeader = false }, new { name = "actual_close_date", title = CRMJSResource.ActualCloseDate, isHeader = false }, new { name = "deal_milestone", title = CRMDealResource.CurrentDealMilestone, isHeader = false }, new { name = "probability_of_winning", title = CRMDealResource.ProbabilityOfWinning + " %", isHeader = false } }.ToList(); var fieldsDescription = Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Opportunity); columnSelectorData.AddRange(fieldsDescription .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMDealResource.DealParticipants, isHeader = true }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 1), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 2), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 3), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 4), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 5), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 6), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 7), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 8), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 9), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 10), isHeader = false } }); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMDealResource.DealTags, isHeader = true }, new { name = "tag", title = CRMDealResource.DealTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 10), isHeader = false }, } ); yield return RegisterObject("columnSelectorData", columnSelectorData); }
protected void InitForContacts() { StartImportLabel = CRMContactResource.StartImport; ImportFromCSVStepOneHeaderLabel = CRMContactResource.ImportFromCSVStepOneHeader; ImportFromCSVStepTwoHeaderLabel = CRMContactResource.ImportFromCSVStepTwoHeader; ImportFromCSVStepOneDescriptionLabel = CRMContactResource.ImportFromCSVStepOneDescription; ImportFromCSVStepTwoDescriptionLabel = CRMContactResource.ImportFromCSVStepTwoDescription; ImportStartingPanelHeaderLabel = CRMContactResource.ImportStartingPanelHeader; ImportStartingPanelDescriptionLabel = CRMContactResource.ImportStartingPanelDescription; ImportStartingPanelButtonLabel = CRMContactResource.ImportStartingPanelButton; ImportImgSrc = WebImageSupplier.GetAbsoluteWebPath("import_contacts.png", ProductEntryPoint.ID); var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "firstName", title = CRMContactResource.FirstName, isHeader = false }, new { name = "lastName", title = CRMContactResource.LastName, isHeader = false }, new { name = "title", title = CRMContactResource.JobTitle, isHeader = false }, new { name = "companyName", title = CRMContactResource.CompanyName, isHeader = false }, new { name = "notes", title = CRMContactResource.About, isHeader = false } }.ToList(); foreach (ContactInfoType infoTypeEnum in Enum.GetValues(typeof(ContactInfoType))) foreach (Enum categoryEnum in Enum.GetValues(ContactInfo.GetCategory(infoTypeEnum))) { var localName = String.Format("contactInfo_{0}_{1}", infoTypeEnum, Convert.ToInt32(categoryEnum)); var localTitle = String.Format("{1} ({0})", categoryEnum.ToLocalizedString().ToLower(), infoTypeEnum.ToLocalizedString()); if (infoTypeEnum == ContactInfoType.Address) foreach (AddressPart addressPartEnum in Enum.GetValues(typeof(AddressPart))) columnSelectorData.Add(new { name = String.Format(localName + "_{0}", addressPartEnum), title = String.Format(localTitle + " {0}", addressPartEnum.ToLocalizedString().ToLower()), isHeader = false }); else columnSelectorData.Add(new { name = localName, title = localTitle, isHeader = false }); } columnSelectorData.AddRange(Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Contact).FindAll(customField => customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea || customField.FieldType == CustomFieldType.Heading) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMContactResource.ContactTags, isHeader = true }, new { name = "tag", title = CRMContactResource.ContactTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMContactResource.ContactTag, 10), isHeader = false }, }.ToList() ); Page.ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), String.Format(" var {0} = {1}; ", "columnSelectorData", JavaScriptSerializer.Serialize(columnSelectorData)), true); var privatePanel = (PrivatePanel)Page.LoadControl(PrivatePanel.Location); privatePanel.CheckBoxLabel = CRMContactResource.PrivatePanelCheckBoxLabelForContact; privatePanel.IsPrivateItem = false; var usersWhoHasAccess = new List<string> { CustomNamingPeople.Substitute<CRMCommonResource>("CurrentUser") }; privatePanel.UsersWhoHasAccess = usersWhoHasAccess; privatePanel.DisabledUsers = new List<Guid> { SecurityContext.CurrentAccount.ID }; privatePanel.HideNotifyPanel = true; _phPrivatePanel.Controls.Add(privatePanel); }
protected override IEnumerable<KeyValuePair<string, object>> GetClientVariables(HttpContext context) { var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "title", title = CRMCasesResource.CaseTitle, isHeader = false } }.ToList(); var fieldsDescription = Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Case); columnSelectorData.AddRange(fieldsDescription .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMCasesResource.CasesParticipants, isHeader = true }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 1), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 2), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 3), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 4), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 5), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 6), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 7), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 8), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 9), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 10), isHeader = false } }); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMCasesResource.CasesTag, isHeader = true }, new { name = "tag", title = CRMCasesResource.CasesTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 10), isHeader = false } } ); yield return RegisterObject("columnSelectorData", columnSelectorData); }
protected void InitForOpportunity() { StartImportLabel = CRMDealResource.StartImport; ImportFromCSVStepOneHeaderLabel = CRMDealResource.ImportFromCSVStepOneHeader; ImportFromCSVStepTwoHeaderLabel = CRMDealResource.ImportFromCSVStepTwoHeader; ImportFromCSVStepOneDescriptionLabel = CRMDealResource.ImportFromCSVStepOneDescription; ImportFromCSVStepTwoDescriptionLabel = CRMDealResource.ImportFromCSVStepTwoDescription; // // ImportFromCSVStepTwoDescription ImportStartingPanelHeaderLabel = CRMDealResource.ImportStartingPanelHeader; ImportStartingPanelDescriptionLabel = CRMDealResource.ImportStartingPanelDescription; ImportStartingPanelButtonLabel = CRMDealResource.ImportStartingPanelButton; ImportImgSrc = WebImageSupplier.GetAbsoluteWebPath("import-opportunities.png", ProductEntryPoint.ID); var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "title", title = CRMDealResource.NameDeal, isHeader = false }, new { name = "client", title = CRMDealResource.ClientDeal, isHeader = false }, new { name = "description", title = CRMDealResource.DescriptionDeal, isHeader = false }, new { name = "bid_currency", title = CRMCommonResource.Currency, isHeader = false }, new { name = "bid_amount", title = CRMDealResource.DealAmount, isHeader = false }, new { name = "bid_type", title = CRMDealResource.BidType, isHeader = false }, new { name = "per_period_value", title = CRMDealResource.BidTypePeriod, isHeader = false }, new { name = "responsible", title = CRMDealResource.ResponsibleDeal, isHeader = false }, new { name = "expected_close_date", title = CRMJSResource.ExpectedCloseDate, isHeader = false }, new { name = "actual_close_date", title = CRMJSResource.ActualCloseDate, isHeader = false }, new { name = "deal_milestone", title = CRMDealResource.CurrentDealMilestone, isHeader = false }, new { name = "probability_of_winning", title = CRMDealResource.ProbabilityOfWinning + " %", isHeader = false } }.ToList(); columnSelectorData.AddRange(Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Opportunity).FindAll(customField => customField.FieldType == CustomFieldType.Date || customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea || customField.FieldType == CustomFieldType.Heading) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMDealResource.DealParticipants, isHeader = true }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 1), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 2), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 3), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 4), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 5), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 6), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 7), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 8), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 9), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMDealResource.DealParticipant, 10), isHeader = false } }); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMDealResource.DealTags, isHeader = true }, new { name = "tag", title = CRMDealResource.DealTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMDealResource.DealTag, 10), isHeader = false }, } ); Page.ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), String.Format(" var {0} = {1}; ", "columnSelectorData", JavaScriptSerializer.Serialize(columnSelectorData)), true); var privatePanel = (PrivatePanel)Page.LoadControl(PrivatePanel.Location); privatePanel.CheckBoxLabel = CRMDealResource.PrivatePanelCheckBoxLabel; privatePanel.IsPrivateItem = false; var usersWhoHasAccess = new List<string> { CustomNamingPeople.Substitute<CRMCommonResource>("CurrentUser") }; privatePanel.UsersWhoHasAccess = usersWhoHasAccess; privatePanel.DisabledUsers = new List<Guid> { SecurityContext.CurrentAccount.ID }; privatePanel.HideNotifyPanel = true; _phPrivatePanel.Controls.Add(privatePanel); }
/// <summary> /// Renderiza um grupo. /// </summary> /// <param name="p_level">Nível do grupo atual.</param> /// <param name="p_parentgroupcolumn">Coluna do grupo pai.</param> /// <param name="p_parentgroupvalue">Valor do grupo pai.</param> /// <param name="p_data">Matriz de dados.</param> /// <param name="p_pageheight">Altura da página.</param> /// <param name="p_pagewidth">Largura da página.</param> /// <param name="p_datafieldfont">Fonte do campo de dados.</param> /// <param name="p_groupheaderfont">Fonte do cabeçalho de grupo.</param> /// <param name="p_groupfooterfont">Fonte do rodapé de grupo.</param> private void RenderGroup( int p_level, string p_parentgroupcolumn, string p_parentgroupvalue, System.Collections.Generic.List<System.Collections.Generic.List<PDFjet.NET.Cell>> p_data, float p_pageheight, float p_pagewidth, PDFjet.NET.Font p_datafieldfont, PDFjet.NET.Font p_groupheaderfont, PDFjet.NET.Font p_groupfooterfont, System.IO.StreamWriter p_writer ) { Spartacus.Reporting.Group v_group; string v_textrow; string v_text; int k, r, v_sectionrow; System.Data.DataRow rg, rb; v_group = (Spartacus.Reporting.Group)this.v_groups [p_level]; // percorrendo elementos do grupo rg = v_group.v_table.Rows[v_group.v_renderedrows]; while (v_group.v_renderedrows < v_group.v_table.Rows.Count && (v_group.v_level == this.v_groups.Count-1 || rg[p_parentgroupcolumn].ToString() == p_parentgroupvalue)) { // renderizando campos do cabecalho if (v_group.v_showheader) { for (v_sectionrow = 0; v_sectionrow < v_group.v_numrowsheader; v_sectionrow++) { v_textrow = ""; for (k = 0; k < v_group.v_headerfields.Count; k++) { if (((Spartacus.Reporting.Field)v_group.v_headerfields[k]).v_row == v_sectionrow) { if (((Spartacus.Reporting.Field)v_group.v_headerfields[k]).v_column != "") v_text = ((Spartacus.Reporting.Field)v_group.v_headerfields[k]).Format(rg[((Spartacus.Reporting.Field)v_group.v_headerfields[k]).v_column].ToString()); else v_text = ""; v_textrow += v_text.Replace(';', ',').Replace('\n', ' ').Replace('\r', ' ') + ";"; } } p_writer.WriteLine(v_textrow); } p_data.AddRange(v_group.v_headertemplate); } if (v_group.v_level == 0) { // renderizando dados do grupo r = 0; rb = this.v_rendertable.Rows[this.v_renderedrows]; while (this.v_renderedrows < this.v_rendertable.Rows.Count && rb[v_group.v_column].ToString() == rg[v_group.v_column].ToString() && (v_group.v_level == this.v_groups.Count-1 || rb[p_parentgroupcolumn].ToString() == p_parentgroupvalue)) { for (v_sectionrow = 0; v_sectionrow < this.v_numrowsdetail; v_sectionrow++) { v_textrow = ""; for (k = 0; k < this.v_fields.Count; k++) { if (((Spartacus.Reporting.Field)this.v_fields[k]).v_row == v_sectionrow) { v_text = ((Spartacus.Reporting.Field)this.v_fields[k]).Format(rb[((Spartacus.Reporting.Field)this.v_fields[k]).v_column].ToString()); v_textrow += v_text.Replace(';', ',').Replace('\n', ' ').Replace('\r', ' ') + ";"; } } p_writer.WriteLine(v_textrow); } if (r % 2 == 0) p_data.AddRange(this.v_detaileventemplate); else p_data.AddRange(this.v_detailoddtemplate); r++; this.v_perc += v_inc; this.v_renderedrows++; this.v_progress.FireEvent("Spartacus.Reporting.Report", "ExportPDF", this.v_perc, "Relatorio " + this.v_reportid.ToString() + ": linha " + this.v_renderedrows.ToString() + " de " + this.v_table.Rows.Count.ToString()); if (this.v_renderedrows < this.v_rendertable.Rows.Count) rb = this.v_rendertable.Rows[this.v_renderedrows]; } } else { this.RenderGroup( p_level - 1, v_group.v_column, rg[v_group.v_column].ToString(), p_data, p_pageheight, p_pagewidth, p_datafieldfont, p_groupheaderfont, p_groupfooterfont, p_writer ); } // renderizando campos do rodape if (v_group.v_showfooter) { for (v_sectionrow = 0; v_sectionrow < v_group.v_numrowsfooter; v_sectionrow++) { v_textrow = ""; for (k = 0; k < v_group.v_footerfields.Count; k++) { if (((Spartacus.Reporting.Field)v_group.v_footerfields[k]).v_row == v_sectionrow) { if (((Spartacus.Reporting.Field)v_group.v_footerfields[k]).v_column != "") v_text = ((Spartacus.Reporting.Field)v_group.v_footerfields[k]).Format(rg[((Spartacus.Reporting.Field)v_group.v_footerfields[k]).v_column].ToString()); else v_text = ""; v_textrow += v_text.Replace(';', ',').Replace('\n', ' ').Replace('\r', ' ') + ";"; } } p_writer.WriteLine(v_textrow); } p_data.AddRange(v_group.v_footertemplate); } v_group.v_renderedrows++; if (v_group.v_renderedrows < v_group.v_table.Rows.Count) rg = v_group.v_table.Rows[v_group.v_renderedrows]; } }
protected void InitForCase() { StartImportLabel = CRMCasesResource.StartImport; ImportFromCSVStepOneHeaderLabel = CRMCasesResource.ImportFromCSVStepOneHeader; ImportFromCSVStepTwoHeaderLabel = CRMCasesResource.ImportFromCSVStepTwoHeader; ImportFromCSVStepOneDescriptionLabel = CRMCasesResource.ImportFromCSVStepOneDescription; ImportFromCSVStepTwoDescriptionLabel = CRMCasesResource.ImportFromCSVStepTwoDescription; ImportStartingPanelHeaderLabel = CRMCasesResource.ImportStartingPanelHeader; ImportStartingPanelDescriptionLabel = CRMCasesResource.ImportStartingPanelDescription; ImportStartingPanelButtonLabel = CRMCasesResource.ImportStartingPanelButton; ImportImgSrc = WebImageSupplier.GetAbsoluteWebPath("import-cases.png", ProductEntryPoint.ID); var columnSelectorData = new[] { new { name = String.Empty, title = CRMContactResource.NoMatchSelect, isHeader = false }, new { name = "-1", title = CRMContactResource.DoNotImportThisField, isHeader = false }, new { name = String.Empty, title = CRMContactResource.GeneralInformation, isHeader = true }, new { name = "title", title = CRMCasesResource.CaseTitle, isHeader = false } }.ToList(); columnSelectorData.AddRange(Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(EntityType.Case).FindAll(customField => customField.FieldType == CustomFieldType.Date || customField.FieldType == CustomFieldType.TextField || customField.FieldType == CustomFieldType.TextArea || customField.FieldType == CustomFieldType.Heading) .ConvertAll(customField => new { name = "customField_" + customField.ID, title = customField.Label.HtmlEncode(), isHeader = customField.FieldType == CustomFieldType.Heading })); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMCasesResource.CasesParticipants, isHeader = true }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 1), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 2), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 3), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 4), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 5), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 6), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 7), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 8), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 9), isHeader = false }, new { name = "member", title = String.Format("{0} {1}", CRMCasesResource.CasesParticipant, 10), isHeader = false } }); columnSelectorData.AddRange( new[] { new { name = String.Empty, title = CRMCasesResource.CasesTag, isHeader = true }, new { name = "tag", title = CRMCasesResource.CasesTagList, isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 1), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 2), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 3), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 4), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 5), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 6), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 7), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 8), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 9), isHeader = false }, new { name = "tag", title = String.Format("{0} {1}", CRMCasesResource.CasesTag, 10), isHeader = false } } ); Page.ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), String.Format(" var {0} = {1}; ", "columnSelectorData", JavaScriptSerializer.Serialize(columnSelectorData)), true); var privatePanel = (PrivatePanel)Page.LoadControl(PrivatePanel.Location); privatePanel.CheckBoxLabel = CRMCasesResource.PrivatePanelCheckBoxLabel; privatePanel.IsPrivateItem = false; var usersWhoHasAccess = new List<string> { CustomNamingPeople.Substitute<CRMCommonResource>("CurrentUser") }; privatePanel.UsersWhoHasAccess = usersWhoHasAccess; privatePanel.DisabledUsers = new List<Guid> { SecurityContext.CurrentAccount.ID }; privatePanel.HideNotifyPanel = true; _phPrivatePanel.Controls.Add(privatePanel); }