예제 #1
0
        public static YrsMosDate StringToYrsMosDate(string str)
        {
            string value = String.Empty;

            if (String.IsNullOrEmpty(str))
            {
                return(null);
            }

            string[] stNum;
            string[] seperator = { "yrs", "mos" };
            if (!str.Contains("yrs"))
            {
                return(null);
            }
            stNum = str.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < stNum.Length; i++)
            {
                stNum[i] = stNum[i].Trim();
                if (stNum[i].Length == 1)
                {
                    stNum[i] = "0" + stNum[i];
                }
                value += stNum[i];
            }

            if (StringExt.IsNumeric(value))
            {
                YrsMosDate estLife = new YrsMosDate().SetYrsMosDate(value);
                return(estLife);
            }
            return(null);
        }
예제 #2
0
 /// <summary>
 /// Copies values from another bpYrsMosDate object
 /// </summary>
 /// <param name="right"></param>
 public void copyFrom(YrsMosDate right)
 {
     Years  = right.Years;
     Months = right.Months;
 }
예제 #3
0
 public YrsMosDate(YrsMosDate dateObject)
 {
     this.Years  = dateObject.Years;
     this.Months = dateObject.Months;
 }