コード例 #1
0
 public static bool IsValidGregorianDate(int intGCDay, int intGCMonth, int intGCYear)
 {
     if (EthiopicDateTime.IsValidRange(intGCYear, 1900, 9998) == true)
     {
         if (EthiopicDateTime.IsValidRange(intGCMonth, 1, 12) == true)
         {
             if (EthiopicDateTime.IsValidRange(intGCDay, 1, DateTime.DaysInMonth(intGCYear, intGCMonth)) == true)
             {
                 return(true);
             }
             else
             {
                 EthiopicDateTime.ErrorMessage = "ቀን ከ1 እስከ " + DateTime.DaysInMonth(intGCYear, intGCMonth) + " ውስጥ መሆን አለበት";
                 return(false);
             }
         }
         else
         {
             EthiopicDateTime.ErrorMessage = "ወር ከ1 እስከ 12 ውስጥ መሆን አለበት";
             return(false);
         }
     }
     else
     {
         EthiopicDateTime.ErrorMessage = "የአውሮፓውያን አመት ከ1900 እስከ 9998 ውስጥ መሆን አለበት";
         return(false);
     }
 }
コード例 #2
0
        public static bool IsValidEthiopicDate(int intEthDay, int intEthMonth, int intEthYear)
        {
            if (EthiopicDateTime.IsValidRange(intEthDay, 1, 30) == true)
            {
                if (EthiopicDateTime.IsValidRange(intEthMonth, 1, 13) == true)
                {
                    if (EthiopicDateTime.IsValidRange(intEthYear, 1900, 9991))
                    {
                        if (EthiopicDateTime.IsETLeapYear(intEthYear) == true)
                        {
                            if (intEthMonth == 13)
                            {
                                if (EthiopicDateTime.IsValidRange(intEthDay, 1, 6) == true)
                                {
                                }
                                else
                                {
                                    EthiopicDateTime.ErrorMessage = "ቀን ከ1 እስከ 6 ውስጥ መሆን አለበት";
                                    return(false);
                                }
                            }
                        }
                        else
                        {
                            if (intEthMonth == 13)
                            {
                                if (EthiopicDateTime.IsValidRange(intEthDay, 1, 5) == true)
                                {
                                }
                                else
                                {
                                    EthiopicDateTime.ErrorMessage = "ቀን ከ1 እስከ 5 ውስጥ መሆን አለበት";
                                    return(false);
                                }
                            }
                        }
                    }
                    else
                    {
                        EthiopicDateTime.ErrorMessage = "አመት ከ1900 እስከ 9991 ውስጥ መሆን አለበት";
                        return(false);
                    }
                }
                else
                {
                    EthiopicDateTime.ErrorMessage = "ወር ከ1 እስከ 13 ውስጥ መሆን አለበት";
                    return(false);
                }
            }
            else
            {
                EthiopicDateTime.ErrorMessage = "ቀን ከ1 እስከ 30 ውስጥ መሆን አለበት";
                return(false);
            }

            return(true);
        }