예제 #1
0
        protected void PopupAggiungiDealerBusiness_AggiungiButtonClicked(object sender, UserControl.RagioniSocialiCorrelate.AggiungiDealerBusinessEventArgs e)
        {
            try
            {
                bool esiste = proxyMtd.ExistsDealerBusiness(e.Codice);

                if (!esiste)
                {
                    AnagraficaDealerClassLib.DealerBusiness dealerBusiness = new AnagraficaDealerClassLib.DealerBusiness();

                    dealerBusiness.Codice    = e.Codice;
                    dealerBusiness.Nome      = e.RagioneSociale;
                    dealerBusiness.Indirizzo = e.Indirizzo;

                    proxyMtd.InsertDealerBusiness(dealerBusiness);
                    DealerTableBusiness = proxyMtd.GetAllDealerBusiness();

                    gvDealerBusiness.DataSource = DealerTableBusiness;
                    gvDealerBusiness.DataBind();


                    PopupAggiungiDealerBusiness.Hide();
                    dealerBusinessUpdatePanel.Update();
                }

                else
                {
                    PopupAggiungiDealerBusiness.setErrorMessage("Codice esistente!");
                }
            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }
예제 #2
0
        private void PopupModificheDealerBusiness_ModificaButtonClicked(object sender, UserControl.RagioniSocialiCorrelate.ModificheDealerBusinessEventArgs e)
        {
            try
            {
                AnagraficaDealerClassLib.DealerBusiness dealerBusiness = new AnagraficaDealerClassLib.DealerBusiness();

                dealerBusiness.IDDealerBusiness = Convert.ToInt32(e.IDDealerBusiness);
                dealerBusiness.Indirizzo        = e.Indirizzo;
                dealerBusiness.Nome             = e.RagioneSociale;
                dealerBusiness.Codice           = e.Codice;

                proxyMtd.UpdateDealerBusiness(dealerBusiness);

                DealerTableBusiness = proxyMtd.GetAllDealerBusiness();

                gvDealerBusiness.DataSource = DealerTableBusiness;
                gvDealerBusiness.DataBind();
                dealerBusinessUpdatePanel.Update();
            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }
        private void PopupModificheDealerBusiness_ModificaButtonClicked(object sender, UserControl.RagioniSocialiCorrelate.ModificheDealerBusinessEventArgs e)
        {
            try
            {

                AnagraficaDealerClassLib.DealerBusiness dealerBusiness = new AnagraficaDealerClassLib.DealerBusiness();

                dealerBusiness.IDDealerBusiness = Convert.ToInt32(e.IDDealerBusiness);
                dealerBusiness.Indirizzo = e.Indirizzo;
                dealerBusiness.Nome = e.RagioneSociale;
                dealerBusiness.Codice = e.Codice;

                proxyMtd.UpdateDealerBusiness(dealerBusiness);

                DealerTableBusiness = proxyMtd.GetAllDealerBusiness();

                gvDealerBusiness.DataSource = DealerTableBusiness;
                gvDealerBusiness.DataBind();
                dealerBusinessUpdatePanel.Update();

            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }
        protected void PopupAggiungiDealerBusiness_AggiungiButtonClicked(object sender, UserControl.RagioniSocialiCorrelate.AggiungiDealerBusinessEventArgs e)
        {
            try
            {
                bool esiste = proxyMtd.ExistsDealerBusiness(e.Codice);

                if (!esiste)
                {
                    AnagraficaDealerClassLib.DealerBusiness dealerBusiness = new AnagraficaDealerClassLib.DealerBusiness();

                    dealerBusiness.Codice = e.Codice;
                    dealerBusiness.Nome = e.RagioneSociale;
                    dealerBusiness.Indirizzo = e.Indirizzo;

                    proxyMtd.InsertDealerBusiness(dealerBusiness);
                    DealerTableBusiness = proxyMtd.GetAllDealerBusiness();

                    gvDealerBusiness.DataSource = DealerTableBusiness;
                    gvDealerBusiness.DataBind();

                    PopupAggiungiDealerBusiness.Hide();
                    dealerBusinessUpdatePanel.Update();

                }

                else
                {
                    PopupAggiungiDealerBusiness.setErrorMessage("Codice esistente!");
                }

            }
            catch (Exception ex)
            {
                PopupMessaggio.ShowMsgBox(ex.Message, true);
            }
        }
        protected void btnModifica_Click(object sender, ImageClickEventArgs e)
        {
            if (ModificaButtonClicked != null)
              {
                  DealerBusiness dealerBusiness = new DealerBusiness();

                  int idDealer = Convert.ToInt32(IDDealerBusiness);
                  string codiceDealer = txtCodiceDealer.Text;
                  string ragioneSociale = txtRagioneSociale.Text;
                  string indirizzo = txtIndirizzo.Text;

                  ModificheDealerBusinessEventArgs args = new ModificheDealerBusinessEventArgs(idDealer, codiceDealer, ragioneSociale, indirizzo);

                  ModificaButtonClicked(sender, args);
              }
        }
예제 #6
0
 public string UpdateDealerBusiness(DealerBusiness obj)
 {
     Methods.DealerMng dealer = new Methods.DealerMng();
     return(dealer.UpdateDealerBusiness(obj));
 }
예제 #7
0
 public string InsertDealerBusiness(DealerBusiness obj)
 {
     Methods.DealerMng dealer = new Methods.DealerMng();
     return(dealer.InsertDealerBusiness(obj));
 }