Ejemplo n.º 1
0
        public static bool PreviewSale(string alisveriId)
        {
            try
            {
                EnsureFormLoaded();

                using (var db = new Db())
                {
                    _saleForm.DataSource = db.GetSaleInvoiceFormDatasource(alisveriId);
                    _saleForm.CreateDocument();
                }

                var control = new UcPrint
                {
                    Document = _saleForm
                };
                control.Initialize();

                WaitFormScope.CloseIfOpened();
                return(FlyoutDialog.Show(AppContext.MainForm, control) == DialogResult.OK);
            }
            catch (Exception ex)
            {
                AppContext.Logger.Error(ex);
                throw new B2CPackageCollectException(StringResource.OperationFailedRetry);
            }
        }
Ejemplo n.º 2
0
        public void InitFrm(int cants, int canprint, int cansent)
        {
            this.tbCtrlMain.TabPages.Clear();
            if (cants == 1)
            {
                this.tbCtrlMain.TabPages.Add(this.tPTs);
                this.ucts      = new UcTs();
                this.ucts.Dock = DockStyle.Fill;
                this.tPTs.Controls.Add(this.ucts);
            }
            if (canprint == 1)
            {
                this.tbCtrlMain.TabPages.Add(this.tPPrint);
                this.ucPrint      = new UcPrint();
                this.ucPrint.Dock = DockStyle.Fill;
                this.tPPrint.Controls.Add(this.ucPrint);
            }
            if (cansent == 1)
            {
                this.tbCtrlMain.TabPages.Add(this.tPSent);
                this.ucSent         = new UcSent();
                this.ucSent.IsSUIJI = false;
                this.ucSent.Dock    = DockStyle.Fill;
                this.tPSent.Controls.Add(this.ucSent);
            }
            if (cansent == 2)
            {
                this.tbCtrlMain.TabPages.Add(this.tPSent);
                this.ucSent         = new UcSent();
                this.ucSent.IsSUIJI = true;
                this.ucSent.Dock    = DockStyle.Fill;
                this.tPSent.Controls.Add(this.ucSent);
            }
            this.ucsta      = new UCSta();
            this.ucsta.Dock = DockStyle.Fill;
            this.tbSta.Controls.Add(this.ucsta);

            this.tbCtrlMain.TabPages.Add(this.tpInfo);
            this.tbCtrlMain.TabPages.Add(this.tbSta);
        }