- ToolTipMvc.zip
- ToolTipMvc
- packages
- EntityFramework.4.1.10331.0
- EntityFramework.4.1.10331.0.nupkg
- lib
- jQuery.1.5.1
- Content
- Scripts
- jQuery.1.5.1.nupkg
- jQuery.UI.Combined.1.8.11
- Content
- Content
- themes
- base
- Scripts
- jQuery.UI.Combined.1.8.11.nupkg
- jQuery.Validation.1.8.0
- Content
- Scripts
- jQuery.Validation.1.8.0.nupkg
- jQuery.vsdoc.1.5.1
- Content
- Scripts
- jQuery.vsdoc.1.5.1.nupkg
- Modernizr.1.7
- Content
- Scripts
- Modernizr.1.7.nupkg
- repositories.config
- ToolTipMvc.sln
- ToolTipMvc
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ToolTipMvc.Models
{
public class ToolTipMvcModel
{
ToolTipMvcModel(){}
const string FIELD_DESC_DLMTR = "$_$_$";
static string[] splitParam = new string[] { FIELD_DESC_DLMTR };
public string Field { get; set; }
public string Description { get; set; }
public string Id { get; set; }
private ToolTipMvcModel(string id) { Id = id; }
public static ToolTipMvcModel GetToolTip(string toolTipId)
{
ToolTipMvcModel item = new ToolTipMvcModel(toolTipId);
System.Resources.ResourceSet set = ToolTipMvc.TooTipMvcResource.ResourceManager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture, true, true);
string strRes = set.GetString(toolTipId);
bool bfound = false;
if(!string.IsNullOrEmpty(strRes))
{
string[] strData = strRes.Split(splitParam,StringSplitOptions.None);
if(strData.Length >= 2)
{
try
{
item.Field = strData[0].Split(new string[] { "==" }, StringSplitOptions.None).Where(x => string.Compare("field", x.Trim(), true) != 0).First();
item.Description = strData[1].Split(new string[] { "==" }, StringSplitOptions.None).Where(x => string.Compare("description", x.Trim(), true) != 0).First();
bfound = true;
}
catch (Exception) { }
}
}
if (!bfound)
{
item.Field = "Error";
item.Description = "Sorry Tool Tip for the selected year not found!";
}
return item;
}
public static List<ToolTipMvcModel> GetToolTip(params string[] toolTipIds)
{
List<ToolTipMvcModel> items = new List<ToolTipMvcModel>();
items.AddRange(toolTipIds.Select(s=>GetToolTip(s)));
return items;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Started as C++ developer later fell in love with .NET and moved to .NET. I still use Notepad to type in C# console apps. for learning unknown areas. The software business areas I worked are diversified - Gas, Truck Leasing, Telecom, many State and Federal projects.