private JULDATE_CURRENCY InternJulDatLngToJulDateCur(JULDATE_LONG vtypJulDateLng) { JULDATE_CURRENCY dtypJulDateCur = default(JULDATE_CURRENCY); dtypJulDateCur.jdCompl = Conversions.ToDecimal(vtypJulDateLng.jdDays + "," + vtypJulDateLng.jdTime); return(dtypJulDateCur); }
private decimal InternGetCurrencyDate(int vlngDays, int vlngTime) { if (vlngTime < 0) { Information.Err().Raise(50000, "UtilTime", "Zeit liegt außerhalb des Wertebereichs (<00:00:00:000)."); } else if (vlngTime > 86399999) { Information.Err().Raise(50000, "UtilTime", "Zeit liegt außerhalb des Wertebereichs (>23:59:59:999)."); } else { JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG); dtypJulDateLng.jdTime = vlngTime; if (vlngDays >= 0) { dtypJulDateLng.jdDays = vlngDays; JULDATE_CURRENCY dtypJulDateCur = InternJulDatLngToJulDateCur(dtypJulDateLng); return(dtypJulDateCur.jdCompl); } Information.Err().Raise(50000, "UtilTime", "Tagesdatum außerhalb des Wertebereichs."); } decimal InternGetCurrencyDate = default(decimal); return(InternGetCurrencyDate); }
private JULDATE_LONG InternGetJulSplit(decimal vcurJulDate) { JULDATE_CURRENCY dtypJulDateCur = default(JULDATE_CURRENCY); dtypJulDateCur.jdCompl = vcurJulDate; return(InternJulDatCurToJulDateLng(dtypJulDateCur)); }
public decimal MakeJulTime(short nvintHour = 0, short nvintMinute = 0, short nvintSecond = 0, short nvintMilliSec = 0) { bool flag = true; if (flag == nvintHour < 0 || flag == nvintHour > 575) { Information.Err().Raise(50000, "UtilTime", "Der Stundenwert überschreitet den Gültigkeitsbereich."); } else if (flag == nvintMinute < 0 || flag == nvintMinute > 59) { Information.Err().Raise(50000, "UtilTime", "Der Minutenwert überschreitet den Gültigkeitsbereich."); } else if (flag == nvintSecond < 0 || flag == nvintSecond > 59) { Information.Err().Raise(50000, "UtilTime", "Der Sekundenwert überschreitet den Gültigkeitsbereich."); } else { if (flag != nvintMilliSec < 0 && flag != nvintMilliSec > 999) { JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG); dtypJulDateLng.jdDays = 0; dtypJulDateLng.jdTime = InternCalcJulTime(nvintHour, nvintMinute, nvintSecond, nvintMilliSec); JULDATE_CURRENCY dtypJulDateCur = InternJulDatLngToJulDateCur(dtypJulDateLng); return(dtypJulDateCur.jdCompl); } Information.Err().Raise(50000, "UtilTime", "Der Millisekundenwert überschreitet den Gültigkeitsbereich."); } decimal MakeJulTime = default(decimal); return(MakeJulTime); }
public decimal MakeJulDate(short vintDay, short vintMonth, short vintYear, short nvintHour = 0, short nvintMinute = 0, short nvintSecond = 0, short nvintMilliSec = 0) { string dstrRefString = Support.Format(vintDay, "00\\.") + Support.Format(vintMonth, "00\\.") + Support.Format(vintYear, "0000\\ ") + Support.Format(nvintHour, "00\\:") + Support.Format(nvintMinute, "00\\:") + Support.Format(nvintSecond, "00"); string dstrInpString = Conversions.ToString(DateTime.FromOADate(DateAndTime.DateSerial(vintYear, vintMonth, vintDay).ToOADate() + DateAndTime.TimeSerial(nvintHour, nvintMinute, nvintSecond).ToOADate())); if (Operators.CompareString(Support.Format(dstrInpString, "dd\\.mm\\.yyyy\\ hh\\:nn\\:ss"), dstrRefString, TextCompare: false) != 0) { Information.Err().Raise(50000, "UtilTime", "Der Datumswert ist ungültig."); } else { if (!(nvintMilliSec < 0 || nvintMilliSec > 999)) { JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG); dtypJulDateLng.jdDays = InternGetJulDays(vintDay, vintMonth, vintYear); dtypJulDateLng.jdTime = InternCalcJulTime(nvintHour, nvintMinute, nvintSecond, nvintMilliSec); JULDATE_CURRENCY dtypJulDateCur = InternJulDatLngToJulDateCur(dtypJulDateLng); return(dtypJulDateCur.jdCompl); } Information.Err().Raise(50000, "UtilTime", "Millisekunden außerhalb des Gültigkeitsbereiches."); } decimal MakeJulDate = default(decimal); return(MakeJulDate); }
private JULDATE_LONG InternJulDatCurToJulDateLng(JULDATE_CURRENCY vtypJulDateCur) { string[] dastrValues = vtypJulDateCur.jdCompl.ToString().Split(','); checked { JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG); dtypJulDateLng.jdDays = (int)Conversions.ToLong(dastrValues[0]); dtypJulDateLng.jdTime = (int)Conversions.ToLong(dastrValues[1]); return(dtypJulDateLng); } }