Beispiel #1
0
        public static FrmClienteMant Instance()
        {
            if (frmInstance == null || frmInstance.IsDisposed == true)
            {
                frmInstance = new FrmClienteMant();
            }

            frmInstance.BringToFront();

            return(frmInstance);
        }
        private void Editar(UI.Cliente uiCliente)
        {
            try
            {
                var frmClienteMant = FrmClienteMant.Instance();
                frmClienteMant.MdiParent = this.MdiParent;
                frmClienteMant.Show();

                frmClienteMant.frmList = this;
                frmClienteMant.Cargar(uiCliente);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            try
            {
                lastRowIndex = this.dgvClientes.Rows.Count;

                var frmClienteMant = FrmClienteMant.Instance();
                frmClienteMant.MdiParent = this.MdiParent;
                frmClienteMant.Show();

                frmClienteMant.frmList = this;
            }
            catch (Exception ex)
            {
                General.ErrorMessage(ex.Message);
            }
        }