protected override bool Select_All_From(out IVender_e[] vender_s) { if (Hope.Hope_static.hopeData.Vender.Count != 0) { List <IVender_e> vs = new List <IVender_e>(); foreach (HopeDataSet.VenderRow item in Hope.Hope_static.hopeData.Vender.Rows) { IVender_e vender_E = new Vender_e ( index: item.Index, id_caixa: item.ID_Caixa, start_time: item.Data_Time_Start, finish_time: item.Data_Time_Finish, posicao: item.Posicao, colaborador: item.Colaborador, item_s: item.Item_s, troco: item.Troco, recebido: item.Total_Recebido, total_venda: item.Total_Venda, desconto: item.Desconto, pagamento: item.Pagamento ); vs.Add(vender_E); } vender_s = vs.ToArray(); return(true); } else { Noticia.Add("Nao existe registro"); vender_s = null; return(false); } }
bool IVender.Novo(ICaixa_e caixaOperacao, out IVender_e vender_) { if (Hope.Hope_static.Autenticacao.Autenticado) { if (caixaOperacao != null) { if (DateTime.Parse(caixaOperacao.Get_finish_DateTime) == Caixa_e._ValueFinisTime) { if (Insert_New_Row(caixaOperacao.Get_ID, out Dictionary <int, object> result)) { vender_ = new Vender_e ( index: result[Vender_e.Key_Index], id_caixa: result[Vender_e.Key_ID_Caixa], start_time: result[Vender_e.Key_Start_Time], finish_time: result[Vender_e.Key_Finish_Time], posicao: result[Vender_e.Key_Posicao], colaborador: result[Vender_e.Key_Colaborado], item_s: result[Vender_e.Key_Item_s], troco: result[Vender_e.Key_Troco], recebido: result[Vender_e.Key_Total_Recebido], total_venda: result[Vender_e.Key_Total_Venda], desconto: result[Vender_e.Key_Desconto], pagamento: result[Vender_e.Key_Pagamento] ); return(true); } else { vender_ = null; return(false); } } else { Noticia.Add("Entidade ICaixa_e valor finish_DateTime alterado"); vender_ = null; return(false); } } else { Noticia.Add("Entidade ICaixa_e valor Nullo"); vender_ = null; return(false); } } else { Noticia.Add("Nao esta logado Venda Novo"); vender_ = null; return(false); } }
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 IVender.Gravar(IVender_e vender) { if (vender != null) { Vender_e _E = (Vender_e)vender; switch (_E._Posicao) { case Vender_e.ListPosicao.Iniciado: _E._Posicao = Vender_e.ListPosicao.Aberto; goto case Vender_e.ListPosicao.Aberto; break; case Vender_e.ListPosicao.Aberto: if (_E.Dispariedade()) { if (Update_Row(_E.GetKeyValuesData())) { return(true); } else { Noticia.Add("Erro ao atualizar linha do banco de dados"); return(false); } } else { Noticia.Add("Nao a diferenca a ser salva "); return(false); } break; case Vender_e.ListPosicao.Espera: return(false); break; case Vender_e.ListPosicao.Pago: return(false); break; case Vender_e.ListPosicao.Finalizado: if (Update_Row(_E.GetKeyValuesData())) { return(true); } else { Noticia.Add("Erro ao atualizar linha do banco de dados"); return(false); } break; case Vender_e.ListPosicao.Aborta: if (Deletar_Row(_E.GetKeyValuesData())) { return(true); } else { Noticia.Add("Erro ao atualizar linha do banco de dados"); return(false); } break; case Vender_e.ListPosicao.Devolucao: if (Update_Row(_E.GetKeyValuesData())) { return(true); } else { Noticia.Add("Erro ao atualizar linha do banco de dados"); return(false); } break; default: return(false); break; } } else { Noticia.Add("Erro IVender_e nullo"); return(false); } }