Exemplo n.º 1
0
 /// <summary>
 /// روزهای ماه را برمیگرداند
 /// </summary>
 /// <param name="personId"></param>
 /// <param name="year"></param>
 /// <param name="month"></param>
 /// <returns></returns>
 public IList <DayDateProxy> GetDayList(decimal personId, int year, int month)
 {
     try
     {
         IList <DayDateProxy> result = new List <DayDateProxy>();
         DateTime             fromDate, toDate;
         if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
         {
             int endOfMonth = Utility.GetEndOfPersianMonth(year, month);
             fromDate = Utility.ToMildiDate(String.Format("{0}/{1}/{2}", year, month, 1));
             toDate   = Utility.ToMildiDate(String.Format("{0}/{1}/{2}", year, month, endOfMonth));
         }
         else
         {
             int endOfMonth = Utility.GetEndOfMiladiMonth(year, month);
             fromDate = new DateTime(year, month, 1);
             toDate   = new DateTime(year, month, endOfMonth);
         }
         int counter = 1;
         for (DateTime day = fromDate; day <= toDate; day = day.AddDays(1))
         {
             DayDateProxy proxy = new DayDateProxy();
             proxy.RowID = counter;
             counter++;
             proxy.Date = Utility.ToString(day);
             if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
             {
                 proxy.TheDate = Utility.ToPersianDate(day);
                 proxy.DayName = PersianDateTime.GetPershianDayName(day);
             }
             else
             {
                 proxy.TheDate = Utility.ToString(day);
                 proxy.DayName = PersianDateTime.GetEnglishDayName(day);
             }
             result.Add(proxy);
         }
         return(result);
     }
     catch (Exception ex)
     {
         LogException(ex, "BTraffic", "GetDayList");
         throw ex;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// نام فارسی روز هفته تاریخ وارد شده را برمی گرداند
 /// </summary>
 /// <param name="Date"></param>
 /// <returns></returns>
 public string ShamsiDayName(DateTime Date)
 {
     return(PersianDateTime.GetPershianDayName(Date));
 }