Exemple #1
0
        public GetBildIdResult GetBildId(string szImageName, DateTime dtCaptureDate)
        {
            GetBildIdResult ret       = new GetBildIdResult();
            var             bildListe = database.Query <Bild>("SELECT * FROM [Bild] WHERE [Name] = '" + szImageName + "'");

            if (bildListe.Count > 0)
            {
                ret.bBildIdFound  = true;
                ret.BildId        = bildListe[0].ID;
                ret.dtCaptureDate = bildListe[0].CaptureDate;
                if (ret.dtCaptureDate == DateTime.MinValue)
                {
                    // should we update the BILD when the CaptureDate is missing?
                    ret.dtCaptureDate = dtCaptureDate;
                }
            }
            else
            {
                ret.bBildIdFound  = false;
                ret.dtCaptureDate = dtCaptureDate;
                Bild bild = new Bild
                {
                    Name        = szImageName,
                    CaptureDate = ret.dtCaptureDate
                };
                database.Insert(bild);
                ret.BildId = database.ExecuteScalar <int>("select last_insert_rowid();");
            }
            return(ret);
        }
Exemple #2
0
        public int AddBild(string szImageName)
        {
            Bild bild = new Bild();

            bild.Name = szImageName;
            database.Insert(bild);
            return(database.ExecuteScalar <int>("select last_insert_rowid();"));
        }
Exemple #3
0
        public void SetCaptureDate(int bildId, DateTime captureDate)
        {
            Bild bild = GetBild(bildId);

            if (bild != null)
            {
                bild.CaptureDate = captureDate;
                database.Update(bild);
            }
        }
Exemple #4
0
        public void ClearStatus(int bildID, STATUS bsSet)
        {
            Bild bild = GetBild(bildID);

            if (bild != null)
            {
                bild.Status &= ~(int)bsSet;
                database.Update(bild);
            }
        }
Exemple #5
0
        public Boolean HasStatus(int bildID, STATUS bsCheck)
        {
            Bild bild = GetBild(bildID);

            if (bild != null)
            {
                STATUS bs = (STATUS)bild.Status;

                return(bs.HasFlag(bsCheck));
            }
            return(false);
        }