CreateInvoice() public method

public CreateInvoice ( string submissionDate, string entryDate, string from ) : void
submissionDate string
entryDate string
from string
return void
示例#1
0
        private void calculationControl1_PrintInvoice()
        {
            Invoice invoice = new Invoice();

            commissionControl1.CalculateCommission(calculationControl1.Order);
            invoice.CreateInvoice(calculationControl1.Order);
        }
        protected void btnExecute_Click(object sender, EventArgs e)
        {
            //Define a workbook to store null value initially
            Workbook workbook = null;

            string path = MapPath(".");
            path = path.Substring(0, path.LastIndexOf("\\"));

            Invoice invoice = new Invoice(path);

            //Create the workbook based on a custom method of a class
            workbook = invoice.CreateInvoice();

            if (ddlFileVersion.SelectedItem.Value == "XLS")
            {
                ////Save file and send to client browser using selected format
                workbook.Save(HttpContext.Current.Response, "Invoice.xls", ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));
            }
            else
            {
                workbook.Save(HttpContext.Current.Response, "Invoice.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));
            }

            //end response to avoid unneeded html
            HttpContext.Current.Response.End();
        }
示例#3
0
        static void Main(string[] args)
        {
            #region SRP
            Supplier supplier = new Supplier();
            supplier.ChangeName("Paulo Steinberg");

            ISupplierRepository repository = new SupplierRepository();
            repository.Save(supplier);
            #endregion

            #region OCP
            Person person = new Person("Paulo");
            person.ChangeName("Paulo Steinberg");

            NaturalPerson nPerson = new NaturalPerson("Paulo Steinberg", "123.123.123.12");
            #endregion

            #region LSP
            Car car = new Car();
            car.TurnOn();
            car.SpeedUp();
            #endregion

            #region ISP
            Invoice invoice = new Invoice();
            invoice.CreateInvoice();
            #endregion

            #region DIP

            var DIPrepository   = new CustomerRepository();
            var customerService = new CustomerService(DIPrepository);

            #endregion
        }
        public void MakeInvoicePart()
        {
            Invoice invoice = DependencyResolver.Container.Resolve <Invoice>();
            Faktura invoiceInstance;

            invoiceInstance            = AddInvoicePanel2.invoice2;
            invoiceInstance.Sprzedawca = MakeSeller();

            invoice.CreateInvoice(invoiceInstance);
            //return invoice;
        }
    protected void btnCreateInvoice_Click(object sender, EventArgs e)
    {
        Invoice inv = new Invoice(ConfigurationManager.AppSettings["connString"].ToString());

        string EndDate = this.txtEndDate.Text.Replace("/", "-");

        EndDate = EndDate.Substring(3, 2) + "-" + EndDate.Substring(0, 2) + "-" + EndDate.Substring(6, 4);

        if (inv.CreateInvoice(this.lstClient.SelectedValue.ToString(), Session["UserId"].ToString(), EndDate))
        {
            DataSet ds = inv.GetInvoiceHistory(this.lstClient.SelectedValue.ToString());

            this.lstClientHistory.DataSource     = ds;
            this.lstClientHistory.DataTextField  = "InvoiceDate";
            this.lstClientHistory.DataValueField = "InvoiceId";
            this.lstClientHistory.DataBind();

            this.lstClientHistory.Items.Insert(0, "-- Current invoice --");
            this.lstClientHistory.SelectedIndex = ds.Tables[0].Rows.Count;
            this.btnCreateInvoice.Attributes.Add("style", "visibility:hidden");
        }
    }
示例#6
0
        /// <summary>
        /// Окно создания / редактирования накладной
        /// </summary>
        /// <param name="isPurchase">TRUE - приходная накладная, FALSE - расходная накладная</param>
        /// <param name="id">ID редактируемой накладной, если 0, создается новая накладная</param>
        public InvoiceWindow(bool isPurchase, int id = 0)
        {
            InitializeComponent();

            this.Title = (isPurchase) ? "Приходная накладная" : "Расходная накладная";

            if (id == 0)
            {
                // Создание накладной
                CurrentInvoice = Invoice.CreateInvoice(isPurchase);
            }
            else
            {
                // Загрузка накладной
                CurrentInvoice = Invoice.GetInvoiceByID(isPurchase, id);
            }

            // Загрузка контрагентов
            if (isPurchase)
            {
                Counterparties = Counterparty.GetProviderList().OrderBy(c => c.VisibleName).ToList();
            }
            else
            {
                Counterparties = Counterparty.GetCustomerList().OrderBy(c => c.VisibleName).ToList();
            }

            foreach (Counterparty customer in Counterparties)
            {
                cbCounterparty.Items.Add(customer.VisibleName);
            }

            if (CurrentInvoice.ID_Counterparty != 0)
            {
                Counterparty currCounterparty = Counterparties.FirstOrDefault(c => c.ID == CurrentInvoice.ID_Counterparty);

                if (currCounterparty != null)
                {
                    cbCounterparty.SelectedItem = currCounterparty.VisibleName;
                }
                else
                {
                    CurrentInvoice.GetUsers();

                    if (CurrentInvoice.CounterpartyUser != null)
                    {
                        cbCounterparty.Items.Add(CurrentInvoice.CounterpartyUser.VisibleName);
                        cbCounterparty.SelectedItem = currCounterparty.VisibleName;
                    }
                    else
                    {
                        cbCounterparty.SelectedIndex = 0;
                    }
                }
            }

            // Загрузка списка товара
            ProductList = (isPurchase)? Product.GetActualProductList() : Product.GetProductListByParameters(true, true);

            GetFreeProductList();

            tbExecutor.Text = Account.GetAccountByID(CurrentInvoice.ID_Account).PersonalData.VisibleName;

            // Активация элементов в зависимости от типа накладной
            if (CurrentInvoice.IsPurchase)
            {
                btnLockInvoice.Visibility      = Visibility.Collapsed;
                grColumnCostSales.Visibility   = Visibility.Collapsed;
                grColumnCouponSales.Visibility = Visibility.Collapsed;
                grColumnCountSales.Visibility  = Visibility.Collapsed;
            }
            else
            {
                grColumnCostPurchase.Visibility   = Visibility.Collapsed;
                grColumnCountPurchase.Visibility  = Visibility.Collapsed;
                grColumnCouponPurchase.Visibility = Visibility.Collapsed;
            }

            this.DataContext = CurrentInvoice;
        }