Exemple #1
0
        public bool BFindMarkFile(DateTime dt, ref MarkFile mkfile)
        {
            var dtMonth = new DateTime(dt.Year, dt.Month, 1);

            foreach (var mkf in MarkFiles)
            {
                if (mkf.DtMonth == dtMonth)
                {
                    mkfile = mkf;
                    return(true);
                }
            }
            return(false);
        }
Exemple #2
0
        public bool GetMarkData(DateTime dt, ref MarkData mkDa)
        {
            var dtMonth = new DateTime(dt.Year, dt.Month, 1);

            var mkf = new MarkFile(dtMonth);

            if (BFindMarkFile(dt, ref mkf))
            {
                if (mkf.GetMarkData(dt, ref mkDa))
                {
                    return(true);
                }
            }


            return(false);
        }
Exemple #3
0
 public bool SetMarkData(DateTime dt, MarkData mkDa)
 {
     try
     {
         var dtMonth = new DateTime(dt.Year, dt.Month, 1);
         var mkf     = new MarkFile(dtMonth);
         if (BFindMarkFile(dtMonth, ref mkf)) //need add to mkf list
         {
             mkf.SetMarkData(dt, mkDa);
             return(true);
         }
     }
     catch (Exception)
     {
         // ignored
     }
     return(false);
 }
Exemple #4
0
 public bool AddMarkData(DateTime dt, MarkData mkDa, string mkFileRootDir)
 {
     try
     {
         var dtMonth = new DateTime(dt.Year, dt.Month, 1);
         var mkf     = new MarkFile(dtMonth);
         if (!BFindMarkFile(dtMonth, ref mkf)) //need add to mkf list
         {
             var mkFilePath = Path.Combine(mkFileRootDir, SkewkyMark + mkf.GetMarkFileName());
             mkf.FilePath = mkFilePath;
             mkf.SetMarkData(dt, mkDa);
             MarkFiles.Add(mkf);
             return(true);
         }
     }
     catch (Exception)
     {
         // ignored
     }
     return(false);
 }