Ejemplo n.º 1
0
        public async Task <DTOclaimuploaddocument> Postclaimuploaddocument(DTOclaimuploaddocument newDTO)
        {
            claimuploaddocument newProd = EntityMapper.updateEntity(null, newDTO);

            db.claimuploaddocuments.Add(newProd);
            await db.SaveChangesAsync();

            return(newDTO);
        }
Ejemplo n.º 2
0
        public async Task <DTOclaimuploaddocument> Postclaimuploaddocument(int userID, int activeProductItemsID, string claimUploadDocPath, int claimID)
        {
            claimuploaddocument    newProd = createClaimUploadDocumentEntity(userID, activeProductItemsID, claimUploadDocPath, claimID);
            DTOclaimuploaddocument newDTO  = new DTOclaimuploaddocument(newProd);

            db.claimuploaddocuments.Add(newProd);
            await db.SaveChangesAsync();

            return(newDTO);
        }
Ejemplo n.º 3
0
        public async Task <IHttpActionResult> Putclaimuploaddocument(int ID, DTOclaimuploaddocument editedDTO)
        {
            claimuploaddocument toUpdate = db.claimuploaddocuments.Find(ID);

            toUpdate = EntityMapper.updateEntity(toUpdate, editedDTO);
            db.Entry(toUpdate).State = EntityState.Modified;
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 4
0
        private claimuploaddocument createClaimUploadDocumentEntity(int userID, int activeProductItemsID, string claimUploadDocPath, int claimID)
        {
            claimuploaddocument doc = new claimuploaddocument();

            doc.User_ID = userID;
            doc.ActiveProductItems_ID   = activeProductItemsID;
            doc.claimUploadDocumentPath = claimUploadDocPath;
            doc.Claim_ID = claimID;


            return(doc);
        }
Ejemplo n.º 5
0
        public static claimuploaddocument updateEntity(claimuploaddocument entityObjct, DTOclaimuploaddocument dto)
        {
            if (entityObjct == null)
            {
                entityObjct = new claimuploaddocument();
            }

            entityObjct.claimUploadDocument_ID = dto.claimUploadDocument_ID;
            entityObjct.User_ID = dto.User_ID;
            entityObjct.ActiveProductItems_ID   = dto.ActiveProductItems_ID;
            entityObjct.document_ID             = dto.document_ID;
            entityObjct.claimUploadDocumentPath = dto.claimUploadDocumentPath;
            entityObjct.Claim_ID = dto.Claim_ID;

            return(entityObjct);
        }