Exemplo n.º 1
0
        public Framework.DataServices.Model.EntityBaseData Load(string currentUser, Framework.DataServices.Model.EntityBaseData entry, out int errorNumber, out string errorDescription)
        {
            errorNumber      = 0;
            errorDescription = null;

            Model.Boloes.Pagamento entryData = (Model.Boloes.Pagamento)entry;


            DataTable table = base.ExecuteFill(CommandType.StoredProcedure, base._commandSelect, true, currentUser,
                                               base.Parameters.Create("@DataPagamento", DbType.DateTime, entryData.DataPagamento),
                                               base.Parameters.Create("@UserName", DbType.String, entryData.UserName),
                                               base.Parameters.Create("@NomeBolao", DbType.String, entryData.Bolao.Nome),
                                               base.Parameters.Create("@ReturnValue", DbType.Int32, ParameterDirection.ReturnValue, null)
                                               );

            int rowsFound = Convert.ToInt32(base.ExecutionStatus.Command.Parameters["@ReturnValue"].Value);

            if (rowsFound == 0)
            {
                return(null);
            }
            //throw new Exception("There is no item found in database with this ID.");


            errorNumber      = base.ExecutionStatus.ErrorNumber;
            errorDescription = base.ExecutionStatus.ErrorDescription;


            return(ConvertToObject(table.Rows[0]));
        }
Exemplo n.º 2
0
        private void ShowPagamento(Model.Boloes.Pagamento entry)
        {
            this.lblBolao.Text                  = entry.Bolao.Nome;
            this.cboUser.SelectedValue          = entry.UserName;
            this.txtDataPagamento.Text          = entry.DataPagamento.ToString("dd/MM/yyyy");
            this.txtDescricao.Text              = entry.Descricao;
            this.txtValor.Text                  = entry.Valor.ToString();
            this.cboTipoPagamento.SelectedValue = ((int)entry.TipoPagamento).ToString();



            if (this.lblBolao.Text.Length == 0)
            {
                this.lblBolao.Text = CurrentBolao.Nome;
            }
        }
Exemplo n.º 3
0
        private Model.Boloes.Pagamento GetPagamento()
        {
            Model.Boloes.Pagamento entry = Pagamento;

            if (entry == null)
            {
                entry          = new BolaoNet.Model.Boloes.Pagamento();
                entry.Bolao    = new BolaoNet.Model.Boloes.Bolao(this.lblBolao.Text);
                entry.UserName = this.cboUser.Text;
            }

            entry.TipoPagamento = (BolaoNet.Model.Boloes.Pagamento.Tipo)Convert.ToInt16(this.cboTipoPagamento.SelectedValue);
            entry.DataPagamento = Convert.ToDateTime(this.txtDataPagamento.Text);
            entry.Descricao     = this.txtDescricao.Text;
            entry.Valor         = Convert.ToDecimal(this.txtValor.Text);

            return(entry);
        }
Exemplo n.º 4
0
        public bool Delete(string currentUser, Framework.DataServices.Model.EntityBaseData entry, out int errorNumber, out string errorDescription)
        {
            errorNumber      = 0;
            errorDescription = null;

            Model.Boloes.Pagamento entryData = (Model.Boloes.Pagamento)entry;

            base.ExecuteNonQuery(CommandType.StoredProcedure, base._commandDelete, true, currentUser,
                                 base.Parameters.Create("@DataPagamento", DbType.DateTime, entryData.DataPagamento),
                                 base.Parameters.Create("@UserName", DbType.String, entryData.UserName),
                                 base.Parameters.Create("@NomeBolao", DbType.String, entryData.Bolao.Nome),
                                 base.Parameters.Create("@ReturnValue", DbType.Int32, ParameterDirection.ReturnValue, null)
                                 );

            errorNumber      = base.ExecutionStatus.ErrorNumber;
            errorDescription = base.ExecutionStatus.ErrorDescription;


            return(Convert.ToInt32(base.ExecutionStatus.Command.Parameters["@ReturnValue"].Value) >= 1 ? true : false);
        }