protected void btnGuardar_Click(object sender, EventArgs e)
        {
            CN_CatCNac_Matriz negCliente = (CN_CatCNac_Matriz)Session["CNCliente"];
            CatCNac_Matriz    cliente    = new CatCNac_Matriz();


            if (Logo.PostedFile != null)
            {
                MemoryStream target = new MemoryStream();
                Logo.PostedFile.InputStream.CopyTo(target);
                cliente.Logo = target.ToArray();
            }

            object objCN_Cliente = cliente;

            AsignacionCampos.AsignaCamposEntidad(ref objCN_Cliente, "", this);

            if (Request.QueryString["Id"] == null || Request.QueryString["Id"] == "undefined")
            {
                cliente.Id = negCliente.ConsultarMax() + 1;
                negCliente.Nuevo(cliente);
            }
            else
            {
                int id = Int32.Parse(Request.QueryString["Id"]);
                cliente.Id = id;
                negCliente.Editar(cliente);
            }

            RAM1.ResponseScripts.Add("CloseAlert('Los datos se guardaron correctamente');");
        }
Exemple #2
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            if (repClientes != null)
            {
                CN_CatCNac_Matriz cn_CNCliente = new CN_CatCNac_Matriz(model);
                Session["CNCliente"] = cn_CNCliente;

                this.repClientes.DataSource = cn_CNCliente.ConsultarItem(txtNombre.Text);
                this.repClientes.DataBind();
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var permisos = new PermisosSesion(this.Page);

            permisos.ValidarSesion();
            if (!Page.IsPostBack)
            {
                if (repClientes != null)
                {
                    CN_CatCNac_Matriz cn_CNCliente = new CN_CatCNac_Matriz(model);
                    Session["CNCliente"] = cn_CNCliente;

                    this.repClientes.DataSource = cn_CNCliente.ConsultarTodos();
                    this.repClientes.DataBind();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var permisos = new PermisosSesion(this.Page);

            permisos.ValidarSesion();


            if (!Page.IsPostBack)
            {
                if (Request.QueryString["Id"] != "undefined")
                {
                    //permisos.ValidarPermisos(this.rtb1);

                    int id = Int32.Parse(Request.QueryString["Id"]);

                    CN_CatCNac_Matriz negCliente = (CN_CatCNac_Matriz)Session["CNCliente"];
                    var cliente = negCliente.ConsultarItem(id);

                    object objCN_Cliente = cliente;
                    AsignacionCampos.AsignaCamposForma(ref objCN_Cliente, "", this);
                }
            }
        }
Exemple #5
0
        protected void rgFranquicias_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.IsInEditMode == true)
            {
                GridEditableItem insertItem = (GridEditableItem)e.Item;
                RadComboBox      combo      = (RadComboBox)insertItem["UsuarioIntranet"].FindControl("cmbUsuarioIntranet");

                CN_CatCNac_Matriz cm_Matriz = new CN_CatCNac_Matriz(model);
                int idMatriz = Int32.Parse(Request.QueryString["Id"]);

                combo.DataSource = cm_Matriz.ComboIntranetUsuarios();
                combo.DataBind();

                RadComboBox         comboBox         = (RadComboBox)insertItem["UsuarioIntranet"].FindControl("cmbMoneda");
                CN_CatClienteMatriz cm_ClienteMatriz = (CN_CatClienteMatriz)Session["cm_Matriz"];

                comboBox.DataSource = cm_ClienteMatriz.ComboMoneda();
                comboBox.DataBind();

                RadComboBox comboProductos = (RadComboBox)insertItem["UsuarioIntranet"].FindControl("cmbProductos");
                comboProductos.DataSource = cm_ClienteMatriz.ComboProdPermitidos();
                comboProductos.DataBind();
            }
        }