Exemple #1
0
 public Invoice AddInvoice(Invoice invoice)
 {
     _context.ArmsInvoices.Add(invoice);
     _context.SaveChanges();
     _cache.Remove("Invoice");
     return(invoice);
 }
Exemple #2
0
 public Funding UpdateArmsFunding(Funding funding)
 {
     _context.ArmsFunding.Update(funding);
     _context.Attach(funding);
     _context.Entry(funding).State = EntityState.Modified;
     _context.SaveChanges();
     _cache.Remove("Funding");
     return(funding);
 }
Exemple #3
0
 public Event UpdateArmsEventType(Event evnt)
 {
     _context.ArmsEvents.Update(evnt);
     _context.Attach(evnt);
     _context.Entry(evnt).State = EntityState.Modified;
     _context.SaveChanges();
     _cache.Remove("Event");
     return(evnt);
 }
 public FileUpload UpdateArmsEventUploadType(FileUpload upload)
 {
     _context.ArmsEventUploads.Update(upload);
     _context.Attach(upload);
     _context.Entry(upload).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     _context.SaveChanges();
     _cache.Remove("Upload");
     return(upload);
 }
Exemple #5
0
        public async Task <ArmsPhase> AddArmsPhase(ArmsPhase armsPhase)
        {
            await _context.ArmsPhases.AddAsync(armsPhase);

            _context.Attach(armsPhase);
            _context.Entry(armsPhase).State = EntityState.Added;
            _context.SaveChanges();
            return(armsPhase);
        }
Exemple #6
0
 public ArmsFundingType UpdateArmsArmsFundingType(ArmsFundingType armsFundingType)
 {
     _context.ArmsFundingType.Update(armsFundingType);
     _context.SaveChanges();
     _cache.Remove("FundingType");
     return(armsFundingType);
 }
Exemple #7
0
        //public async Task<List<ConfigItem>> GetAllConfigItemsAsync()
        //{
        //    return await _cache.GetOrCreateAsync("Config", entry =>
        //    {
        //        return _context.ArmsConfigItems.ToListAsync();
        //    });
        //}

        public ConfigItem UpdateConfigItem(ConfigItem ci)
        {
            _context.ArmsConfigItems.Update(ci);
            _context.Attach(ci);
            _context.Entry(ci).State = EntityState.Modified;
            _context.SaveChanges();
            _cache.Remove("Config");
            return(ci);
        }
Exemple #8
0
 public ArmsPersonnel UpdatePersonnel(ArmsPersonnel armsPersonnel)
 {
     // _context.ArmsPersonnel.Update(armsPersonnel);
     // _context.Attach(armsPersonnel);
     _context.Entry(armsPersonnel).State = EntityState.Modified;
     _context.SaveChanges();
     _cache.Remove("Personnel");
     return(armsPersonnel);
 }
 public void AddCustomDeliverable(IEnumerable <ProjDeliverables> projectDeliverables, Guid projId)
 {
     if (projectDeliverables != null)
     {
         foreach (var projectDeliverable in projectDeliverables)
         {
             projectDeliverable.DeliverableId = null;
             projectDeliverable.UserId        = "Manoj";
             projectDeliverable.ProjectId     = projId;
             ArmsDeliverables armsDeliverableToAdd = _mapper.Map <ArmsDeliverables>(projectDeliverable);
             armsDeliverableToAdd.ArmsProjectDeliverables = new List <Entities.ArmsProjectDeliverables>();
             /* updating the record in the associated project Deliverables table with foreign key */
             armsDeliverableToAdd.ArmsProjectDeliverables.Add(new Entities.ArmsProjectDeliverables
             {
                 ProjId = projId,
                 UserId = armsDeliverableToAdd.UserId
             });
             _context.ArmsDeliverables.Add(armsDeliverableToAdd);
             _context.SaveChanges();
         }
     }
 }
 public void CommitChanges()
 {
     _context.SaveChanges();
 }