/// <summary> /// Function used to update the text value of the date, returns errorcodes depending upon string settings /// </summary> public ErrorCodes updateValue(string thisTime) { FormFunctions formFunctions = new FormFunctions(); if ((!bAllowNull) && (formFunctions.IsNull(thisTime))) { return ErrorCodes.ValueMustExist; } if (!formFunctions.IsNull(thisTime)) { if (!formFunctions.TimeIsValid(thisTime)) { return ErrorCodes.ValueMustBeAValidTime; } } this.sValue = thisTime; return ErrorCodes.Success; }
/// <summary> /// Function used to update the text value of the date, returns errorcodes depending upon string settings /// </summary> public ErrorCodes updateValue(string thisString) { FormFunctions formFunctions = new FormFunctions(); if ((!bAllowNull) && (formFunctions.IsNull(thisString))) { return ErrorCodes.ValueMustExist; } if (!formFunctions.IsNull(thisString)) { string delim = @" "; string[] mySplit = thisString.Split(delim.ToCharArray()); if (mySplit.Length > 2) { return ErrorCodes.ValueMustBeAValidDateTime; } string thisDate = mySplit[0].ToString(); string thisTime = mySplit[1].ToString(); if (!formFunctions.DateIsValid(thisDate)) { return ErrorCodes.ValueMustBeAValidDateTime; } if (!formFunctions.TimeIsValid(thisTime)) { return ErrorCodes.ValueMustBeAValidDateTime; } } this.sValue = thisString; return ErrorCodes.Success; }