Ejemplo n.º 1
0
        public void Post([FromBody] Prescriptions item)
        {
            SqliteConnection sqliteConnection = new SqliteConnection();


            string query = string.Format("Insert Into {0} (ExpirationDate, ProductName, UsesLeft, Description, IsActive, PatientId) " +
                                         " values ('{1}','{2}',{3},'{4}',{5},'{6}')", "Prescriptions", item.ExpirationDate, item.ProductName, item.UsesLeft, item.Description, item.IsActive == true ? 1 : 0, item.PatientId);

            sqliteConnection.ExecuteNonQuery(query);

            //PrescriptionList.Add(item);
        }
Ejemplo n.º 2
0
        // Header: Authorization : Basic b21ib3JpOm9tYm9yaQ==
        public void Put(int id, [FromBody] Prescriptions item)
        {
            //id = id - 1;

            //var Temp = PrescriptionList[id];
            //Temp.ExpirationDate = item.ExpirationDate;
            //Temp.IsActive = item.IsActive;
            //Temp.PatientId = item.PatientId;
            //Temp.ProductName = item.ProductName;
            //Temp.UsesLeft = item.UsesLeft;
            //Temp.Description = item.Description;

            //PrescriptionList[id] = Temp;
        }