예제 #1
0
        public void AddDefaultVolunteersAndEvents()
        {
            Database.SetConnectionString(Database.CreateConnectionString(DatabasePath, DatabaseName, DatabaseUserName, DatabasePassword));
            VolunteerTracker.Volunteer v1 = new Volunteer(1);
            v1.FirstName = "Default Volunteer";
            v1.LastName = "";
            v1.CellPhone = "";
            v1.HomePhone = "";
            v1.OfficePhone = "";
            v1.Save();

            VolunteerTracker.Event e = new VolunteerTracker.Event();
            e.Name = "Default Event";
            e.Save();
        }
예제 #2
0
파일: Program.cs 프로젝트: Devang83/csc131
        static void Main(string[] args)
        {
            Database.SetUserId(AccessControlList.ROOT_USERID);
            DatabaseAccess.SetDatabaseType(new SQLite());

            ManageDatabase md = new ManageDatabase("", "volunteertracker.db", "", "");
            //md.CreateDatabase();
            md.RecreateTables();

            Database.SetConnectionString(Database.CreateConnectionString("", "volunteertracker.db", "", ""));
            //Database.SetUserId(1);
            VolunteerTracker.Volunteer v = new VolunteerTracker.Volunteer();
            v.FirstName = "Test";
            v.LastName = "";
            v.Address = "";
            v.CellPhone = "";
            v.HomePhone = "";
            v.OfficePhone = "";
            v.Email = "";
            v.Employer = "";
            v.Ethnicity = "";
            v.JobTitle = "";
            v.Birthday = new DateTime();
            v.Male = 0;
            v.Save();

            List<VolunteerTracker.Volunteer> vs = VolunteerTracker.Volunteer.Find<VolunteerTracker.Volunteer>();

            /*Database.RecordExists<Property>(new Property(0));
            long[] propIds = QuickPM.Util.GetPropertyIds(true);
            QuickPM.CachedActiveRecord.ClearCache();
            QuickPM.Property p = new QuickPM.Property(0);
            Console.WriteLine("p.CanRead(1) " + p.ACL.CanRead(1));
            Console.WriteLine("(3) Active " + p.Active);
            Console.WriteLine("(3) Name " + p.Name);
            */
        }