Exemple #1
0
        protected void btnAggiungiRel_Click(object sender, ImageClickEventArgs e)
        {
            if (AggiungiButtonClicked != null)
            {
                ImageButton btn = (ImageButton)sender;
                GridViewRow row = (GridViewRow)btn.NamingContainer;

                int rowIndex;
                if (relazioneGV.AllowPaging)
                {
                    rowIndex = row.DataItemIndex - (relazioneGV.PageIndex) * relazioneGV.PageSize;
                }
                else
                {
                    rowIndex = row.DataItemIndex;
                }

                int    idDealer       = Convert.ToInt32(relazioneGV.DataKeys[rowIndex].Value);
                string codiceDealer   = ((Label)row.FindControl("codiceDealer")).Text;
                string ragioneSociale = ((Label)row.FindControl("ragioneSocialeDealer")).Text;

                AggiungiRelazioneDealerEventArgs args = new AggiungiRelazioneDealerEventArgs(TipoRicerca, idDealer, codiceDealer, ragioneSociale);

                AggiungiButtonClicked(sender, args);

                Hide();
            }
        }
Exemple #2
0
        private void PopupAggiungiRelazioneDealer_AggiungiButtonClicked(object sender, UserControl.RagioniSocialiCorrelate.AggiungiRelazioneDealerEventArgs e)
        {
            if (e.TipoRicerca == 1)
            {
                IDDealerScelto1HF.Value = e.IDDealer.ToString();
                TBCodiceDealer1.Text    = e.CodiceDealer;
                TBRagioneSociale1.Text  = e.RagioneSociale;

                ddlTipoDealer1.Enabled = false;


                TBCodiceDealer1.Enabled   = false;
                TBRagioneSociale1.Enabled = false;
                RBCodiceDealer1.Enabled   = false;
                RBRagioneSociale1.Enabled = false;
                btnCD1.Enabled            = false;
                btnRS1.Enabled            = false;
            }
            else if (e.TipoRicerca == 2)
            {
                IDDealerScelto2HF.Value = e.IDDealer.ToString();
                TBCodiceDealer2.Text    = e.CodiceDealer;
                TBRagioneSociale2.Text  = e.RagioneSociale;

                ddlTipoDealer2.Enabled    = false;
                TBCodiceDealer2.Enabled   = false;
                RBRagioneSociale2.Enabled = false;
                RBCodiceDealer2.Enabled   = false;
                TBRagioneSociale2.Enabled = false;
                btnCD2.Enabled            = false;
                btnRS2.Enabled            = false;
            }
            PopupAggiungiRelazioneDealer.Hide();
            creaRelUpdatePanel.Update();
        }
        protected void btnAggiungiRel_Click(object sender, ImageClickEventArgs e)
        {
            if (AggiungiButtonClicked != null)
                {
                    ImageButton btn = (ImageButton)sender;
                    GridViewRow row = (GridViewRow)btn.NamingContainer;

                    int rowIndex;
                    if (relazioneGV.AllowPaging)
                    {
                        rowIndex = row.DataItemIndex - (relazioneGV.PageIndex) * relazioneGV.PageSize;
                    }
                    else
                    {
                        rowIndex = row.DataItemIndex;
                    }

                    int idDealer = Convert.ToInt32(relazioneGV.DataKeys[rowIndex].Value);
                    string codiceDealer = ((Label)row.FindControl("codiceDealer")).Text;
                    string ragioneSociale = ((Label)row.FindControl("ragioneSocialeDealer")).Text;

                    AggiungiRelazioneDealerEventArgs args = new AggiungiRelazioneDealerEventArgs(TipoRicerca, idDealer, codiceDealer, ragioneSociale);

                    AggiungiButtonClicked(sender, args);

                    Hide();
                }
        }