예제 #1
0
        public void UpdateUserMedicine(int id, string medicine, string medicinedesc, string time)
        {
            MedicineEntry um = new MedicineEntry();

            um.ID           = id;
            um.Medicine     = medicine;
            um.MedicineDesc = medicinedesc;
            um.TimeMedicine = time;
            um.UpdateUserMedicine(um);
        }
        public void RegisterUserMedicineEntry(MedicineEntry ME)
        {
            string     query = "MedicineAlloting";
            SqlCommand cmd   = new SqlCommand(query, MyCon);

            MyCon.Open();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@ID", ME.ID);
            cmd.Parameters.AddWithValue("@Medicine", ME.Medicine);
            cmd.Parameters.AddWithValue("@MedicineDesc", ME.MedicineDesc);
            cmd.Parameters.AddWithValue("@Time1", DateTime.Parse(ME.TimeMedicine));
            cmd.ExecuteNonQuery();
            MyCon.Close();
        }
        public void UpdateUserMedicine(MedicineEntry m)
        {
            string query = "UpdatingMedicine";

            MyCon.Open();
            SqlCommand cmd = new SqlCommand(query, MyCon);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@ID", m.ID);
            cmd.Parameters.AddWithValue("@Med", m.Medicine);
            cmd.Parameters.AddWithValue("@MedDesc", m.MedicineDesc);
            cmd.Parameters.AddWithValue("@Timee", m.TimeMedicine);
            cmd.ExecuteNonQuery();
            cmd.ExecuteNonQuery();
            MyCon.Close();
        }
        public MedicineEntry GetUserMedicinebyID(int Id)
        {
            MedicineEntry me    = new MedicineEntry();
            string        query = "Select * from Medicines where UserID = '" + Id + "'";

            MyCon.Open();
            SqlCommand    cmd    = new SqlCommand(query, MyCon);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                me.ID           = int.Parse(reader[0].ToString());
                me.Medicine     = reader[1].ToString();
                me.MedicineDesc = reader[2].ToString();
                me.TimeMedicine = reader[3].ToString();
            }
            MyCon.Close();
            return(me);
        }
예제 #5
0
        public MedicineEntry GetUserMedicineByID(int ID)
        {
            MedicineEntry um = new MedicineEntry();

            return(um.GetUserMedicinebyID(ID));
        }
예제 #6
0
        public DataSet SearchID(int ID)
        {
            MedicineEntry um = new MedicineEntry();

            return(um.SearchID(ID));
        }
예제 #7
0
        public DataSet GetUserMedicine()
        {
            MedicineEntry um = new MedicineEntry();

            return(um.GetAllUserMedicine());
        }