Ejemplo n.º 1
0
        public Certificate_UI()
        {
            InitializeComponent();
            aBirthInfoManager = new BirthInfoManager();
            aDeathInfoManager = new DeathInfoManager();

            btnDelete.Enabled = false;
        }
Ejemplo n.º 2
0
        public void SaveAndUpdateBirthInfo()
        {
            if (xtraTabControl1.SelectedTabPage == TabBirthInfo)
            {
                MessageModel aMessageModel = new MessageModel();
                BirthInfo    aBirthInfo    = new BirthInfo();
                if (!string.IsNullOrEmpty(lblId.Text))
                {
                    aBirthInfo.Id = Convert.ToInt32(lblId.Text);
                }
                aBirthInfo.OPID               = txtOpId.Text;
                aBirthInfo.Name               = txtName.Text;
                aBirthInfo.DateOfBirth        = dateTimeDateOfBirth.Value;
                aBirthInfo.BirthTime          = dateTimeBirthTime.Text;
                aBirthInfo.Weight             = txtWeight.Text;
                aBirthInfo.Height             = txtHeight.Text;
                aBirthInfo.IssueDate          = dateTimeIssueDate.Value;
                aBirthInfo.BirthRegNo         = txtBirthRegNo.Text;
                aBirthInfo.Gender             = cmbGender.SelectedText;
                aBirthInfo.Nationality        = txtNationality.Text;
                aBirthInfo.FathersName        = txtFathersName.Text;
                aBirthInfo.MothersName        = txtMothersName.Text;
                aBirthInfo.FathersNationality = txtFathersNationality.Text;
                aBirthInfo.MothersNationality = txtMothersNationality.Text;
                aBirthInfo.PresentAddress     = txtPresentAddress.Text;
                aBirthInfo.PermanentAddress   = txtPermanentAddress.Text;
                aBirthInfo.UserId             = lblUserId.Text;
                aBirthInfo.CabinBed           = txtCabinBed.Text;
                aBirthInfo.TypeOfDelivery     = txtTypeOfDelivery.Text;

                if (btnBirthInfoSave.Text == "Save")
                {
                    aBirthInfo.CreateDate = DateTime.Now;
                    aMessageModel         = aBirthInfoManager.SaveBirthInfo(aBirthInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        RefreshBirthInfo();
                    }
                    MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    aBirthInfo.UpdateDate = DateTime.Now;
                    aMessageModel         = aBirthInfoManager.UpdateBirthInfo(aBirthInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshBirthInfo();
                    }
                }
            }

            else if (xtraTabControl1.SelectedTabPage == TabDeathInfo)
            {
                DeathInfo aDeathInfo = new DeathInfo();
                aDeathInfo.DeathRegNo       = txtDeathRegNo.Text;
                aDeathInfo.Name             = txtDeathName.Text;
                aDeathInfo.IssueDate        = dateTimeDeathIssueDate.Value;
                aDeathInfo.FathersName      = txtDeathFathersName.Text;
                aDeathInfo.MothersName      = txtDeathMothersName.Text;
                aDeathInfo.DateOfDeath      = dateTimeDateOfDeath.Value;
                aDeathInfo.DeathTime        = dateTimeDeathTime.Text;
                aDeathInfo.Gender           = cmbGender.Text; aDeathInfo.MaritalStatus = cmbDeathMaritalStatus.Text;
                aDeathInfo.SpouseName       = txtDeathSpouseName.Text;
                aDeathInfo.PresentAddress   = txtDeathPresentAddress.Text;
                aDeathInfo.PermanentAddress = txtDeathPermanentAddress.Text;
                aDeathInfo.Nationality      = txtNationality.Text;
                aDeathInfo.UserId           = lblUserId.Text;
                aDeathInfo.Opid             = txtDeathPatientID.Text;
                aDeathInfo.Age = txtDeathAge.Text;


                aDeathInfo.Floor           = txtFloor.Text;
                aDeathInfo.Cabin           = txtCabinBed.Text;
                aDeathInfo.Bed             = txtBed.Text;
                aDeathInfo.Religion        = txtReligion.Text;
                aDeathInfo.DateOfAdmission = dateOfAdmission.Value;
                aDeathInfo.IntervalBetween = txtIntervalBetween.Text;


                aDeathInfoManager = new DeathInfoManager();
                MessageModel aMessageModel = new MessageModel();
                if (btnBirthInfoSave.Text == "Save")
                {
                    aDeathInfo.CreateDate = DateTime.Now;
                    aMessageModel         = aDeathInfoManager.SaveDeathInfo(aDeathInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshDeathInfo();
                    }
                }
                else
                {
                    aDeathInfo.UpdateDate = DateTime.Now;
                    aMessageModel         = aDeathInfoManager.UpdateDeathInfo(aDeathInfo);
                    if (aMessageModel.MessageTitle == "Successfull")
                    {
                        MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        RefreshDeathInfo();
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void GetIndorPatientInfo()
 {
     aDeathInfoManager = new DeathInfoManager();
     searchLookUpOpInfoDeath.Properties.DataSource = aDeathInfoManager.GetIndorPatientInfo();
 }