Пример #1
0
        public DelOrder()
        {
            InitializeComponent();
            c       = new CrudComp();
            _listaP = new Dictionary <Prodotto, int>();
            int temp = 0, maxWidth = 0;

            foreach (Cliente c in c.SearchAllCliente())
            {
                cbxCliente.Items.Add(c);

                temp = TextRenderer.MeasureText(c.ToString(), cbxCliente.Font).Width;
                if (temp > maxWidth)
                {
                    maxWidth = temp;
                }
            }
            if (cbxCliente.Items.Count != 0)
            {
                cbxCliente.SelectedIndex = 0;
                cbxCliente.DropDownWidth = maxWidth;
            }
            foreach (TipiPagamento t in c.SearchAllTipiPagamento())
            {
                cbxPagamento.Items.Add(t);
            }
            if (cbxPagamento.Items.Count != 0)
            {
                cbxPagamento.SelectedIndex = 0;
            }
        }
        public ProductsToOrder(Form f, Dictionary <Prodotto, int> d1)
        {
            InitializeComponent();
            txtModProd.Enabled = true;
            cbxModProd.Enabled = true;
            btnModProd.Enabled = true;
            dReceived          = d1;
            FillShowProd();
            c = new CrudComp();
            int temp = 0, maxWidth = 0;

            foreach (Prodotto p in c.SearchAllProdotto())
            {
                cbxNewProd.Items.Add(p);
                temp = TextRenderer.MeasureText(p.ToString(), cbxNewProd.Font).Width;
                if (temp > maxWidth)
                {
                    maxWidth = temp;
                }
            }
            if (cbxNewProd.Items.Count != 0)
            {
                cbxNewProd.SelectedIndex = 0;
                cbxNewProd.DropDownWidth = maxWidth;
            }
            FillCheckBox(cbxModProd, dReceived);

            FillCheckBox(cbxDelProd, dReceived);
        }
Пример #3
0
 public UpdCategory()
 {
     InitializeComponent();
     c = new CrudComp();
     cbxIva.Items.Add("4");
     cbxIva.Items.Add("10");
     cbxIva.Items.Add("22");
     cbxIva.SelectedIndex = 2;
 }
Пример #4
0
 public ShowAll()
 {
     InitializeComponent();
     c = new CrudComp();
     rdbCategory.CheckedChanged += new EventHandler(radioButtons_CheckedChanged);
     rdbClient.CheckedChanged   += new EventHandler(radioButtons_CheckedChanged);
     rdbOrder.CheckedChanged    += new EventHandler(radioButtons_CheckedChanged);
     rdbProduct.CheckedChanged  += new EventHandler(radioButtons_CheckedChanged);
 }
Пример #5
0
        public override string ToString()
        {
            string fattura = "ID: " + _id + ", Codice: " + _codiceordine + "\r\n" + _cliente.ToString()
                             + "Data: " + _data + ", " + _tipopagamento.ToString() + "\r\nProdotti:\r\n";

            foreach (KeyValuePair <Prodotto, int> p in _listaprodotti)
            {
                fattura += p.Key.Denominazione + ", prezzo (iva inclusa): " + p.Key.PrezzoIvato() + "€, quantità: " + p.Value + "\r\n";
            }
            CrudComp c = new CrudComp();

            return(fattura += "Totale con Iva: " + TotaleIvato() +
                              "€\r\nTotale Complessivo: " + c.PrezzoTotaleOrdineConSconto(_id) + "€\r\n");
        }
Пример #6
0
 public Form1()
 {
     InitializeComponent();
     try
     {
         c = new CrudComp();
         c.DashBoardCreation(textBox1);
     }
     catch (SqlException)
     {
         MessageBox.Show("Connessione al database non funzionante, controlla per favore i dati di connessione.");
         tsmNew.Enabled       = false;
         tsmUpdate.Enabled    = false;
         tsmDelete.Enabled    = false;
         tsmElenco.Enabled    = false;
         tsmDettaglio.Enabled = false;
     }
 }
Пример #7
0
        public UpdProduct()
        {
            InitializeComponent();
            cc = new CrudComp();
            List <Categoria> l = cc.SearchAllCategoria();
            int temp = 0, maxWidth = 0;

            foreach (Categoria cat in l)
            {
                cbxCategoria.Items.Add(cat);
                temp = TextRenderer.MeasureText(cat.ToString(), cbxCategoria.Font).Width;
                if (temp > maxWidth)
                {
                    maxWidth = temp;
                }
            }
            if (cbxCategoria.Items.Count != 0)
            {
                cbxCategoria.SelectedIndex = 0;
                cbxCategoria.DropDownWidth = maxWidth;
            }
        }
Пример #8
0
 public NewClient()
 {
     InitializeComponent();
     c = new CrudComp();
 }
Пример #9
0
 public ShowByID()
 {
     InitializeComponent();
     c = new CrudComp();
 }