Exemplo n.º 1
0
 private void grdItems_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     if (!functions.promptForPin())
     {
         e.Cancel = true;
     }
 }
Exemplo n.º 2
0
 private void dgvDatos_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     if (!deleteRow)
     {
         e.Cancel           = true;
         e.DisplayPromptMsg = false;
     }
     deleteRow = false;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Allow delete rows based on Form auth
        /// </summary>
        /// <param name="e"></param>
        protected override void OnBeforeRowsDeleted(BeforeRowsDeletedEventArgs e)
        {
            base.OnBeforeRowsDeleted(e);

            if (this.AllowDelete == false)
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 4
0
        private void dgvCoordenadasCliente_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            try
            {
                e.DisplayPromptMsg = false;
                DialogResult result = MessageBox.Show("Esta apunto de eliminar " + e.Rows.Count().ToString() + " registros permanentemente, no podrá recuperarlos posteriormente. ¿Seguro que desea continuar?", "Eliminación", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string ClaveCliente = "";
                    foreach (var item in e.Rows)
                    {
                        int ID = Convert.ToInt32(item.Cells["idClienteReparto"].Value);
                        ClaveCliente = Convert.ToString(item.Cells["CodigoCliente"].Value);
                        using (SqlConnection connection = new SqlConnection(ClasesSGUV.Propiedades.conectionLog))
                        {
                            using (SqlCommand command = new SqlCommand("up_RutasADM", connection))
                            {
                                command.CommandType = CommandType.StoredProcedure;
                                command.Parameters.AddWithValue("@TipoConsulta", 41);
                                command.Parameters.AddWithValue("@ID", ID);
                                command.Parameters.AddWithValue("@IDUsu", ClasesSGUV.Login.Id_Usuario);

                                command.CommandTimeout = 0;
                                command.Connection.Open();
                                command.ExecuteNonQuery();
                                command.Connection.Close();
                            }
                        }
                    }
                    e.Cancel = true;

                    dgvCoordenadasCliente.DataSource = null;
                    DataTable dt = new DataTable();
                    using (SqlConnection connection = new SqlConnection(ClasesSGUV.Propiedades.conectionLog))
                    {
                        using (SqlCommand command = new SqlCommand("up_RutasADM", connection))
                        {
                            command.CommandType = CommandType.StoredProcedure;

                            command.Parameters.AddWithValue("@TipoConsulta", 37);
                            command.Parameters.AddWithValue("@ClaveCliente", ClaveCliente);
                            command.CommandTimeout = 0;
                            SqlDataAdapter da = new SqlDataAdapter();
                            da.SelectCommand = command;
                            da.Fill(dt);
                        }
                    }
                    dgvCoordenadasCliente.DataSource = dt;
                    //Nuevo();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Exemplo n.º 5
0
 private void ultraGrid1_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     if (!_FromDeleteButton)
     {
         foreach (UltraGridRow row in e.Rows)
         {
             DeleteFromTable(row);
         }
     }
 }
Exemplo n.º 6
0
        private void dgvDatos_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            if (DocumentMode.Equals("Consulta"))
            {
                e.Cancel = true;
                return;
            }

            //if (!deleteRow)
            //{
            //    e.Cancel = true;
            //    e.DisplayPromptMsg = false;
            //}
            //deleteRow = false;
        }
Exemplo n.º 7
0
 private void OnGridBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     //Event hanlder for rows deleting
     try {
         //Cannot delete 'Default' entries or the new row entry
         e.DisplayPromptMsg = true;
         if (!e.Cancel)
         {
             string clid    = e.Rows[0].Cells["CLID"].Value.ToString();
             string format  = e.Rows[0].Cells["ExportFormat"].Value.ToString();
             string path    = e.Rows[0].Cells["ExportPath"].Value.ToString();
             string key     = e.Rows[0].Cells["CounterKey"].Value.ToString();
             string client  = e.Rows[0].Cells["Client"].Value.ToString();
             string scanner = e.Rows[0].Cells["Scanner"].Value.ToString();
             string userid  = e.Rows[0].Cells["UserID"].Value.ToString();
             bool   deleted = EnterpriseFactory.DeleteClient(clid, format, path, key, client, scanner, userid);
             OnRefresh(this.btnRefresh, EventArgs.Empty);
         }
     }
     catch (Exception ex) { App.ReportError(ex); }
 }
Exemplo n.º 8
0
 private void OnGridBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     //Event hanlder for rows deleting
     try {
         //Cannot delete 'Default' entries or the new row entry
         e.DisplayPromptMsg = true;
         if (!e.Cancel)
         {
             ISDClient isdClient = new ISDClient();
             isdClient.CLID         = e.Rows[0].Cells["CLID"].Value.ToString();
             isdClient.ExportFormat = e.Rows[0].Cells["ExportFormat"].Value.ToString();
             isdClient.ExportPath   = e.Rows[0].Cells["ExportPath"].Value.ToString();
             isdClient.CounterKey   = e.Rows[0].Cells["CounterKey"].Value.ToString();
             isdClient.Client       = e.Rows[0].Cells["Client"].Value.ToString();
             isdClient.Scanner      = e.Rows[0].Cells["Scanner"].Value.ToString();
             isdClient.UserID       = e.Rows[0].Cells["UserID"].Value.ToString();
             bool deleted = AgentLineHaulGateway.DeleteISDClient(isdClient);
             OnRefresh(this.btnRefresh, EventArgs.Empty);
         }
     }
     catch (Exception ex) { App.ReportError(ex); }
 }
Exemplo n.º 9
0
        private void dgvClientes_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            e.DisplayPromptMsg = false;

            if (MessageBox.Show("¿Desea eliminar los registros?", "HalcoNET", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                foreach (var item in e.Rows)
                {
                    int x = connection.Ejecutar("LOG",
                                                "up_Configuracion",
                                                new string[] { },
                                                new string[] { "@TipoConsulta", "@CardCode" },
                                                ref valuesOut, 2, item.Cells["CardCode"].Value);
                }

                //this.GetClientes();
            }
            else
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 10
0
 private void ultraGrid1_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 11
0
 private void ugdNarudzbenicaProizvod_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 12
0
        private void listaStabiliGruppiBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            _stabiliDeleted.Clear();
            _gruppiDeleted.Clear();

            foreach (var t in e.Rows)
            {
                if (t.Band.Index == 0 && t.ListObject is StabileDTO)
                {
                    var stabile = (StabileDTO)t.ListObject;
                    var message = getStrutturaCondominioService().IsAllowDeleteStabile(stabile);
                    if (string.IsNullOrEmpty(message))
                    {
                        if (stabile.ID > 0)
                            _stabiliDeleted.Add(stabile);
                    }
                    else
                    {
                        e.Cancel = true;
                        CommonMessages.DisplayWarning(message);
                    }
                }

                if (t.Band.Index == 1 && t.ListObject is GruppoStabileDTO)
                {
                    var gruppoStabile = (GruppoStabileDTO)t.ListObject;
                    var message = getStrutturaCondominioService().IsAllowDeleteGruppoStabile(gruppoStabile);
                    if (string.IsNullOrEmpty(message))
                    {
                        if (gruppoStabile.ID > 0)
                            _gruppiDeleted.Add(gruppoStabile);
                    }
                    else
                    {
                        e.Cancel = true;
                        CommonMessages.DisplayWarning(message);
                    }
                }
            }
        }
Exemplo n.º 13
0
 private void listaBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     foreach (var row in e.Rows)
     {
         var dto = row.ListObject as DocumentoDTO;
         if (dto != null)
             _documentsToDelete.Add(dto);
     }
 }
Exemplo n.º 14
0
 private void dgv_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
     e.Cancel           = true;
 }
Exemplo n.º 15
0
 private void listaContiBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     _movimentiDeleted.Clear();
     if (e.Rows.Any())
     {
         foreach (var row in e.Rows)
         {
             if (((MovimentoContabileGestioneDTO)row.ListObject).ID > 0)
                 _movimentiDeleted.Add((MovimentoContabileGestioneDTO)row.ListObject);
         }
     }
 }
 private void uG_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 17
0
        private void scadenzeBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            var cancel = false;
            foreach (var row in e.Rows)
            {
                var dto = row.ListObject as ScadenzaFatturaDTO;
                if (dto != null)
                {
                    var scadenza = dto;
                    if (scadenza.StatoScadenza != StatoSpesaEnum.Inserita && scadenza.StatoScadenza != StatoSpesaEnum.Undefined)
                    {
                        cancel = true;
                        break;
                    }
                }
                else
                {
                    cancel = true;
                    break;
                }
            }

            e.Cancel = cancel;
        }
Exemplo n.º 18
0
 private void listaBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
     var result = MessageBox.Show(this, @"Sei sicuro di voler eliminare i documenti selezionati?", @"Sfera - Richiesta conferma", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
     if (result == DialogResult.No)
         e.Cancel = true;
     else
     {
         foreach (var t in e.Rows)
             getDocumentoService().Delete((DocumentoDTO) t.ListObject);
     }
 }
Exemplo n.º 19
0
 private void UltraGridPodProizvodi_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 20
0
 private void listaBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     //foreach (UltraGridRow row in e.Rows)
     //{
     //    if (!getFatturaService().IsAllowUpdate((SpesaDTO)row.ListObject))
     //    {
     //        e.Cancel = true;
     //        break;
     //    }
     //}
 }
Exemplo n.º 21
0
        private void updatableStandardFormBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
        {
            if (!e.Cancel)
            {
                try
                {
                    var item = GetBusinessEntity(e.Rows[0]);
                    if (item != null)
                    {
                        if (e.Rows[0].Band.Columns.Exists("ID"))
                        {
                            var id = e.Rows[0].GetCellValue("ID") as int?;
                            if (id.GetValueOrDefault() == 0)
                                item.IsDeleteAllow = true;
                        }
                        if (e.Rows[0].Band.Columns.Exists("Id"))
                        {
                            var id = e.Rows[0].GetCellValue("Id") as int?;
                            if (id.GetValueOrDefault() == 0)
                                item.IsDeleteAllow = true;
                        }

                        if (!item.IsDeleteAllow)
                        {
                            e.Cancel = true;
                            return;
                        }

                        if (e.DisplayPromptMsg)
                        {
                            e.DisplayPromptMsg = false;
                            var result = MessageBox.Show(this, @"Sei sicuro di voler rimuovere la riga?", @"Sfera - Richiesta conferma", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                            if (result == DialogResult.No)
                                e.Cancel = true;
                            else
                            {
                                var changed = e.Rows[0].ListObject as BaseDTOOfint;
                                if (changed != null)
                                {
                                    setBusinessClassStato(changed, "U");
                                    foreach (var kvp in _businessRelations)
                                        kvp.Value.Stato = "U";
                                }
                                setStatusBar();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat("Errore prima del delete di una riga - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                    e.Cancel = true;
                }

            }
        }
Exemplo n.º 22
0
 private void dgvCoordenadasCliente_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.Cancel           = true;
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 23
0
 private void ugdPlanNabaveStavka_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 24
0
 /// <summary>Behandelt das BeforeRowsDeleted Ereignis des ultraGridErnaehrung Controls.</summary>
 /// <param name="sender">Die Quelle des Ereignisses.</param>
 /// <param name="e">Die <see cref="RowEventArgs"/> Instanz, welche die Ereignisdaten enthält.</param>
 private void OnUltraGridErnaehrungBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
 }
Exemplo n.º 25
0
 private void dgv_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
     e.Cancel = true;
 }
Exemplo n.º 26
0
 private void dgv_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.Cancel = !DeleteAndUpdate;
     DeleteAndUpdate = false;
 }
Exemplo n.º 27
0
 /// <summary>Behandelt das BeforeRowsDeleted Ereignis des ultraGridBlutDruck Controls.</summary>
 /// <param name="sender">Die Quelle des Ereignisses.</param>
 /// <param name="e">Die <see cref="RowEventArgs"/> Instanz, welche die Ereignisdaten enthält.</param>
 private void OnUltraultraGridBlutDruckBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
 }
Exemplo n.º 28
0
 private void listaBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     foreach (var t in e.Rows)
         _deleted.Add((ModelloLetteraDTO)t.ListObject);
 }
Exemplo n.º 29
0
 private void uG_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.DisplayPromptMsg = false;
 }
Exemplo n.º 30
0
 private void dgv_DanhSach_BeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     e.Cancel        = !DeleteAndUpdate;
     DeleteAndUpdate = false;
 }
Exemplo n.º 31
0
 private void listaLottiBeforeRowsDeleted(object sender, BeforeRowsDeletedEventArgs e)
 {
     _lottiDeleted.Clear();
     foreach (UltraGridRow t in e.Rows)
     {
         if (t.Band.Index == 0)
         {
             var lotto = (LottoDTO)t.ListObject;
             var message = getStrutturaCondominioService().IsAllowDeleteLotto(lotto);
             if (string.IsNullOrEmpty(message))
             {
                 if (lotto.ID > 0)
                     _lottiDeleted.Add(lotto);
             }
             else
             {
                 e.Cancel = true;
                 CommonMessages.DisplayWarning(message);
             }
         }
     }
 }