Das Unterschriftenfeld befindet sich jetzt unter den Buttons und ist größer. Ca. 80% des Browserfensters.
Der Kommentar wird jetzt im Klientenfeld angezeigt.
64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWoPlanerMobil.Util
|
|
{
|
|
public class MobileUtils
|
|
{
|
|
public static bool IsBillable(long serviceDescriptionOid, List<ServiceDescriptionDC> serviceDescriptions)
|
|
{
|
|
var description = serviceDescriptions.FirstOrDefault(f => f.ServiceDescriptionOid.Equals(serviceDescriptionOid));
|
|
|
|
return description != null && description.Category.IsBillable;
|
|
}
|
|
|
|
internal static decimal? GetDecimalValue(decimal? decValue, int decimalPlaces)
|
|
{
|
|
return decValue != null ? Math.Round(decValue.Value, decimalPlaces, MidpointRounding.AwayFromZero) : decValue;
|
|
}
|
|
|
|
public static decimal? GetDecimalValueWithMaxDecimal(decimal? decValue, int maxDecimal)
|
|
{
|
|
if(decValue != null)
|
|
{
|
|
var decValueStr = decValue.ToString();
|
|
decValueStr = decValueStr.Replace(".", ",");
|
|
|
|
while(decValueStr.Length > 0 && decValueStr.IndexOf(",") > 0 && (decValueStr.EndsWith("0") || decValueStr.EndsWith(",")))
|
|
{
|
|
decValueStr = decValueStr.Substring(0, decValueStr.Length - 1);
|
|
}
|
|
|
|
var decCount = 0;
|
|
if(decValueStr.IndexOf(",") >= 0)
|
|
{
|
|
decCount = decValueStr.Length - decValueStr.IndexOf(",") - 1;
|
|
}
|
|
|
|
if(maxDecimal >= 0 && maxDecimal < decCount)
|
|
{
|
|
decCount = maxDecimal;
|
|
}
|
|
|
|
return GetDecimalValue(decValue, decCount);
|
|
}
|
|
|
|
return decValue;
|
|
}
|
|
|
|
public static string TextToHtml(string text)
|
|
{
|
|
var result = HttpUtility.HtmlEncode(text);
|
|
|
|
result = result.Replace("\r\n", "\r");
|
|
result = result.Replace("\n", "\r");
|
|
result = result.Replace("\r", "<br />\r\n");
|
|
result = result.Replace(" ", " ");
|
|
|
|
return result;
|
|
}
|
|
}
|
|
} |