Esempio n. 1
0
        private void dgvCLIENTES_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvCLIENTES.CurrentRow == null)
            {
                MessageBox.Show("Debe seleccionar un Cliente");
                return;
            }
            oCLIENTE = (MODELO.Cliente)dgvCLIENTES.CurrentRow.DataBoundItem;

            this.DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
        private void btnLUPA_Click(object sender, EventArgs e) // lupa cliente
        {
            CLIENTES.frmCLIENTES frm = new CLIENTES.frmCLIENTES();
            DialogResult         dr  = frm.ShowDialog();

            if (dr == DialogResult.OK)
            {
                oCliente = frm.ClienteSelect;

                clientesovicj = oCliente;
            }
            txtCLIENTE.Text = oCliente.nombre;
        }
Esempio n. 3
0
        private void BtnMODIFICAR_Click_1(object sender, EventArgs e)
        {
            if (dgvCLIENTES.CurrentRow == null)
            {
                MessageBox.Show("Debe seleccionar un articulo");
                return;
            }
            MODELO.Cliente oCliente = (MODELO.Cliente)dgvCLIENTES.CurrentRow.DataBoundItem;
            frmCLIENTE     frm      = new frmCLIENTE(oCliente, "M");
            DialogResult   dr       = frm.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ARMO_GRILLA();
            }
        }
Esempio n. 4
0
        private void BtnELIMINAR_Click_1(object sender, EventArgs e)
        {
            if (dgvCLIENTES.CurrentRow == null)
            {
                MessageBox.Show("Debe seleccionar un articulo");
                return;
            }
            MODELO.Cliente oCliente = (MODELO.Cliente)dgvCLIENTES.CurrentRow.DataBoundItem;
            DialogResult   dr       = MessageBox.Show("¿Confirma que desea eliminar " + oCliente.nombre + "?", "CONFIRMA", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                cCliente.eliminarCliente(oCliente);
                ARMO_GRILLA();
            }
        }
Esempio n. 5
0
        public frmCLIENTE(MODELO.Cliente unCliente, string unaaccion)
        {
            InitializeComponent();
            cCliente = CONTROLADORA.cCliente.obtener_instancia();
            oCliente = unCliente;
            accion   = unaaccion;
            ARMO_LOCALIDAD();
            if (accion != "A")
            {
                cmbTIPOD.Text       = oCliente.tipoDocumento;
                txtRAZONSOCIAL.Text = oCliente.razonSocial;
                txtNOMBRE.Text      = oCliente.nombre;
                txtAPELLIDO.Text    = oCliente.apellido;
                txtDOCUMENTO.Text   = oCliente.documento.ToString();
                txtTELEFONO.Text    = oCliente.telefono.ToString();
                txtMAIL.Text        = oCliente.mail;
                txtDIRECCION.Text   = oCliente.direccion;
                cmbTIPO.Text        = oCliente.tipo;
                cmbESTADO.Text      = oCliente.estado;

                if (accion == "C")
                {
                    txtAPELLIDO.Enabled    = false;
                    txtDIRECCION.Enabled   = false;
                    txtDOCUMENTO.Enabled   = false;
                    txtMAIL.Enabled        = false;
                    txtNOMBRE.Enabled      = false;
                    txtRAZONSOCIAL.Enabled = false;
                    txtTELEFONO.Enabled    = false;
                    cmbESTADO.Enabled      = false;
                    cmbLOCALIDAD.Enabled   = false;
                    cmbTIPO.Enabled        = false;
                    btnGUARDAR.Visible     = false;
                    cmbTIPOD.Enabled       = false;
                    btnLupa.Enabled        = false;
                }
            }
        }
Esempio n. 6
0
 public void modificarCliente(MODELO.Cliente oCliente)
 {
     oMODELO_SEGURIDAD.Entry(oCliente).State = System.Data.Entity.EntityState.Modified;
     oMODELO_SEGURIDAD.SaveChanges();
 }
Esempio n. 7
0
 public void eliminarCliente(MODELO.Cliente oCliente)
 {
     oMODELO_SEGURIDAD.CLIENTES.Remove(oCliente);
     oMODELO_SEGURIDAD.SaveChanges();
 }
Esempio n. 8
0
 public void agregarCliente(MODELO.Cliente oCliente)
 {
     oMODELO_SEGURIDAD.CLIENTES.Add(oCliente);
     oMODELO_SEGURIDAD.SaveChanges();
 }