Exemple #1
0
        async Task <bool> IProjectFromLocalDB.EditProjectInDB(Project project, int?Id)
        {
            Project Edit_project = await _db.Projects.FindAsync(Id);

            if (Edit_project != null)
            {
                Edit_project.Name             = project.Name;
                Edit_project.Price            = project.Price;
                _db.Entry(Edit_project).State = EntityState.Modified;
                _db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        async Task <bool> IPeopleFromLocalDB.EditPeopleInDB(People people, int?Id)
        {
            People Edit_people = await _db.Peoples.FindAsync(Id);

            if (Edit_people != null)
            {
                Edit_people.Name  = people.Name;
                Edit_people.Phone = people.Phone;

                if (people.FotoName != null)
                {
                    Edit_people.FotoName = people.FotoName;
                }

                _db.Entry(Edit_people).State = EntityState.Modified;
                _db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }