Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                // Recupero il profilo da modificare
                Dm_Profile_ForUpdate profile = _manager.ARX_DATI.Dm_Profile_ForUpdate_GetNewInstance(19);

                profile.DocName = "Subject edited from C# application";

                //.... campi agg...


                var profileResult = _manager.ARX_DATI.Dm_Profile_Update(profile, string.Empty);
                if (profileResult.EXCEPTION != Security_Exception.Nothing)
                {
                    throw new Exception(string.Format("Error: {0}", profileResult.MESSAGE));
                }
                MessageBox.Show("Edit success!", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                //Preambolo
                String messaggio, nuovoOggettoDelProfilo, nuovaStringaProtocollo;
                int    docNumberScelto;

                //1) Recupero il profilo da modificare
                messaggio       = "Qual docnumber vuoi modificare?";
                docNumberScelto = Int32.Parse(Interaction.InputBox(messaggio, "Modifica dello store di un profilo", "Immetti valore"));

                //2) Mi carico il profilo in memoria...
                Dm_Profile_ForUpdate profile = _manager........(docNumberScelto);

                //3) Cambio l'oggetto del profilo del profilo in memoria...
                messaggio = "Qual è l\'oggetto del profilo?";
                nuovoOggettoDelProfilo = Interaction.InputBox(messaggio, "Modifica dello store di un profilo", "Immetti valore");
                profile.DocName        = nuovoOggettoDelProfilo;

                //4) Cambio la stringa-protocollo del profilo in memoria...
                messaggio = "Qual è la nuova stringa-protocollo?";
                Aggiuntivo_String aggiuntivoStringaProtocollo = profile........(
                    x => string.Equals(x.Label, "StringaProtocollo", StringComparison.CurrentCultureIgnoreCase)) as Aggiuntivo_String;
                if (aggiuntivoStringaProtocollo == null)
                {
                    throw new Exception("Non ho trovato il campo \'aggiuntivoDataProtocollo\'");
                }
                nuovaStringaProtocollo             = Interaction.InputBox(messaggio, "Modifica dello store di un profilo", "Immetti valore");
                aggiuntivoStringaProtocollo.Valore = nuovaStringaProtocollo;

                //5) Aggiorniamo il profilo in Arxivar Next
                Dm_Profile_Result profileResult = _manager........(profile, string.Empty);

                //6) L'operazione è andata bene?
                if (profileResult.EXCEPTION != Security_Exception.Nothing)
                {
                    throw new Exception(string.Format("Error: {0}", profileResult.MESSAGE));
                }
                else
                {
                    MessageBox.Show("Aggiornamento eseguito con successo!", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
        public override bool On_Before_Dm_Barcode_MatchProfile(EntitiesCollection <int> dmBarcodeIds)
        {
            foreach (var dmBarcodeId in dmBarcodeIds)
            {
                Dm_Barcode           dmBarcode = WcfConnectorManager.ARX_DATI.Dm_Barcode_GetData_By_IdBarcode(dmBarcodeId);
                Dm_Profile_ForUpdate dmProfileForUpdateGetNewInstance = WcfConnectorManager.ARX_DATI.Dm_Profile_ForUpdate_GetNewInstance(dmBarcode.DOCNUMBER);

                // Posso fare l'aggiornamento del profilo con il valore relativo al barcode
                WcfConnectorManager.ARX_DATI.Dm_Profile_Update(dmProfileForUpdateGetNewInstance, "");
            }
            return(true);
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Recupero il profilo da modificare
            Dm_Profile_ForUpdate profile = _manager.ARX_DATI.Dm_Profile_ForUpdate_GetNewInstance(888);

            profile.DocName = "Subject edited from C# application";

            //.... campi agg...


            var profileResult = _manager.ARX_DATI.Dm_Profile_Update(profile, string.Empty);

            if (profileResult.EXCEPTION != Security_Exception.Nothing)
            {
                throw new Exception(string.Format("Error: {0}", profileResult.MESSAGE));
            }
            else
            {
                MessageBox.Show("Edit success!");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                // Recupero il profilo da modificare
                Dm_Profile_ForUpdate profile = _manager.ARX_DATI.Dm_Profile_ForUpdate_GetNewInstance(15);

                profile.DocName = "Subject edited from C# application";

                //.... campi agg...

                // Campo agente (Nell'esempio è un campo combo con LimitToList -> Il valore indicato DEVE esistere)
                Aggiuntivo_String aggAgente = profile.Aggiuntivi.FirstOrDefault(
                    x => string.Equals(x.ExternalId, "COD_AGENTE", StringComparison.CurrentCultureIgnoreCase)) as Aggiuntivo_String;
                if (aggAgente == null)
                {
                    throw new Exception("External id 'COD_AGENTE' not found");
                }
                aggAgente.Valore = "AG_003";


                Dm_Profile_Result profileResult = _manager.ARX_DATI.Dm_Profile_Update(profile, string.Empty);

                if (profileResult.EXCEPTION != Security_Exception.Nothing)
                {
                    throw new Exception(string.Format("Error: {0}", profileResult.MESSAGE));
                }
                MessageBox.Show("Edit success!", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Dm_Profile_ForUpdate profile = _manager.ARX_DATI.Dm_Profile_ForUpdate_GetNewInstance(888);

                profile.DocName = "Subject edited from C# application";

                //.... Additional fields...

                var profileResult = _manager.ARX_DATI.Dm_Profile_Update(profile, string.Empty);
                if (profileResult.EXCEPTION != Security_Exception.Nothing)
                {
                    throw new Exception(string.Format("Error: {0}", profileResult.MESSAGE));
                }

                MessageBox.Show("Edit success!");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Edit profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }