Beispiel #1
0
        public static bool dayCheck(string strValue)
        {
            bool boolRetVal = false;

            if (strValue.Length > 0)
            {
                if (strValue.Length == 19)
                {
                    //if (CommonExcelClasses.IsDate(strValue))
                    if (CommonExcelClasses.IsDate(strValue))
                    {
                        string strDayOfWeek = FormatDate(DateTime.Parse(strValue), "dddd");
                        boolRetVal = (strDayOfWeek == "Monday" || strDayOfWeek == "Tuesday" || strDayOfWeek == "Wednesday" || strDayOfWeek == "Thursday" || strDayOfWeek == "Friday");
                    }
                }
            }

            return(boolRetVal);
        }
Beispiel #2
0
        /// <summary>
        /// Clear the workbook
        /// </summary>
        public static void zapWorksheet(Excel.Worksheet Wks, int intFirstRow = 2)
        {
            Excel.Range xlCell;

            // Wks = Wkb.ActiveSheet;

            int intLastRow = CommonExcelClasses.getLastRow(Wks);

            xlCell = Wks.get_Range("A" + intFirstRow + ":A" + intLastRow);

            if (Wks.Name != "InternalParameters")
            {
                if (intLastRow > intFirstRow)
                {
                    xlCell.EntireRow.Delete(Excel.XlDirection.xlUp);
                }
            }
            else
            {
                CommonExcelClasses.MsgBox("Cannot run in worksheet: InternalParameters", "Error");
            }
        }