コード例 #1
0
        public async Task <string> udpateProject(ProjectDto project, String projectid)
        {
            Project dto = await _context.Projects.FindAsync(projectid);

            dto.ProjectName = project.ProjectName;

            _context.Entry(dto).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(dto.CompanyId);
        }
コード例 #2
0
        public async Task <bool> DeleteAsset(string asssetID)
        {
            var asset = await _context.SliceAssets.FindAsync(asssetID);

            if (asset == null)
            {
                return(false);
            }
            try
            {
                asset.AssetStatus           = Status.INACTIVE;
                _context.Entry(asset).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (DbUpdateException)
            {
                throw;
            }
        }
コード例 #3
0
        public async Task <string> UpdateCompany(string id, CompanyDetailDto company)
        {
            Company dto = await _context.Companies.FindAsync(id);

            dto.CompanyName       = company.CompanyName;
            dto.ComapnyIcon       = company.ComapnyIcon;
            dto.NonCashMultiplier = company.NonCashMultiplier;
            dto.CashMultiplier    = company.CashMultiplier;
            dto.CashPerSlice      = company.CashPerSlice;

            _context.Entry(dto).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(dto.CompanyId);
        }