Exemplo n.º 1
0
 public Invoice AddInvoice(Invoice invoice)
 {
     _context.ArmsInvoices.Add(invoice);
     _context.SaveChanges();
     _cache.Remove("Invoice");
     return(invoice);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 public ArmsFundingType UpdateArmsArmsFundingType(ArmsFundingType armsFundingType)
 {
     _context.ArmsFundingType.Update(armsFundingType);
     _context.SaveChanges();
     _cache.Remove("FundingType");
     return(armsFundingType);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 9
0
 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();
         }
     }
 }
Exemplo n.º 10
0
 public void CommitChanges()
 {
     _context.SaveChanges();
 }