private void ActualizarGrillaComercios()
        {
            I_MenuPrincipal formComercio = this.Owner as I_MenuPrincipal;

            this.GrillaComercios.DataSource = null;

            if (formComercio != null)
            {
                this.GrillaComercios.DataSource = formComercio.ObtenerComercios();
            }
        }
        private void F_GrillaComercios_Load(object sender, EventArgs e)
        {
            this.GrillaComercios.AutoGenerateColumns = false;
            this.GrillaComercios.ColumnCount         = 5;

            this.GrillaComercios.Columns[0].HeaderText       = "ID";
            this.GrillaComercios.Columns[0].DataPropertyName = "ID";
            this.GrillaComercios.Columns[0].Width            = 30;
            this.GrillaComercios.Columns[1].HeaderText       = "Ciudad";
            this.GrillaComercios.Columns[1].DataPropertyName = "Ciudad";
            this.GrillaComercios.Columns[1].Width            = 100;
            this.GrillaComercios.Columns[2].HeaderText       = "Dirección";
            this.GrillaComercios.Columns[2].DataPropertyName = "Direccion";
            this.GrillaComercios.Columns[2].Width            = 237;
            this.GrillaComercios.Columns[3].HeaderText       = "Código Postal";
            this.GrillaComercios.Columns[3].DataPropertyName = "CP";
            this.GrillaComercios.Columns[3].Width            = 50;
            this.GrillaComercios.Columns[4].HeaderText       = "Razón Social";
            this.GrillaComercios.Columns[4].DataPropertyName = "RazonSocial";
            this.GrillaComercios.Columns[4].Width            = 150;

            I_MenuPrincipal owner = this.Owner as I_MenuPrincipal;

            //this.GrillaComercios_1.AutoGenerateColumns = true;
            if (owner != null)
            {
                GrillaComercios.DataSource = owner.ObtenerComercios();
            }

            DataGridViewLinkColumn editar = new DataGridViewLinkColumn();

            editar.HeaderText = "Edicion";
            editar.Text       = "Editar";
            editar.Width      = 50;
            editar.UseColumnTextForLinkValue = true;
            GrillaComercios.Columns.Add(editar);

            DataGridViewLinkColumn eliminar = new DataGridViewLinkColumn();

            eliminar.HeaderText = "Eliminar";
            eliminar.Text       = "Eliminar";
            eliminar.Width      = 50;
            eliminar.UseColumnTextForLinkValue = true;
            GrillaComercios.Columns.Add(eliminar);
        }
Example #3
0
        private void CB_Comercio_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Comercio> ListaComercios = new List <Comercio>();

            I_MenuPrincipal F_MenuPrincipal = this.Owner as I_MenuPrincipal;

            if (F_MenuPrincipal != null)
            {
                ListaComercios = F_MenuPrincipal.ObtenerComercios();
            }
            else
            {
                I_GrillaPrestamos F_GrillaPrestamos = this.Owner as I_GrillaPrestamos;
                if (F_GrillaPrestamos != null)
                {
                    ListaComercios = F_GrillaPrestamos.ObtenerComercios();
                }
            }

            comercio = ListaComercios[CB_Comercio.SelectedIndex];
        }
Example #4
0
        private void F_AltasPrestamos_Load(object sender, EventArgs e)
        {
            List <Comercio> ListaComercios  = new List <Comercio>();
            List <Cliente>  ListaClientes   = new List <Cliente>();
            List <Sucursal> ListaSucursales = new List <Sucursal>();

            I_MenuPrincipal F_MenuPrincipal = this.Owner as I_MenuPrincipal;

            if (F_MenuPrincipal != null)
            {
                ListaComercios  = F_MenuPrincipal.ObtenerComercios();
                ListaClientes   = F_MenuPrincipal.ObtenerClientes();
                ListaSucursales = F_MenuPrincipal.ObtenerSucursales();
            }
            else
            {
                I_GrillaPrestamos F_GrillaPrestamos = this.Owner as I_GrillaPrestamos;
                if (F_GrillaPrestamos != null)
                {
                    ListaComercios  = F_GrillaPrestamos.ObtenerComercios();
                    ListaClientes   = F_GrillaPrestamos.ObtenerClientes();
                    ListaSucursales = F_GrillaPrestamos.ObtenerSucursales();
                }
            }
            foreach (var item in ListaComercios)
            {
                this.CB_Comercio.Items.Add(Convert.ToString(item.RazonSocial));
            }
            foreach (var item in ListaClientes)
            {
                this.CB_Cliente.Items.Add(Convert.ToString(item.Nombre));
            }
            foreach (var item in ListaSucursales)
            {
                this.CB_Sucursal.Items.Add(Convert.ToString(item.ID + " - " + item.Direccion));
            }
        }
Example #5
0
        public List <Comercio> ObtenerComercios()
        {
            I_MenuPrincipal F_MenuPrincipal = this.Owner as I_MenuPrincipal;

            return(F_MenuPrincipal.ObtenerComercios());
        }