bool IVender.Print_Document(IVender_e current, out PrintDocument document) { if (current != null) { Bold = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold); document = new PrintDocument(); PageSettings settings = new PageSettings(); entidade = (Vender_e)current; if (current.GetListPosicao() == Vender_e.ListPosicao.Finalizado) { FontVendaEmpresa = new Font(FontFamily.GenericSerif, 10.0f, FontStyle.Regular); FontVendaCabItem = new Font(FontFamily.GenericSerif, 9.0f, FontStyle.Bold); FontVendaItem = new Font(FontFamily.GenericSerif, 7.0f, FontStyle.Bold); FontEspaco = new Font(FontFamily.GenericSerif, 10.0f, FontStyle.Bold); BrushVendaEmpresa = Brushes.Black; graphicsBASE = CalcArePrintVendaComun(document.PrinterSettings.CreateMeasurementGraphics(), out PaperSize paperSize); graphicsState = graphicsBASE.Save(); settings.PaperSize = paperSize; document.PrintPage += new PrintPageEventHandler(VendaComum); document.DefaultPageSettings.PaperSize = paperSize; document.PrinterSettings.DefaultPageSettings.PaperSize = paperSize; return(true); } else if (current.GetListPosicao() == Vender_e.ListPosicao.Devolucao) { FontVendaEmpresa = new Font(FontFamily.GenericSerif, 10.0f, FontStyle.Regular); FontVendaCabItem = new Font(FontFamily.GenericSerif, 9.0f, FontStyle.Bold); FontVendaItem = new Font(FontFamily.GenericSerif, 7.0f, FontStyle.Bold); FontEspaco = new Font(FontFamily.GenericSerif, 10.0f, FontStyle.Bold); BrushVendaEmpresa = Brushes.Black; graphicsBASE = CalcArePrintDevolucaoComun(document.PrinterSettings.CreateMeasurementGraphics(), out PaperSize paper); settings.PaperSize = paper; document.PrintPage += new PrintPageEventHandler(DevolucaoComum); document.DefaultPageSettings.PaperSize = paper; document.PrinterSettings.DefaultPageSettings.PaperSize = paper; return(true); } else { Noticia.Add("Erro Vender_c Print_Document valor IVender_e nao pode ser gerado"); return(false); } } else { document = null; Noticia.Add("Entidade nula Print_Document"); return(false); } throw new NotImplementedException(); }
bool ICaixa_e.Remover(IVender_e vender_) { if (vender_ != null) { if (vender_.GetListPosicao() == Vender_e.ListPosicao.Devolucao) { vender_.Pagarmento(out IPagar_e _E); this.vCheque = decimal.Subtract(this.vCheque, _E.Cheque); this.vCredito = decimal.Subtract(this.vCredito, _E.Credito); this.vDebito = decimal.Subtract(this.vDebito, _E.Debito); this.vDinheiro = decimal.Subtract(this.vDinheiro, _E.Dinheiro); this.vInterno = decimal.Subtract(this.vInterno, _E.Interno); this.vOutro = decimal.Subtract(this.vOutro, _E.Outro); this.vRecebido = decimal.Subtract(this.vRecebido, _E.Recebido); this.vTroco = decimal.Subtract(this.vTroco, _E.Troco); this.vValeAlimentacao = decimal.Subtract(this.vValeAlimentacao, _E.Vale_Alimentacao); this.vValeRefeicao = decimal.Subtract(this.vValeRefeicao, _E.Vale_Refeicao); this.vDesconto = decimal.Subtract(this.vDesconto, _E.Desconto); this.vVendido = decimal.Subtract(this.vVendido, _E.Cobrado); this.vCancelado = decimal.Add(this.vCancelado, _E.Cobrado); return(true); } else { Noticia.Add("Erro Caixa_e Remover valor Ivender_e nao esta em devolucao"); return(false); } } else { vender_ = null; return(false); } }