Exemplo n.º 1
0
        public void DeleteAsync <T>(T @object, string index, string type, DeleteParameters deleteParameters, Action <ConnectionStatus> callback) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index, type);

            path = this.AppendParametersToPath(path, deleteParameters);
            this._deleteToPathAsync(path, callback);
        }
Exemplo n.º 2
0
        public void DeleteByIdAsync <T>(string index, string type, int id, DeleteParameters deleteParameters, Action <ConnectionStatus> callback) where T : class
        {
            var path = this.CreatePath(index, type, id.ToString());

            path = this.AppendParametersToPath(path, deleteParameters);
            this._deleteToPathAsync(path, callback);
        }
Exemplo n.º 3
0
        public ConnectionStatus Delete <T>(T @object, string index, string type, DeleteParameters deleteParameters) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index, type);

            path = this.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 4
0
        public ConnectionStatus DeleteById <T>(string index, string type, int id, DeleteParameters deleteParameters) where T : class
        {
            var path = this.CreatePath(index, type, id.ToString());

            path = this.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Synchronously delete the object in the inferred type for T in the specified index.
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public IDeleteResponse Delete <T>(T @object, string index, string type, DeleteParameters deleteParameters) where T : class
        {
            var path = this.PathResolver.CreatePathFor <T>(@object, index, type);

            path = this.PathResolver.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
        public void DeleteMessage()
        {
            var ret = SendTestMessage();

            Assert.IsTrue(ret.HttpStatusCode == System.Net.HttpStatusCode.OK);

            var rec = ReceiveTestMessage();

            Assert.IsTrue(rec.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.IsTrue(rec.Messages.Count > 0);

            var input = new DeleteParameters
            {
                QueueUrl      = queueURL,
                ReceiptHandle = rec.Messages[0].ReceiptHandle
            };

            var awsOptions = new AWSOptions
            {
                AWSCredentials        = SQS.GetBasicAWSCredentials(credParams),
                UseDefaultCredentials = false,
                Region = region
            };

            var delres = SQS.DeleteMessage(input, awsOptions, new System.Threading.CancellationToken()).Result;

            Assert.IsTrue(delres.HttpStatusCode == System.Net.HttpStatusCode.OK);
        }
Exemplo n.º 7
0
        private void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            DeleteParameters parameters = e.Argument as DeleteParameters;

            var fileQueue = new Queue <FileSearcher.SearchResult>(parameters.SourceFiles);

            long currentSourceFile = 0;
            long sourceFileCount   = fileQueue.Count;
            long totalFileSize     = 0;
            long totalFileCount    = 0;

            while (fileQueue.Count > 0)
            {
                var result = fileQueue.Dequeue();

                foreach (var file in result.AssociatedFiles)
                {
                    totalFileSize += file.Length;
                    totalFileCount++;
                    // Delete file
                    DeleteFile(file.FullName, parameters.DeleteToRecycleBin);
                }
                currentSourceFile++;

                int progress = Math.Max(0, Math.Min(100, (int)(currentSourceFile / (float)sourceFileCount * 100f)));
                Worker.ReportProgress(progress, result.SourceFile);
            }

            e.Result = new DeleteResult(totalFileCount, totalFileSize);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Synchronously deletes a document by id in the specified index and type
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public ConnectionStatus DeleteById(string index, string type, string id, DeleteParameters deleteParameters)
        {
            var path = this.CreatePath(index, type, id);

            path = this.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Asynchronously delete the object in the inferred type for T in the specified index.
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public Task <ConnectionStatus> DeleteAsync <T>(T @object, string index, DeleteParameters deleteParameters) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index);

            path = this.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPathAsync(path));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Synchronously deletes a document by id in the specified index and type
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public IDeleteResponse DeleteById(string index, string type, int id, DeleteParameters deleteParameters)
        {
            var path = this.PathResolver.CreateIndexTypeIdPath(index, type, id.ToString());

            path = this.PathResolver.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 11
0
 /// <summary>
 /// Deletes the specified entity set.
 /// It doesn't delete weak entititied included here, unless database does it using integrity rules
 /// </summary>
 /// <param name="entitySet">The entity set.</param>
 /// <param name="parameters">The parameters.</param>
 public void Delete(object entitySet, DeleteParameters parameters)
 {
     if (parameters.DetailEntityObjects == null ||
         parameters.DetailEntityObjects.Count == 0)
     {
         // delete without transaction
         NHibernateSession.Delete(entitySet);
         if (this.AutoSave)
         {
             SaveChanges();
         }
     }
     else
     {
         // update with transaction
         //TODO: It needs to use dataaccess layer of that entity
         using (var tx = NHibernateSession.BeginTransaction())
         {
             NHibernateSession.Delete(entitySet);
             SaveDetailEntities(parameters.DetailEntityObjects);
             tx.Commit();
         }
         if (this.AutoSave)
         {
             SaveChanges();
         }
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Asynchronously delete the object in the inferred type for T in the specified index.
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public Task <IDeleteResponse> DeleteAsync <T>(T @object, string index, DeleteParameters deleteParameters) where T : class
        {
            var path = this.PathResolver.CreatePathFor <T>(@object, index);

            path = this.PathResolver.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPathAsync(path));
        }
Exemplo n.º 13
0
        public FileDeleter(IEnumerable <FileSearcher.SearchResult> files, bool sendToRecycleBin)
        {
            parameters = new DeleteParameters(files, sendToRecycleBin);

            Worker.WorkerReportsProgress = true;
            Worker.DoWork             += Worker_DoWork;
            Worker.ProgressChanged    += Worker_ProgressChanged;
            Worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
        }
Exemplo n.º 14
0
 public ResponseHeader Delete(IEnumerable <T> docs, DeleteParameters parameters)
 {
     return(basicServer.Delete(docs.Select(d => {
         var uniqueKey = mappingManager.GetUniqueKey(typeof(T));
         if (uniqueKey == null)
         {
             throw new SolrNetException(string.Format("This operation requires a unique key, but type '{0}' has no declared unique key", typeof(T)));
         }
         return Convert.ToString(uniqueKey.Property.GetValue(d, null));
     }), null, parameters));
 }
Exemplo n.º 15
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (DeleteParameters.LogicDelete(builder, txtIDCliente.Text, "idcliente", "Cliente", "baja"))
     {
         MessageBox.Show("REgistro Eliminado correctamente");
     }
     else
     {
         MessageBox.Show("Error al borrar el registro");
     }
 }
Exemplo n.º 16
0
        public void DeleteContact(DeleteParameters parameters)
        {
            var user = Users[parameters.UserId];

            var contacts = user.Contacts.Where(x => x.User.Id == parameters.ContactUserId).ToList();

            foreach (var contact in contacts)
            {
                user.Contacts.Remove(contact);
            }
        }
Exemplo n.º 17
0
        public void DeleteByIdAsync <T>(string id, DeleteParameters deleteParameters, Action <ConnectionStatus> callback) where T : class
        {
            var index = this.Settings.DefaultIndex;

            index.ThrowIfNullOrEmpty("Cannot infer default index for current connection.");

            var typeName = this.InferTypeName <T>();
            var path     = this.CreatePath(index, typeName, id);

            path = this.AppendParametersToPath(path, deleteParameters);
            this._deleteToPathAsync(path, callback);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Synchronously deletes a document by id in the default index and the inferred typename for T
        /// </summary>
        /// <param name="deleteParameters">Allows you to pass in additional delete parameters such as version and routing</param>
        public IDeleteResponse DeleteById <T>(string id, DeleteParameters deleteParameters) where T : class
        {
            var index = this.IndexNameResolver.GetIndexForType <T>();

            index.ThrowIfNullOrEmpty("Cannot infer default index for current connection.");

            var typeName = this.TypeNameResolver.GetTypeNameFor <T>();
            var path     = this.PathResolver.CreateIndexTypeIdPath(index, typeName, id);

            path = this.PathResolver.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 19
0
        public ConnectionStatus DeleteById <T>(string id, DeleteParameters deleteParameters) where T : class
        {
            var index = this.Settings.DefaultIndex;

            index.ThrowIfNullOrEmpty("Cannot infer default index for current connection.");

            var typeName = this.InferTypeName <T>();
            var path     = this.CreatePath(index, typeName, id);

            path = this.AppendParametersToPath(path, deleteParameters);
            return(this._deleteToPath(path));
        }
Exemplo n.º 20
0
        /// <summary>
        /// Deletes the specified entity set.
        /// It doesn't delete weak entititied included here, unless database does it using integrity rules
        /// </summary>
        /// <param name="entitySet">The entity set.</param>
        /// <param name="parameters">The parameters.</param>
        /// <exception cref="BRException"></exception>
        public void Delete(object entitySet, DeleteParameters parameters)
        {
            Check.Require(_IsInitialized, "The class is not initialized yet.");

            BusinessRuleErrorList errors = new BusinessRuleErrorList();

            CheckRules(entitySet, RuleFunctionSEnum.Delete, errors);

            if (errors.Count > 0)
            {
                throw new BRException(errors);
            }

            this.DataAccessObject.Delete(entitySet, parameters);
        }
Exemplo n.º 21
0
        protected override bool onBeforeDelete(object entitySet, DeleteParameters parameters)
        {
            Visit           visit = (Visit)entitySet;
            var             doctorScheduleService = DoctorScheduleEN.GetService("");
            vDoctorSchedule doctorSchedule        = doctorScheduleService.GetByIDV(visit.DoctorScheduleID, new GetByIDParameters());

            doctorSchedule.NumberOfRegisteredPatients--;
            parameters.DetailEntityObjects.Add(new DetailObjectInfo()
            {
                EntityName = vDoctorSchedule.EntityName,
                FnName     = RuleFunctionSEnum.Update,
                EntitySet  = doctorSchedule
            });

            return(true);
        }
Exemplo n.º 22
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     DeleteParameters.LogicDelete(builder, txtID.Text, "idempleado", "Empleado", "baja");
     if (DeleteParameters.LogicDelete(builder, txtID.Text, "idempleado", "Empleado", "baja"))
     {
         btnEliminar.Enabled         = false;
         btnmodificar.Enabled        = false;
         txtID.Enabled               = true;
         txtApellidoEmpleado.Enabled = false;
         txtDireccion.Enabled        = false;
         txtNombreEmpleado.Enabled   = false;
         txtSucursal.Enabled         = false;
         txtTelefono.Enabled         = false;
         txtID.Focus();
     }
     else
     {
         MessageBox.Show("Error al eliminar el empleado");
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// Deletes the specified entity set.
        /// It doesn't delete weak entititied included here, unless database does it using integrity rules
        /// </summary>
        /// <param name="entitySet">The entity set.</param>
        /// <param name="parameters">The parameters.</param>
        public void Delete(object entitySet, DeleteParameters parameters = null)
        {
            Check.Require(_IsInitialized, "The class is not initialized yet.");
            Check.Require(entitySet != null);
            if (parameters == null)
            {
                parameters = new DeleteParameters();
            }

            if (onBeforeDelete(entitySet, parameters))
            {
                foreach (EntitySecurityBase checker in this.SecurityCheckers)
                {
                    checker.Delete(entitySet, parameters);
                }

                BusinessLogicObject.Delete(entitySet, parameters);
                onAfterDelete(entitySet, parameters);
            }
        }
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            string info = DeleteParameters.DeletewhitString(Program.conexion, "Producto", "idproducto", "producto", txtIProducto.Text);

            if (info.Substring(0, 12) == "ERROR: 23503")
            {
                MessageBox.Show("Este producto ya esta en una transaccion(venta, devolucion, movimiento), por lo que no es posible borrarlo");
            }
            else
            {
                Tools.setBoxemptys(Controls);
                btnEliminar.Enabled    = false;
                btnmodificar.Enabled   = false;
                txtIProducto.Enabled   = true;
                txtDetalles.Enabled    = false;
                txtIdProveedor.Enabled = false;
                txtNombre.Enabled      = false;
                txtPrecioList.Enabled  = false;
                txtIProducto.Focus();
            }
        }
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            string info = DeleteParameters.DeletewhitString(Program.conexion, "Proveedor", "idproveedor", "proveedor", txtID.Text);

            if (info.Substring(0, 12) == "ERROR: 23503")
            {
                MessageBox.Show("Este proveedor ya tiene productos registrados, para borrarlo, modifique sus productos y cambielos de proveedor. si ya ha echo pedidos a este proveedor, no es posible Eliminarlo");
            }
            else
            {
                Tools.setBoxemptys(Controls);
                btnEliminar.Enabled      = false;
                btnmodificar.Enabled     = false;
                txtID.Enabled            = true;
                txtCiudad.Enabled        = false;
                txtDireccion.Enabled     = false;
                txtEstado.Enabled        = false;
                txtNombre.Enabled        = false;
                txtTelefono.Enabled      = false;
                txtTiempoentrega.Enabled = false;
                txtID.Focus();
            }
        }
Exemplo n.º 26
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            string info = DeleteParameters.DeletewhitString(Program.conexion, "sucursal", "idsucursal", "Sucursal", txtID.Text);

            if (info == "OK")
            {
                Tools.setBoxemptys(Controls);
                btnmodificar.Enabled = false;
                btnEliminar.Enabled  = false;
                txtID.Enabled        = true;
                txtCiudad.Enabled    = false;
                txtDireccion.Enabled = false;
                txtEstado.Enabled    = false;
                txtTelefono.Enabled  = false;
                txtID.Focus();
            }
            else if (info == "NO")
            {
            }
            else if (info.Substring(0, 12) == "ERROR: 23503")
            {
                MessageBox.Show("Esta sucursal ya tiene empleados registrados, para eliminarla, edite todos los empleados y cambielos de sucursal");
            }
            else
            {
                Tools.setBoxemptys(Controls);
                btnmodificar.Enabled = false;
                btnEliminar.Enabled  = false;
                txtID.Enabled        = true;
                txtCiudad.Enabled    = false;
                txtDireccion.Enabled = false;
                txtEstado.Enabled    = false;
                txtTelefono.Enabled  = false;
                txtID.Focus();
            }
        }
Exemplo n.º 27
0
 public Task <ResponseHeader> DeleteAsync(IEnumerable <string> ids, ISolrQuery q, DeleteParameters parameters)
 => PerformOperation(operations => operations.DeleteAsync(ids, q, parameters));
Exemplo n.º 28
0
 public Task <ResponseHeader> DeleteAsync(string id, DeleteParameters parameters)
 => PerformOperation(operations => operations.DeleteAsync(id, parameters));
Exemplo n.º 29
0
 public Task <ResponseHeader> DeleteAsync(ISolrQuery q, DeleteParameters parameters)
 => PerformOperation(operations => operations.DeleteAsync(q, parameters));
Exemplo n.º 30
0
 public DeleteCommand(ISolrDeleteParam deleteParam, DeleteParameters parameters)
 {
     this.deleteParam = deleteParam;
     this.parameters = parameters;
 }
 // Deletes filtered call log records.
 public Task <bool> Delete(DeleteParameters parameters)
 {
     return(Delete(parameters as object));
 }
Exemplo n.º 32
0
        public DeleteCommand(DeleteByIdAndOrQueryParam deleteParam, DeleteParameters parameters) {
		    this.deleteParam = deleteParam;
		    this.parameters = parameters;
		}