Esempio n. 1
0
        /// <summary>
        /// ToLockMsg
        /// </summary>
        /// <param name="lockItem">thisLockItem</param>
        /// <returns>string</returns>
        public static string ToLockMsg(this LockItem lockItem)
        {
            if (null == lockItem)
            {
                GlobalDefinition.LoggerWrapper.LogDevError("[ToLockMsg][lockItem == null]");
                return(string.Empty);
            }

            GlobalDefinition.LoggerWrapper.LogDevWarning("[ToLockMsg][Comment:" + lockItem.Comment + "]");

            var lockTip = GlobalDefinition.ToLocalLanguge("UID_PA_Item_LockedInfo");

            if (string.IsNullOrEmpty(lockTip))
            {
                GlobalDefinition.LoggerWrapper.LogDevWarning("[ToLockMsg][lockTip is empty]");
                return(string.Empty);
            }

            if (string.IsNullOrEmpty(lockItem.Comment))
            {
                GlobalDefinition.LoggerWrapper.LogDevWarning("[ToLockMsg][lockItem.Comment is empty]");
                return(lockTip);
            }

            var c = GlobalDefinition.ToLocalLanguge(lockItem.Comment);

            if (string.IsNullOrEmpty(c))
            {
                GlobalDefinition.LoggerWrapper.LogDevWarning("[ToLockMsg][not find resource:" + lockItem.Comment + "]");
                return(lockTip);
            }

            return(string.Format("{0} ({1}...)", lockTip, c));
        }
Esempio n. 2
0
 /// <summary>
 /// unit to local language
 /// </summary>
 /// <returns></returns>
 public string AgeUnitToL10nString()
 {
     GlobalDefinition.LoggerWrapper.LogTraceInfo("public string AgeUnitToL10nString() start");
     if (null != AgeUnit)
     {
         return(GlobalDefinition.ToLocalLanguge("UID_PA_AgeUnit_" + AgeUnit.ToString()));
     }
     GlobalDefinition.LoggerWrapper.LogTraceInfo("public string AgeUnitToL10nString() end");
     return(string.Empty);
 }
Esempio n. 3
0
        public string ToLocalCmWithUnitString()
        {
            if (string.IsNullOrEmpty(this.Num))
            {
                return(string.Empty);
            }

            var temp = ConvertPatientHeight(this.Num);

            if (this.Unit == HeightUnit.Inch)
            {
                return(Math.Round(temp * InchToCm, 2).ToString(CultureInfo.InvariantCulture) + GlobalDefinition.ToLocalLanguge("UID_PR_PatientHeight_cm"));
            }
            else
            {
                return(Math.Round(temp, 2).ToString(CultureInfo.InvariantCulture) + GlobalDefinition.ToLocalLanguge("UID_PR_PatientHeight_cm"));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// ToLocalKgWithUnitString
        /// </summary>
        /// <returns>string</returns>
        public string ToLocalKgWithUnitString()
        {
            if (string.IsNullOrEmpty(this.Num))
            {
                return(string.Empty);
            }

            var temp = SetPatientWeight(this.Num);

            if (this.Unit == WeightUnit.Lb)
            {
                return(Math.Round(temp * LbToKg, 2).ToString(CultureInfo.InvariantCulture) +
                       GlobalDefinition.ToLocalLanguge("UID_PR_PatientWeight_kg"));
            }
            else
            {
                return(Math.Round(temp, 2) + GlobalDefinition.ToLocalLanguge("UID_PR_PatientWeight_kg"));
            }
        }
Esempio n. 5
0
        /// <summary>
        /// parse a multi-language string to unit
        /// </summary>
        /// <param name="unit"></param>
        /// <returns></returns>
        public static AgeUnit?GetAgeUnitFromNls(string unit)
        {
            if (unit == GlobalDefinition.ToLocalLanguge("UID_PA_AgeUnit_Year"))
            {
                return(Enumeration.AgeUnit.Year);
            }

            if (unit == GlobalDefinition.ToLocalLanguge("UID_PA_AgeUnit_Month"))
            {
                return(Enumeration.AgeUnit.Month);
            }

            if (unit == GlobalDefinition.ToLocalLanguge("UID_PA_AgeUnit_Week"))
            {
                return(Enumeration.AgeUnit.Week);
            }

            if (unit == GlobalDefinition.ToLocalLanguge("UID_PA_AgeUnit_Day"))
            {
                return(Enumeration.AgeUnit.Day);
            }
            return(null);
        }