Ejemplo n.º 1
0
 public static object CALIsBizDay(string calName, int serialNumber)
 {
     try
     {
         DateUtilities.CALCalendar cal     = new DateUtilities.CALCalendar(calName);
         DateUtilities.CALDate     calDate = new DateUtilities.CALDate(serialNumber);
         return(cal.IsBizDay(calDate));
     }
     catch (Exception e)
     {
         return(Utilities.ExcelRangeErrorString(e));
     }
 }
Ejemplo n.º 2
0
 public static object CALDateAdvance(string calName, int serialNumber, string periodrepr, object covrepr, object endOfMonth)
 {
     try
     {
         //if (ExcelDnaUtil.IsInFunctionWizard())
         //    return "!!! In FunctionWizard";
         DateUtilities.CALCalendar cal     = new DateUtilities.CALCalendar(calName);
         DateUtilities.CALDate     calDate = new DateUtilities.CALDate(serialNumber);
         string cStr = Utilities.Check(covrepr, "Following");
         bool   eom  = Utilities.Check(endOfMonth, false);
         return(cal.DateAdvance(calDate, periodrepr, cStr, eom).SerialNumber());
     }
     catch (Exception e)
     {
         return(Utilities.ExcelRangeErrorString(e));
     }
 }
Ejemplo n.º 3
0
 public static object CALBizDatesList(string calName, int start, int end)
 {
     try
     {
         //if (ExcelDnaUtil.IsInFunctionWizard())
         //    return "!!! In FunctionWizard";
         DateUtilities.CALCalendar cal       = new DateUtilities.CALCalendar(calName);
         DateUtilities.CALDate     beginDate = new DateUtilities.CALDate(start);
         DateUtilities.CALDate     endDate   = new DateUtilities.CALDate(end);
         DateUtilities.CALDate[]   dateList  = cal.BizDatesList(beginDate, endDate);
         double[,] ret = new double[dateList.Length, 1];
         for (int i = 0; i < dateList.Length; ++i)
         {
             ret[i, 0] = (double)dateList[i].SerialNumber();
         }
         return(Utilities.ArrayResizer.ResizeDoubles(ret));
     }
     catch (Exception e)
     {
         return(Utilities.ExcelRangeErrorString(e));
     }
 }