コード例 #1
0
 public async Task <string> Create(AddUpdateMedicineDto dto)
 {
     return(await AddOneAsync(new Medicine
     {
         ScheduleCategoryId = dto.ScheduleCategoryId,
         MedicineCategoryId = dto.MedicineCategoryId,
         MedicineCommodityId = dto.MedicineCommodityId,
         Name = dto.Name,
         GenericName = dto.GenericName,
         Manufacturer = dto.Manufacturer,
         DiscountPercentage = dto.DiscountPercentage,
         HSNCode = dto.HSNCode,
         Price = dto.Price,
         VAT = dto.VAT,
         AdditionalTax = dto.AdditionalTax,
         IGST = dto.IGST,
         CGST = dto.CGST,
         SGST = dto.SGST,
     }, _userClaims.Id));
 }
コード例 #2
0
        public async Task <bool> Update(AddUpdateMedicineDto dto)
        {
            #region update filter

            var updateFilter = Builders <Medicine> .Update
                               .Set(x => x.ScheduleCategoryId, dto.ScheduleCategoryId)
                               .Set(x => x.MedicineCategoryId, dto.MedicineCategoryId)
                               .Set(x => x.MedicineCommodityId, dto.MedicineCommodityId)
                               .Set(x => x.Name, dto.Name)
                               .Set(x => x.GenericName, dto.GenericName)
                               .Set(x => x.Manufacturer, dto.Manufacturer)
                               .Set(x => x.DiscountPercentage, dto.DiscountPercentage)
                               .Set(x => x.HSNCode, dto.HSNCode)
                               .Set(x => x.Price, dto.Price)
                               .Set(x => x.VAT, dto.VAT)
                               .Set(x => x.AdditionalTax, dto.AdditionalTax)
                               .Set(x => x.IGST, dto.IGST)
                               .Set(x => x.CGST, dto.CGST)
                               .Set(x => x.SGST, dto.SGST);

            #endregion

            return(await UpdateOneAsync(dto.Id, updateFilter, _userClaims.Id));
        }