Ejemplo n.º 1
0
        private void DetalharObj(int Id)
        {
            AtendimentoModel        oModel     = new AtendimentoModel();
            List <AtendimentoModel> oListModel = new List <AtendimentoModel>();
            AtendimentoNegocios     oNegocios  = new AtendimentoNegocios();

            oModel.Codigo = Id;
            oListModel    = oNegocios.Listar(oModel);
            if (oListModel.Count > 0)
            {
                oModel = oListModel[0];

                Atendimento_Id.Value = oModel.Codigo.ToString();

                ddlAgenda.SelectedValue = oModel.Codigo_Agenda.Value.ToString();
                CodigoFunc.Value        = oModel.Codigo_Funcionario.ToString();

                txData.Text  = ((DateTime)oModel.DataHora).ToString("yyyy-MM-dd");
                txHora.Text  = ((DateTime)oModel.DataHora).ToString("HH:mm");
                txValor.Text = ((Decimal)oModel.Valor).ToString("c2");
                txValor.Focus();
                txtDescricao.Text = oModel.Descricao;


                AgendaModel        oParam            = new AgendaModel();
                AgendaNegocios     oNegocios_Agenda  = new AgendaNegocios();
                List <AgendaModel> oListModel_Agenda = new List <AgendaModel>();
                oParam.Codigo     = oModel.Codigo_Agenda;
                oListModel_Agenda = oNegocios_Agenda.Listar(oParam);
                ddlAgenda         = UTIL.UTIL.PreencheSelect(oListModel_Agenda, ddlAgenda, "Nome_Agendamento", "Codigo", "Selecione");
                ddlAgenda.Enabled = false;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    AtendimentoNegocios oNegocios = new AtendimentoNegocios();

                    List <AtendimentoModel> oList = new List <AtendimentoModel>();
                    oList = oNegocios.Listar(new AtendimentoModel());
                    if (oList.Count > 0)
                    {
                        Rpt.DataSource = oList;
                        Rpt.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EROOR", "$(document).MensagemModal(3,'Ocorreu um erro inesperado! Mensagem = " + new JavaScriptSerializer().Serialize(ex.Message.ToString()) + "');", true);
                }
            }
        }