private void btnModfiy_Click(object sender, EventArgs e)
        {
            IInjectionMessageStorage injectionMessageStorage = new InjectionMessageStorage();
            InjectionMessage         injectionMessage        = new InjectionMessage();

            if (cmbInjectorName.Text.Trim() == "" || cmbVaccineName.Text.Trim() == "" ||
                textInjectionMessageSite.Text.Trim() == "" || dtpInjectionMessageTime.Text.Trim() == "" ||
                textInjectionMessageDoctor.Text.Trim() == "")
            {
                MessageBox.Show("请双击需要修改的记录!");
            }
            else
            {
                injectionMessage.InjectorID             = Convert.ToInt32(cmbInjectorName.SelectedValue.ToString());
                injectionMessage.VaccineID              = Convert.ToInt32(cmbVaccineName.SelectedValue.ToString());
                injectionMessage.InjectionMessageSite   = textInjectionMessageSite.Text;
                injectionMessage.InjectionMessageTime   = Convert.ToDateTime(dtpInjectionMessageTime.Text.Trim());
                injectionMessage.InjectionMessageDoctor = textInjectionMessageDoctor.Text;
                injectionMessage.InjectionMessageID     = Convert.ToInt32(dgvInjectionMessage[0, dgvInjectionMessage.CurrentCell.RowIndex].Value.ToString());

                injectionMessageStorage.UpdateInjectionMessage(injectionMessage);

                MessageBox.Show("更新成功!");

                cmbInjectorName.Text            = "";
                cmbVaccineName.Text             = "";
                textInjectionMessageSite.Text   = "";
                dtpInjectionMessageTime.Text    = "";
                textInjectionMessageDoctor.Text = "";
            }
        }
        public void InjectionMessageUpdateSuccessTwo()
        {
            IInjectionMessageStorage pInjectionMessageStorage = new InjectionMessageStorage();
            IInjectorStorage         pInjectorStorage         = new InjectorStorage();
            IVaccineStorage          pVaccineStorage          = new VaccineStorage();

            int pgetInjectorID = getInjectorID();
            int pgetVaccineID  = getVaccineID();

            InjectionMessage myInjectionMessage = CreateInjectionMessageForTest(
                pgetInjectorID,
                pInjectorStorage.ReadInjector(pgetInjectorID).InjectorName,
                pgetVaccineID,
                pVaccineStorage.ReadVaccine(pgetVaccineID).VaccineName,
                "某某人民医院",
                "2016-03-30",
                "陈医生");

            InjectionMessage createdInjectionMessage =
                pInjectionMessageStorage.CreateInjectionMessage(myInjectionMessage);

            Assert.AreNotEqual(
                0,
                createdInjectionMessage.InjectionMessageID,
                string.Format("Could not create InjectionMessage:{0}",
                              createdInjectionMessage.InjectionMessageID));

            myInjectionMessage.VaccineID   = getVaccineID();
            myInjectionMessage.VaccineName = pVaccineStorage.ReadVaccine(myInjectionMessage.VaccineID).VaccineName;

            pInjectionMessageStorage.UpdateInjectionMessage(myInjectionMessage);

            InjectionMessage updatedInjectionMessage = pInjectionMessageStorage.ReadInjectionMessage(
                createdInjectionMessage.InjectionMessageID);

            AssertInjectionMessageItemEqual(myInjectionMessage, updatedInjectionMessage);
        }
        public void InjectionMessageUpdateFailureInjectionMessageIdArgumentException()
        {
            IInjectionMessageStorage pInjectionMessageStorage = new InjectionMessageStorage();
            IInjectorStorage         pInjectorStorage         = new InjectorStorage();
            IVaccineStorage          pVaccineStorage          = new VaccineStorage();

            int pgetInjectorID = getInjectorID();
            int pgetVaccineID  = getVaccineID();

            InjectionMessage myInjectionMessage = CreateInjectionMessageForTest(
                pgetInjectorID,
                pInjectorStorage.ReadInjector(pgetInjectorID).InjectorName,
                pgetVaccineID,
                pVaccineStorage.ReadVaccine(pgetVaccineID).VaccineName,
                "某某人民医院",
                "2016-03-30",
                "陈医生");

            pInjectionMessageStorage.CreateInjectionMessage(myInjectionMessage);

            myInjectionMessage.InjectionMessageID = int.MaxValue;

            pInjectionMessageStorage.UpdateInjectionMessage(myInjectionMessage);
        }
        public void InjectionMessageUpdateFailureInjectionMessageArgumentNullException()
        {
            IInjectionMessageStorage pInjectionMessageStorage = new InjectionMessageStorage();

            pInjectionMessageStorage.UpdateInjectionMessage(null);
        }