コード例 #1
0
 /// <summary>
 /// This method will calculate the age of the user if tribute is memorial
 /// </summary>
 /// <param name="Date1">This is datetime object which is date of Birth</param>
 /// <param name="Date2">This is datetime object which is date of Death</param>
 /// <returns>This will return the </returns>
 private string CalculateAge(Nullable<DateTime> Date1, Nullable<DateTime> Date2)
 {
     try
     {
         if ((Date1 != null) && (Date1.ToString() != "") && (Date2 != null) && (Date2.ToString() != ""))
         {
             Stories story = new Stories();
             story.Date1 = Date1;
             story.Date2 = Date2;
            TributesPortal.ResourceAccess.StoryResource sr=new StoryResource ();
            story =sr.ClaculateAge(story);
            if (story.Age != "0")
            return story.Age;
            else
            return "<1";
         }
         else
         {
             return "0";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }