Beispiel #1
0
            public async Task <int> Handle(CreateBloodTransfusionCommand request, CancellationToken cancellationToken)
            {
                var model = request.Model;
                var item  = await Context.BloodTransfusions
                            .Where(p => p.BloodTransfusionId == model.BloodTransfusionId)
                            .FirstOrDefaultAsync(cancellationToken);

                if (item != null)
                {
                    throw new AlreadyExistsException(nameof(BloodTransfusion), nameof(model.BloodTransfusionId), model.BloodTransfusionId);
                }

                var newRecord = new BloodTransfusion
                {
                    OncologyPatientId = model.OncologyPatientId.Value,
                    Group             = model.Group,
                    WardId            = model.WardId.Value,
                    ABORH             = model.ABORH,
                    Date     = model.Date.Value,
                    VerifyBy = model.VerifyBy,
                };

                Context.BloodTransfusions.Add(newRecord);
                await Context.SaveChangesAsync(cancellationToken);

                return(newRecord.BloodTransfusionId);
            }
        private void label25_Click(object sender, EventArgs e)
        {
            BloodTransfusion bt = new BloodTransfusion();

            this.Hide();
            bt.Show();
        }
Beispiel #3
0
        private void label1_Click(object sender, EventArgs e)
        {
            this.Hide();
            BloodTransfusion B = new BloodTransfusion();

            B.Show();
        }
        private void UpdateTransfusion_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length < 4)
            {
                MessageBox.Show("ID should be entered in 4 characters");
            }
            else if (textBox2.Text.Length < 5)
            {
                MessageBox.Show("Amount should be entered in ML min 5 characters");
            }
            else if (textBox3.Text.Length < 4)
            {
                MessageBox.Show("Hemoglobin should be entered in DL min 4 characters");
            }
            else
            {
                BloodTranfuseController btc = new BloodTranfuseController();
                btc.UpdateTransfusion(textBox1.Text, comboBox1.Text, textBox3.Text, textBox2.Text, DateTime.Parse(dateTimePicker1.Text.ToString()), int.Parse(textBox4.Text), textBox5.Text, DateTime.Parse(dateTimePicker2.Text.ToString()));

                this.Hide();
                BloodTransfusion bt = new BloodTransfusion();
                bt.Show();
            }
        }