Пример #1
0
 bool IVender.Continuar_Registro(object current, out IVender_e vender_)
 {
     if (current != null)
     {
         if (current is IVender_e)
         {
             vender_ = (IVender_e)current;
             if (vender_.Get_Finish_Time == Vender_e._ValuaBaseFinishTime)
             {
                 return(true);
             }
             else
             {
                 Noticia.Add("Erro Vender_c Continuar_Registro Finish Time modificado");
                 return(false);
             }
         }
         else
         {
             Noticia.Add("Erro Vender_c Select valor current nao e IVender_e");
             vender_ = null;
             return(false);
         }
     }
     else
     {
         Noticia.Add("Erro Valor current nullo");
         vender_ = null;
         return(false);
     }
 }
Пример #2
0
 bool IVender_e.Join(IVender_e vender_)
 {
     if (vender_ != null)
     {
         Vender_e _E = (Vender_e)vender_;
         if (_E._Posicao == ListPosicao.Iniciado)
         {
             foreach (IItem_e item in _E._item_e_s)
             {
                 var temptotalvenda = this._Total_Venda;
                 this._Total_Venda = decimal.Add(this._Total_Venda, item.Get_Sub_Total);
                 string format = "Total Venda {0} valor anterio {1} diferenca adicionado {2}";
                 Noticia.Add(string.Format(format, this._Total_Venda, temptotalvenda, item.Get_Sub_Total));
                 _item_e_s.Add(item);
             }
             return(true);
         }
         else
         {
             Noticia.Add("Vender_e Join Valor Ivender_e nao pode ser juntado");
             return(false);
         }
     }
     else
     {
         Noticia.Add("Vender_e Join valor nulo");
         return(false);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 bool ICaixa_e.Add(IVender_e entidade)
 {
     if (entidade != null)
     {
         if (entidade.Get_Finish_Time == Vender_e._ValuaBaseFinishTime)
         {
             Noticia.Add("Caixa_e Add IVender_e nao ta finalizado");
             return(false);
         }
         else
         {
             entidade.Pagarmento(out IPagar_e _E);
             this.vCheque          = decimal.Add(this.vCheque, _E.Cheque);
             this.vCredito         = decimal.Add(this.vCredito, _E.Credito);
             this.vDebito          = decimal.Add(this.vDebito, _E.Debito);
             this.vDinheiro        = decimal.Add(this.vDinheiro, _E.Dinheiro);
             this.vInterno         = decimal.Add(this.vInterno, _E.Interno);
             this.vOutro           = decimal.Add(this.vOutro, _E.Outro);
             this.vRecebido        = decimal.Add(this.vRecebido, _E.Recebido);
             this.vTroco           = decimal.Add(this.vTroco, _E.Troco);
             this.vValeAlimentacao = decimal.Add(this.vValeAlimentacao, _E.Vale_Alimentacao);
             this.vValeRefeicao    = decimal.Add(this.vValeRefeicao, _E.Vale_Refeicao);
             this.vDesconto        = decimal.Add(this.vDesconto, _E.Desconto);
             this.vVendido         = decimal.Add(this.vVendido, _E.Cobrado);
             return(true);
         }
     }
     else
     {
         Noticia.Add("Caixa_e Add IVender valor Nullo");
         return(false);
     }
     //entidade.Pagarmento
     throw new NotImplementedException();
 }
Пример #5
0
 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);
     }
 }
Пример #6
0
        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();
        }
Пример #7
0
 bool IVender.Select(object current, out IVender_e vender_)
 {
     if (current != null)
     {
         if (current is IVender_e)
         {
             vender_ = (IVender_e)current;
             return(true);
         }
         else
         {
             Noticia.Add("Erro Vender_c Select valor current nao e IVender_e");
             vender_ = null;
             return(false);
         }
     }
     else
     {
         Noticia.Add("Erro Valor current nullo");
         vender_ = null;
         return(false);
     }
 }
Пример #8
0
 bool IVender.Pagar_Novo(IVender_e entidade, out IPagar_e pagar_)
 {
     if (entidade != null)
     {
         if (entidade.Get_Finish_Time == Vender_e._ValuaBaseFinishTime)
         {
             pagar_ = new Pagar_e(entidade.Get_Valor_Total);
             return(true);
         }
         else
         {
             Noticia.Add("IVender_e.finish_time ja alterado");
             pagar_ = null;
             return(false);
         }
     }
     else
     {
         pagar_ = null;
         Noticia.Add("IVender_e valor nullo");
         return(false);
     }
 }
Пример #9
0
 bool IVender.Item_Novo(IVender_e entidade, out IItem_e item_)
 {
     if (entidade != null)
     {
         if (entidade.Get_Finish_Time == Vender_e._ValuaBaseFinishTime)
         {
             item_ = new Item_e(index_item: entidade.Get_Total_Item + 1);
             return(true);
         }
         else
         {
             Noticia.Add("IVender_e.finish_time ja alterado");
             item_ = null;
             return(false);
         }
     }
     else
     {
         item_ = null;
         Noticia.Add("IVender_e valor nullo");
         return(false);
     }
 }
Пример #10
0
        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);
            }
        }