private void OnPrintButtonClick()
        {
            if (CurrentProductWithInvoice == null)
            {
                return;
            }

            if (CurrentProductWithInvoice.Printed())
            {
                if (AppContext.ShowQuestionMessage(StringResource.InvoiceAllReadyPrinted, MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2) != DialogResult.Yes)
                {
                    return;
                }
            }

            var collectContext = AppContext.CollectContext;

            using (new WaitFormScope())
            {
                InvoiceForm.PrintSale(CurrentProductWithInvoice.InvoiceHeader.AlisverisID, collectContext.PrinterName);
                using (var db = new Db(true))
                {
                    db.UpdateInvoicePrinted(CurrentProductWithInvoice.InvoiceHeader.AlisverisID);
                    db.Commit();
                }
            }

            CurrentProductWithInvoice.SetPrinted();
            SetInvoiceStateControls(CurrentProductWithInvoice);
            SelectBarcodeControl();
        }
        private bool OnRePreview(IList <CollectReportLine> lines)
        {
            var firstLine = lines.First();

            InvoiceForm.PreviewSale(firstLine.AlisverisID);
            return(true);
        }
        private bool OnPrint(IList <CollectReportLine> lines)
        {
            var firstLine = lines.First();

            using (new WaitFormScope())
            {
                var collectContext = AppContext.CollectContext;
                InvoiceForm.PrintSale(firstLine.AlisverisID, collectContext.PrinterName);
                using (var db = new Db(true))
                {
                    db.UpdateInvoicePrinted(firstLine.AlisverisID);
                    db.Commit();
                }
                lines.ForEach(p => p.Yazdirildi = true);
            }

            if (firstLine.Completed())
            {
                RemoveFromDatasource(firstLine.AlisverisID);
            }
            else
            {
                grdView.RefreshData();
            }
            return(true);
        }
        private bool OnRePrint(IList <CollectReportLine> lines)
        {
            var firstLine      = lines.First();
            var collectContext = AppContext.CollectContext;

            InvoiceForm.PrintSale(firstLine.AlisverisID, collectContext.PrinterName);
            return(true);
        }
Example #5
0
        private void OnLogin()
        {
            if (!ValidateInputControls())
            {
                return;
            }

            AppContext.Login(txtServerName.Text.Trim(), txtDatabaseName.Text.Trim(), txtUserName.Text.Trim(), txtPassword.Text.Trim());
            SaveSettings();
            //
            InvoiceForm.LoadFormsAsync();
            AppContext.MainForm.ActivateTabContainer();
        }
        private void OnPreviewButtonClick()
        {
            if (CurrentProductWithInvoice == null)
            {
                return;
            }

            using (new WaitFormScope())
            {
                if (!InvoiceForm.PreviewSale(CurrentProductWithInvoice.InvoiceHeader.AlisverisID))
                {
                    return;
                }
                using (var db = new Db())
                {
                    db.UpdateInvoicePrinted(CurrentProductWithInvoice.InvoiceHeader.AlisverisID);
                    db.Commit();
                }
            }
            CurrentProductWithInvoice.SetPrinted();
            SetInvoiceStateControls(CurrentProductWithInvoice);
            SelectBarcodeControl();
        }