Ejemplo n.º 1
0
        public void Test_AddBill()
        {
            var model  = _fixture.Create <BillModel>();
            var number = _fixture.Create <int>();

            _manager.Save(TestConstants.TestApplicationId, number, model, DateTimeProvider.Now, null);

            var billData = _billRepository.Get(TestConstants.TestApplicationId);

            billData.Number.ShouldBeEquivalentTo(number);
            billData.SendDate.Should().NotHaveValue();
            Debug.Assert(model.PriceRuble != null, "model.PriceRuble != null");
            billData.Price.Should().BeApproximately(model.PriceRuble.Value / billData.EuroToRuble, (decimal)0.0001);
            billData.ShouldBeEquivalentTo(model, options => options.ExcludingMissingProperties());
            billData.ShouldBeEquivalentTo(model.BankDetails, options => options.ExcludingMissingProperties());
        }
Ejemplo n.º 2
0
        protected void payButton_Click(object sender, EventArgs e)
        {
            Bill bill = new Bill();


            bill.Bill_Voucher      = billTextBox.Text;
            bill.Bill_Voucher_date = DateTime.Today;


            if (amountTextBox.Text == "" || Convert.ToDouble(amountTextBox.Text) <= 0)
            {
                notificationLabel.Text = "Please insert Correct Paying Amount";
            }
            else
            {
                bill.Bill_amount = Convert.ToDouble(amountTextBox.Text);
                if (bill.Bill_amount < 0)
                {
                    notificationLabel.Text = "Enter Valid Amount";
                }


                else if (Convert.ToDouble(feeTextBox.Text) - Convert.ToDouble(paidTextBox.Text) - Convert.ToDouble(amountTextBox.Text) >= 0)
                {
                    notificationLabel.Text = billManager.Save(bill);
                }
                else
                {
                    notificationLabel.Text = "Payment Can not be Greater than Billed Amount";
                }
            }

            refreshAll();
            amountTextBox.Text = "";
        }
Ejemplo n.º 3
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            string   name      = nameTextBox.Value;
            DateTime dateBirth = DateTime.Parse(dateOfBirthTextBox.Value);
            double   fee       = double.Parse(feeTextBox.Value);
            string   mobileNo  = mobileTextBox.Value.ToString();

            DateTime    currentDateTime = DateTime.Now;
            List <Test> testList        = (List <Test>)ViewState["TestList"];

            if (testList.Count > 0)
            {
                if (name != "" && mobileNo != "")
                {
                    PatientManager patientManager = new PatientManager();
                    BillManager    billManager    = new BillManager();
                    OrderManager   orderManager   = new OrderManager();
                    Patient        patient        = new Patient(name, mobileNo, dateBirth);

                    int patientRowAffected = patientManager.Save(patient);

                    int    patientId   = patientManager.GetLastPatientId();
                    double totalAmount = Convert.ToDouble(ViewState["TotalAmount"]);
                    string billNo      = currentDateTime.ToString("yyyyMMddHHmmss") + patientId.ToString();

                    Bill bill            = new Bill(billNo, currentDateTime, totalAmount, "unpaid");
                    int  billRowAffected = billManager.Save(bill);

                    foreach (Test test in testList)
                    {
                        Order order            = new Order(patientId, test.Id, billNo);
                        int   orderRowAffected = orderManager.Save(order);
                    }

                    //if (patientRowAffected > 0 && billRowAffected > 0 && orderRowAffected > 0)
                    //{
                    testTypeSuccessfullAlartLabel.Text = "All Test are successfully saved!!";
                    testTypeSuccessfullDiv.Visible     = true;
                    testTypeDangerDiv.Visible          = false;
                    GetReportInPdf(name, mobileNo, billNo, dateBirth);
                    //}
                }
                else
                {
                    testTypeDangerAlartLabel.Text  = "Patient name and mobile number must required!!";
                    testTypeDangerDiv.Visible      = true;
                    testTypeSuccessfullDiv.Visible = false;
                }
            }
            else
            {
                testTypeDangerAlartLabel.Text  = "No Test is added!!";
                testTypeDangerDiv.Visible      = true;
                testTypeSuccessfullDiv.Visible = false;
            }
        }