Ejemplo n.º 1
0
        private void ModyfingUsersInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.Users.Attach(selectedUser);
                var entry = db.Entry(selectedUser);

                entry.Property(x => x.ActivationDate).IsModified = true;
                entry.Property(x => x.Email).IsModified = true;
                entry.Property(x => x.LastLogin).IsModified = true;
                entry.Property(x => x.Login).IsModified = true;
                entry.Property(x => x.Password).IsModified = true;

                db.SaveChanges();
            }
            Thread newThread = new Thread(DisplayAllRecordsFromUsers);
            newThread.Start();
        }
Ejemplo n.º 2
0
        private void ModyfingProjectsInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.Projects.Attach(selectedProject);
                var entry = db.Entry(selectedProject);

                entry.Property(x => x.CompaniesCompanyID).IsModified = true;
                entry.Property(x => x.Complexity).IsModified = true;
                entry.Property(x => x.Gratification).IsModified = true;
                entry.Property(x => x.MinCodity).IsModified = true;
                entry.Property(x => x.MinRespect).IsModified = true;
                entry.Property(x => x.Name).IsModified = true;
                entry.Property(x => x.TimeRounds).IsModified = true;
                entry.Property(x => x.TimeToEnd).IsModified = true;
                try
                {
                    db.SaveChanges();
                }
                catch
                {
                    MessageBox.Show("You have to give a reference to existing record.");
                }
            }
            Thread newThread = new Thread(DisplayAllRecordsFromProjects);
            newThread.Start();
        }
Ejemplo n.º 3
0
        private void ModifyingTypesOfEmployeesInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.TypesOfEmployees.Attach(selectedTypesOfEmployee);
                var entry = db.Entry(selectedTypesOfEmployee);

                entry.Property(x => x.Codity).IsModified = true;
                entry.Property(x => x.Name).IsModified = true;
                entry.Property(x => x.Salary).IsModified = true;

                try
                {
                    db.SaveChanges();
                }
                catch
                {
                    MessageBox.Show("You have to give a reference to existing record.");
                }
            }
            Thread newThread = new Thread(DisplayAllRecordsFromTypesOfEmployees);
            newThread.Start();
        }
Ejemplo n.º 4
0
        private void ModifyingTypeOfOfficesInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.TypesOfOffices.Attach(selectedTypesOfOffice);
                var entry = db.Entry(selectedTypesOfOffice);

                entry.Property(x => x.Capacity).IsModified = true;
                entry.Property(x => x.CostOfHiring).IsModified = true;
                entry.Property(x => x.Name).IsModified = true;

                db.SaveChanges();
            }
            Thread newThread = new Thread(DisplayAllRecordsFromTypesOfOffices);
            newThread.Start();
        }
Ejemplo n.º 5
0
        private void ModifyingDescriptionsInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.Descriptions.Attach(selectedDesciption);
                var entry = db.Entry(selectedDesciption);

                entry.Property(x => x.ProjectsProjectID).IsModified = true;
                entry.Property(x => x.String).IsModified = true;
                try
                {
                    db.SaveChanges();
                }
                catch
                {
                    MessageBox.Show("You have to give a reference to existing record.");
                }
            }
            Thread newThread = new Thread(DisplayAllRecordsFromDescriptions);
            newThread.Start();
        }
Ejemplo n.º 6
0
        private void ModifyingCompaniesInNewThread()
        {
            using (var db = new BusinessCodingModelContex())
            {
                db.Companies.Attach(selectedCompany);
                var entry = db.Entry(selectedCompany);

                entry.Property(x => x.CostOfLiving).IsModified = true;
                entry.Property(x => x.Money).IsModified = true;
                entry.Property(x => x.Name).IsModified = true;
                entry.Property(x => x.Respect).IsModified = true;
                entry.Property(x => x.TypesOfOfficesTOOfficeID).IsModified = true;
                entry.Property(x => x.UsersUserID).IsModified = true;
                try
                {
                    db.SaveChanges();
                }
                catch
                {
                    MessageBox.Show("You have to give a reference to existing record.");
                }
            }
            Thread newThread = new Thread(DisplayAllRecordsFromCompanies);
            newThread.Start();
        }