Esempio n. 1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            BALANCE balance = new BALANCE()
            {
                AMOUNT_PAID = Convert.ToDecimal(txtAmountPaid.Text),
                PAID_DATE = datePaid.SelectedDate ?? DateTime.Now,
                SALES_INVOICE_ID = Convert.ToInt32(cmbInvoices.SelectedValue)
            };

            data.Insert<BALANCE>(balance);
            txtAmountPaid.Text = string.Empty;
            cmbInvoices_SelectionChanged(null, null);

        }
Esempio n. 2
0
        private void btnSaveAllSparesPurchase_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Please verify the Purchase Invoice by Clicking View Invoice Once. Because Wrong entry might consume extra efforts or Loss of Data for Future Edit. You want to Proceed? ", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result.Equals(MessageBoxResult.No))
                return;
            SpareSaleInvoice.CUSTOMER_ID = Convert.ToInt32(cmbCustomer.SelectedValue);
            SpareSaleInvoice.INVOICE_DATE = dateTimeInvoiceDate.SelectedDate.Value;
            SpareSaleInvoice.INVOICE_DISCOUNT = string.IsNullOrEmpty(txtDiscount.Text) ? 0 : Convert.ToDecimal(txtDiscount.Text);
            SpareSaleInvoice.INVOICE_VAT_PERCENT = Convert.ToDecimal(lblVatInPercentage.Content);
            SpareSaleInvoice.INVOICE_GRANDTOTAL = Convert.ToDecimal(lblGrandTotal.Content);
            SpareSaleInvoice.SELL_TYPE = data.GetMasterId(CommonLayer.TYPE.SPARE.ToString());
            if (!string.IsNullOrEmpty(txtAmountPaid.Text))
            {
                BALANCE balancePaid = new BALANCE()
                {
                    AMOUNT_PAID = Convert.ToDecimal(txtAmountPaid.Text),
                    PAID_DATE = dateTimeInvoiceDate.SelectedDate.Value
                };
                SpareSaleInvoice.BALANCEs.Add(balancePaid);
            }
            data.Insert<SALES_INVOICE>(SpareSaleInvoice);
            gridSpares.ItemsSource = null;
            MessageBox.Show("Spares Details Added Successfully");
        }
		private void detach_BALANCEs(BALANCE entity)
		{
			this.SendPropertyChanging();
			entity.SALES_INVOICE = null;
		}
 partial void DeleteBALANCE(BALANCE instance);
 partial void UpdateBALANCE(BALANCE instance);
 partial void InsertBALANCE(BALANCE instance);