public string GetClassEndDate(object eval)
{
string retVal = ""
if(Convert.IsDBNull(eval)) return retval;
int classID = Convert.ToInt32(eval);
Datatable data = GetData("SELECT classID, EndDate FROM classes where classId = " + classID);
List
var result = list.Where(row=> row["ClassID"].Equals(classID));
foreach ( var datarow in result){
retVal = dataRow["EndDate"].ToString();
}
return Convert.ToDateTime(retVal).ToShortDateTime();
}
How can I call the result (end date value) of this function to use in another function where I disable the EDIT button if the class end date is 3 days previous from today. In other words, if it has been 3 days since the class end date, I need to disable that EDIT button for that row in the listview. I am stuck, any help please! Thanks.
Replies
Know the answer? Post it — somebody with the same question will find it here.