protected virtual void SaveAs(ExcelFileSubjects subject) { if (Helpers.IsDirExist == true) { string fullPath = Helpers.RootPath + GetFileName(subject); XlWb.SaveAs(fullPath); } }
protected string GetFileName(ExcelFileSubjects subject) { string filename = ""; switch (subject) { case ExcelFileSubjects.Brackets: filename = "בתים "; break; case ExcelFileSubjects.ContendersList: filename = "רשימת מתחרים "; break; default: filename = "קובץ ארכיון "; break; } // add uniq time filename = filename + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".xlsx"; return(filename); }