|
C#
public static bool BeforeEdit(System.Web.UI.Page Page,
IDictionary e)
{
string strOrderDate = (string)e["OrderDate"];
string strRequiredDate = (string)e["RequiredDate"];
if (!string.IsNullOrEmpty(strOrderDate) &&
!string.IsNullOrEmpty(strRequiredDate))
{
DateTime orderDate = DateTime.Parse(strOrderDate);
DateTime requiredDate =
DateTime.Parse(strRequiredDate);
if (orderDate > requiredDate)
{
Page.Response.Write("<br>Error: OrderDate is more that
RequiredDate");
return false;
}
return true;
}
//return true if you like to proceed
with saving record
//return false in other case
return false;
} // BeforeEdit
|