Exemplo n.º 1
0
    protected void btnAggProd_Click(object sender, EventArgs e)
    {
        string cod = drpArticoli.SelectedValue;

        help.connetti();
        help.assegnaComando("SELECT Quantità_Magazzino FROM Taglie_Quantità WHERE Cod_Prod='" + cod + "' AND Taglie='" + drpTaglie.SelectedValue + "'");
        rs = help.estraiDati();
        rs.Read();
        if (int.Parse(rs["Quantità_Magazzino"].ToString()) >= int.Parse(txtQtaCamp.Text) && int.Parse(txtQtaCamp.Text) > 0)
        {
            help.disconnetti();
            help.connetti();
            help.assegnaComando("INSERT INTO Appoggio_Campagna VALUES('" + drpArticoli.SelectedValue +
                                "','" + drpTaglie.SelectedValue + "'," + txtQtaCamp.Text + ",'" + txtPrezzo.Text + "')");
            help.eseguicomando();
            help.disconnetti();
            tabella();
            lblQta.Text = Convert.ToString(int.Parse(lblQta.Text) - int.Parse(txtQtaCamp.Text));
            Update1.Update();
        }
        else
        {
            help.disconnetti();
            MessageBox.Show("Quantità troppo grande!");
        }
    }
Exemplo n.º 2
0
 protected void drpTaglie_SelectedIndexChanged(object sender, EventArgs e)
 {
     help.connetti();
     help.assegnaComando("SELECT Quantità_Magazzino,Prezzo_Vendita FROM Taglie_Quantità,Articoli WHERE Cod_Prod='" + drpArticoli.SelectedValue + "' AND Taglie = '" + drpTaglie.SelectedValue.ToString() + "' AND Cod_Prod=Codice");
     rs = help.estraiDati();
     rs.Read();
     lblQta.Text      = rs["Quantità_Magazzino"].ToString();
     lblPrezVend.Text = rs["Prezzo_Vendita"].ToString() + " €";
     help.disconnetti();
     Update1.Update();
 }
Exemplo n.º 3
0
 private void Close_Adm()
 {
     Update1.Hide();
     Delete1.Hide();
     акцияDataGridView.ReadOnly              = true;
     акцияDataGridView.AllowUserToAddRows    = false;
     акцияDataGridView.AllowUserToDeleteRows = false;
     Update2.Hide();
     Delete2.Hide();
     продажи_товаровDataGridView.ReadOnly              = true;
     продажи_товаровDataGridView.AllowUserToAddRows    = false;
     продажи_товаровDataGridView.AllowUserToDeleteRows = false;
 }
Exemplo n.º 4
0
 private void Close_Adm()
 {
     Update1.Hide();
     Delete1.Hide();
     акцияDataGridView.ReadOnly              = true;
     акцияDataGridView.AllowUserToAddRows    = false;
     акцияDataGridView.AllowUserToDeleteRows = false;
     Update2.Hide();
     Delete2.Hide();
     товары_в_поставкахDataGridView.ReadOnly              = true;
     товары_в_поставкахDataGridView.AllowUserToAddRows    = false;
     товары_в_поставкахDataGridView.AllowUserToDeleteRows = false;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Run subscribed event handlers.
        /// </summary>
        /// <param name="argument">Main's argument parameter</param>
        /// <param name="updateSource">Main's updateSource</param>
        public void CallUpdateEventHandlers(string argument, UpdateType updateSource)
        {
            UpdateEventArgs Args = new UpdateEventArgs(argument, updateSource);

            // If you have a DRY way that doesn't involving updating a list on every call: send me an email 🤷
            None?.Invoke(this, Args);             // Always invoked
            if (updateSource.HasFlag(UpdateType.Terminal))
            {
                Terminal?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Trigger))
            {
                Trigger?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Mod))
            {
                Mod?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Script))
            {
                Script?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Update1))
            {
                Update1?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Update10))
            {
                Update10?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Update100))
            {
                Update100?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.Once))
            {
                Once?.Invoke(this, Args);
            }
            if (updateSource.HasFlag(UpdateType.IGC))
            {
                IGC?.Invoke(this, Args);
            }

            foreach (
                KeyValuePair <EventHandler <UpdateEventArgs>, EventHandlerMeta> EH in
                Subscribers.Where(pair => (updateSource & pair.Value.TargetUpdateType) != 0 || pair.Value.TargetUpdateType == UpdateType.None))
            {
                EH.Key.Invoke(this, Args);
            }
        }
Exemplo n.º 6
0
 protected void drpArticoli_SelectedIndexChanged(object sender, EventArgs e)
 {
     lblQta.Text      = "";
     lblPrezVend.Text = "";
     txtQtaCamp.Text  = "";
     txtPrezzo.Text   = "";
     drpTaglie.Items.Clear();
     drpTaglie.Items.Add("------");
     help.connetti();
     help.assegnaComando("SELECT DISTINCT(Taglie) FROM Taglie_Quantità WHERE Cod_Prod='" + drpArticoli.SelectedValue + "'");
     rs = help.estraiDati();
     while (rs.Read())
     {
         drpTaglie.Items.Add(rs["Taglie"].ToString());
     }
     help.disconnetti();
     Update1.Update();
 }
Exemplo n.º 7
0
    static void RandomizeWindow()
    {
        Update1 window = (Update1)EditorWindow.GetWindow(typeof(Update1));

        window.Show();
    }