예제 #1
0
        public async Task <bool> CreateMedcine(Medicines medicine)
        {
            bool isSuccess = false;

            try {
                int rowsEffected = await _sqlRepository.ExecuteAsync <int>(Queries.insertMedicine, new
                {
                    Medname    = medicine.Medname,
                    Brand      = medicine.Brand,
                    Price      = medicine.Price,
                    Quantity   = medicine.Quantity,
                    Expirytime = medicine.Expirytime,
                    Notes      = medicine.Notes
                });

                isSuccess = (rowsEffected > 0) ? true : false;
            }
            catch (Exception)
            {
                throw;
            }
            return(isSuccess);
        }