예제 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null || obj.GetType() != typeof(ReplayItem))
            {
                return(false);
            }
            var m = obj as ReplayItem;

            return(Ids.Equals(m.Ids));
        }
        public async Task <IActionResult> Put([FromBody] string FileName, string UserId, string Id)
        {
            try
            {
                if (string.IsNullOrEmpty(UserId) || UserId.Length < 24)
                {
                    return(StatusCode(StatusCodes.Status406NotAcceptable, "Id Invalid"));
                }
                if (!ModelState.IsValid)
                {
                    return(StatusCode(StatusCodes.Status406NotAcceptable, ModelState));
                }
                Estudiante es = await _estudiante.Get(UserId);

                if (es == null)
                {
                    return(StatusCode(StatusCodes.Status406NotAcceptable, "No Hay Documentos"));
                }
                else
                {
                    foreach (Semestre us in es.Semestres)
                    {
                        foreach (Materia mat in us.Materias)
                        {
                            foreach (string Ids in mat.Archivos)
                            {
                                if (Ids.Equals(Id))
                                {
                                    await _archivo.Rename(Ids, FileName);

                                    return(Ok(JsonConvert.SerializeObject("Modificado")));
                                }
                            }
                        }
                    }
                    return(StatusCode(StatusCodes.Status406NotAcceptable, "No Existe Ese Archivo"));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
 public bool Equals(RecycleBinEventArgs other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && AllPropertyData.Equals(other.AllPropertyData) && Files.Equals(other.Files) && Ids.Equals(other.Ids) && NodeObjectType.Equals(other.NodeObjectType) && RecycleBinEmptiedSuccessfully == other.RecycleBinEmptiedSuccessfully);
 }