コード例 #1
0
        //protected void txt_Imposto_

        #endregion

        #region metodos

        private void CarregarTela()
        {
            var corretores = new ListarCorretorRepositorio().Listar();


            carregarCorretor((List <corretor_tb>)corretores);

            var agenciadores = new ListarAgenciadorRepositorio().Listar();

            carregarAgenciador((List <agenciador_tb>)agenciadores);

            if (!string.IsNullOrEmpty(Request["id"]))
            {
                comissao = new ComissaoRepositorio().RecuperarPelaChave(Convert.ToInt32(Request["id"]));

                //chkAgenciamento.Checked = Convert.ToBoolean(proposta.agenciamento);
                //txtCodigo.Text = proposta.codigo.ToString();
                //txtDataEmissao.Text = proposta.data_emissao.ToString();
                //txtDataProposta.Text = proposta.data_proposta.ToString();
                //txtParcelamento.Text = proposta.parcelamento.ToString();
                //txtPremio.Text = proposta.premio_liquido.ToString();
                //txtPercentual.Text = proposta.percentual_comissao.ToString();
                //chkAgenciamento.Checked = Convert.ToBoolean(proposta.agenciamento);
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CarregarTela();
            }



            if (!string.IsNullOrEmpty(Request["id"]))
            {
                comissao = new ComissaoRepositorio().RecuperarPelaChave(Convert.ToInt32(Request["id"]));

                //chkAgenciamento.Checked = Convert.ToBoolean(proposta.agenciamento);
                //txtCodigo.Text = proposta.codigo.ToString();
                //txtDataEmissao.Text = proposta.data_emissao.ToString();
                //txtDataProposta.Text = proposta.data_proposta.ToString();
                //txtParcelamento.Text = proposta.parcelamento.ToString();
                //txtPremio.Text = proposta.premio_liquido.ToString();
                //txtPercentual.Text = proposta.percentual_comissao.ToString();
                //chkAgenciamento.Checked = Convert.ToBoolean(proposta.agenciamento);

                estado = EntityState.Modified;
            }
            else
            {
                estado = EntityState.Added;
            }



            if (!string.IsNullOrEmpty(Request["proposta_id"]))
            {
                proposta_id = Convert.ToInt16(Request["proposta_id"]);
                proposta_tb proposta = new PropostaRepositorio().RecuperarPelaChave(proposta_id);
                //txtValorBruto.Text = proposta.premio_liquido.ToString();
            }

            //else if (!string.IsNullOrEmpty(comissao.recibo_comissao_id.ToString())) cotacao_id = proposta.cotacao_id;

            //txtDataEmissao.Text = System.DateTime.Now.ToString();
            //txtDataProposta.Text = System.DateTime.Now.ToString();
            ////txtPremio.Text = string.IsNullOrEmpty(Request["premio"]) ? "" : Request["premio"].ToString();
            txtValorBruto.Enabled   = false;
            txtValorLiquido.Enabled = false;
        }
コード例 #3
0
        private void inserir()
        {
            comissao = new recibo_comissao_tb();
            carregarEntidade();

            using (var ctx = new CTX_GERCOM())
            {
                try
                {
                    ctx.recibo_comissao_tb.Add(comissao);
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }