Пример #1
0
        private void btnPaid_Click(object sender, EventArgs e)
        {
            MeterBill mb = new MeterBill();

            BindMeterBillEntity(mb);
            if (meterBillCalculateservices.UpdateMeterBill(mb))
            {
                if (rdoadvancemoney.Checked)
                {
                    AdvanceMoneyCustomer amc = new AdvanceMoneyCustomer();
                    BindAdvanceMoneyCustomerEntity(amc);
                    if (advanceMoneyCustomerServices.SaveAdvanceMoney(amc))
                    {
                    }
                }    //end of Advance Money save
                if (Convert.ToDecimal(txtpunishment.Text) > 0)
                {
                    PunishmentCustomer pc = new PunishmentCustomer();
                    BindPunishmentCustomerEntity(pc);
                    if (punishmentCutomerServices.Save(pc))
                    {
                    }    //end of Punishment Customer function save
                }
                MessageBox.Show("Payment is Complete Successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }    //end of meter bill payment paid
        }
Пример #2
0
 private void BindAdvanceMoneyCustomerEntity(AdvanceMoneyCustomer amc)
 {
     amc.AdvanceMoneyCustomerID = Guid.NewGuid().ToString();
     amc.MeterBillID            = vm.MeterBillID;
     amc.ForMonth           = vm.InvoiceDate;
     amc.AdvanceMonthAmount = Convert.ToDecimal(txtChangeAmt.Text);
     amc.Active             = true;
     amc.CreatedDate        = DateTime.Now;
     amc.CreatedUserID      = UserID;
 }
Пример #3
0
 public bool SaveAdvanceMoney(AdvanceMoneyCustomer advanceMoneyCustomer)
 {
     try {
         mBMSEntities.AdvanceMoneyCustomers.Add(advanceMoneyCustomer);
         mBMSEntities.SaveChanges();
     }catch (Exception ex) {
         return(false);
     }
     return(true);
 }