Example #1
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    protected void DateValidate_ServerValidate(Object source, ServerValidateEventArgs e)
    {
        try
        {
            if (source.Equals(cvcalStartDate))
            {
                if (string.IsNullOrEmpty(calStartdate.getDate()))
                {
                    General.ValidMsg(this, ref cvcalStartDate, false, "Start Date is required", "تاريخ البداية مطلوب");
                    e.IsValid = false;
                    return;
                }

                if (!string.IsNullOrEmpty(calStartdate.getDate()) && !String.IsNullOrEmpty(calEnddate.getDate()))
                {
                    int iStartDate = DateFun.ConvertDateTimeToInt("Gregorian", calStartdate.getDate());
                    int iEndDate   = DateFun.ConvertDateTimeToInt("Gregorian", calEnddate.getDate());
                    if (iStartDate > iEndDate)
                    {
                        General.ValidMsg(this, ref cvcalStartDate, true, "start date more than end date!", "تاريخ الإصدار أكبر من تاريخ الإنتهاء");
                        e.IsValid = false;
                        return;
                    }
                }
            }
        }
        catch { e.IsValid = false; }
    }
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 protected void DateValidate_ServerValidate(Object source, ServerValidateEventArgs e)
 {
     try
     {
         if (source.Equals(cvCalStartDateEmpty))
         {
             if (String.IsNullOrEmpty(calStartDate.getDate()))
             {
                 e.IsValid = false;
             }
             else
             {
                 e.IsValid = true;
             }
         }
         else if (source.Equals(cvCompareDates))
         {
             if (!String.IsNullOrEmpty(calStartDate.getDate()) && !String.IsNullOrEmpty(calEndDate.getDate()))
             {
                 int iStartDate = DateFun.ConvertDateTimeToInt(FormSession.DateType, calStartDate.getDate());
                 int iEndDate   = DateFun.ConvertDateTimeToInt(FormSession.DateType, calEndDate.getDate());
                 if (iStartDate > iEndDate)
                 {
                     e.IsValid = false;
                 }
                 else
                 {
                     e.IsValid = true;
                 }
             }
         }
     }
     catch { e.IsValid = false; }
 }
Example #3
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    protected void BirthDateValidate_ServerValidate(Object source, ServerValidateEventArgs e)
    {
        try
        {
            if (source.Equals(cvcalBirthDate))
            {
                if (string.IsNullOrEmpty(CalBirthDate.getDate()))
                {
                    General.ValidMsg(this, ref cvcalBirthDate, false, "Birth Date is required", "تاريخ الميلاد مطلوب");
                    e.IsValid = false;
                    return;
                }
                else
                {
                    int iStartDate = DateFun.ConvertDateTimeToInt(FormSession.DateType, CalBirthDate.getDate());
                    int iEndDate   = DateFun.ConvertDateTimeToInt(FormSession.DateType, (DateFun.ToAnyFormat(FormSession.DateType, DateTime.Now)));
                    General.ValidMsg(this, ref cvcalBirthDate, true, "Birthday greater than today's date", "تاريخ الميلاد أكبر من تاريخ اليوم");

                    if (iStartDate > iEndDate)
                    {
                        e.IsValid = false;
                    }
                }
            }
        }
        catch { e.IsValid = false; }
    }
Example #4
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    protected void HireDateValidate_ServerValidate(Object source, ServerValidateEventArgs e)
    {
        try
        {
            if (source.Equals(cvCalHireDate))
            {
                if (!string.IsNullOrEmpty(CalHireDate.getDate()))
                {
                    int iStartDate = DateFun.ConvertDateTimeToInt(FormSession.DateType, CalHireDate.getDate());
                    int iEndDate   = DateFun.ConvertDateTimeToInt(FormSession.DateType, (DateFun.ToAnyFormat(FormSession.DateType, DateTime.Now)));
                    General.ValidMsg(this, ref cvCalHireDate, true, "Hire date greater than today's date", "تاريخ التعيين أكبر من تاريخ اليوم");

                    if (iStartDate > iEndDate)
                    {
                        e.IsValid = false;
                    }
                }
            }
        }
        catch { e.IsValid = false; }
    }