Ejemplo n.º 1
0
        /// <summary>
        /// Update met now.
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        public DateTime UpdateProjectBerekenDatum(int projectId)
        {
            DateTime now;
            using (DataClasses1DataContext contextDb = new DataClasses1DataContext())
            {
                ///DeleteAllData(contextDb);
                var project = (from aProject in contextDb.Projects 
                               where aProject.ProjectId == projectId select aProject).FirstOrDefault();
                now = DateTime.Now;
                project.BerekenDatum = now;

                contextDb.SubmitChanges();
                ///contextDb.Dispose();
            }

            return now;
        }
Ejemplo n.º 2
0
    public bool SaveBronBestand(int gegevensetId, string naam)
    {
        ///NOTE: caller must anticipate exception.
        var bronBestand = new DataResource.LinQToSqlServer.BronBestand();
        bronBestand.BestandsNaam = naam;
        bronBestand.GegevensSetId = gegevensetId;
        bronBestand.AanleverDatum = DateTime.Now;

        using (DataClasses1DataContext context = new DataClasses1DataContext())
        {
            context.BronBestands.InsertOnSubmit(bronBestand);
            context.SubmitChanges();
        }
        return true;
    }