Ejemplo n.º 1
0
        protected void BillButton_Click(object sender, EventArgs e)
        {
            BillSystem aBillSystem = new BillSystem();

            aBillSystem.BillId        = BillId();
            aBillSystem.BillAmount    = (float)Convert.ToDouble(billAmountTextBox.Text);
            aBillSystem.ModeOfPayment = billingModeDropDownList.Text;
            if (billingModeDropDownList.Text == "Card")
            {
                aBillSystem.CardNumber = cardNumberTextBox.Text;
            }
            else
            {
                aBillSystem.CardNumber = " ";
            }

            int result = aBillBusinessLogic.GetBillInfo(aBillSystem);
        }
        protected void patientDiagnosisButton_Click(object sender, EventArgs e)
        {
            EntityLayer.PatientDiagnosis aPatientDiagnosis = new EntityLayer.PatientDiagnosis();
            aPatientDiagnosis.DiagnosisId       = GetDiagnosisId();
            aPatientDiagnosis.Symptoms          = symptompsTextBox.Text;
            aPatientDiagnosis.DiagnosisProvided = diagnosisProvidedTextBox.Text;
            aPatientDiagnosis.AdministeredBy    = administratedByDropDownList.SelectedItem.Value;
            aPatientDiagnosis.DateOfDiagnosis   = dateOfDiagnosisTextbox.Text;
            aPatientDiagnosis.FollowUpRequired  = followUpTrueRadioButton.Text == "Yes" ? followUpTrueRadioButton.Text : followUpFalseRadioButton.Text;
            aPatientDiagnosis.DateOfFollowUp    = dateOfFollowedUpTextbox.Text;

            BillSystem aBillSystem = new BillSystem();

            aBillSystem.BillId        = BillId();
            aBillSystem.BillAmount    = (float)Convert.ToDouble(billAmountTextBox.Text);
            aBillSystem.ModeOfPayment = billingModeDropDownList.Text;
            if (billingModeDropDownList.Text == "Card")
            {
                aBillSystem.CardNumber = cardNumberTextBox.Text;
            }
            else
            {
                aBillSystem.CardNumber = " ";
            }

            int resultBillSystem = aBillBusinessLogic.GetBillInfo(aBillSystem);

            aPatientDiagnosis.BillId = aBillBusinessLogic.GetBillId();

            int resultPatientDiagnosys = aBusinessLogic.AddPatientDiagnosis(aPatientDiagnosis);

            if (resultPatientDiagnosys > 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted failed')", true);
            }

            Clear();
        }
Ejemplo n.º 3
0
        public int GetBillInfo(BillSystem aBillSystem)
        {
            int result = 0;

            SqlParameter[] aSqlParameters = new SqlParameter[4];
            aSqlParameters[0]       = new SqlParameter("@BillId", SqlDbType.Int);
            aSqlParameters[0].Value = aBillSystem.BillId;

            aSqlParameters[1]       = new SqlParameter("@BillAmount", SqlDbType.Float);
            aSqlParameters[1].Value = aBillSystem.BillAmount;

            aSqlParameters[2]       = new SqlParameter("@CardNumber", SqlDbType.VarChar, 50);
            aSqlParameters[2].Value = aBillSystem.CardNumber;

            aSqlParameters[3]       = new SqlParameter("@ModeOfPayment", SqlDbType.VarChar, 10);
            aSqlParameters[3].Value = aBillSystem.ModeOfPayment;


            result = aDataAccess.AddBilltDetails(aSqlParameters);

            return(result);
        }