public IActionResult DeleteImage(string token, [FromBody] List <ImageURL> imageURLs) { bool RoleId = JWTValidator.RoleIDTokenValidation(token); if (RoleId) { if (ModelState.IsValid) { foreach (var item in imageURLs) { ImageURL imageURL = new ImageURL(); imageURL.Id = item.Id; _context.Remove(imageURL); } _context.SaveChanges(); } else { var errors = ModelState.Select(x => x.Value.Errors) .Where(y => y.Count > 0) .ToList(); return(BadRequest(errors)); } return(Ok("Images Deleted")); } return(Unauthorized()); }
// This will get data from the addAnime windows void GetTrueData() { if ((TBl_AnimeName.Text == null || TBl_AnimeName.Text == "" || TBl_AnimeName.Text.Contains(";"))) { animeName_ = "unavaiable"; } else { animeName_ = TBl_AnimeName.Text; } if (!TBl_AnimeGenre.Text.Contains(";")) { animeGenre_ = TBl_AnimeGenre.Text; } else { animeGenre_ = "unavaiable"; } if (!TBl_AnimeText.Text.Contains(";")) { animeText_ = TBl_AnimeText.Text; } else { animeText_ = "unavaiable"; } if (!TBl_AnimeYear.Text.Contains(";")) { animeYear_ = TBl_AnimeYear.Text; } else { animeYear_ = "unavaiable"; } if (ImageURL == "" || ImageURL.Contains(";")) { animePictureUrl_ = "null"; } else { animePictureUrl_ = ImageURL; } if (ChB_AnimeSaw.IsChecked == true) { animeSaw_ = 1; } else { animeSaw_ = 0; } }
/// <summary> /// Adds the slected URL into the URL list and resets the textinput box. /// </summary> public void AddListItem() { if (URLInput.Input != "") { ImageURL.Add(URLInput.Input); URLInput.Input = ""; } StateHasChanged(); }
public IActionResult GetImages(string token, [FromQuery] ImageURL i) { bool RoleId = JWTValidator.RoleIDTokenValidation(token); if (RoleId) { var query = _context.imageURLs.OrderBy(m => i.Id); return(Ok(query)); } else { return(Unauthorized()); } }
static void Main(string[] args) { Audio sing = new Audio("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320); Image photo = new Image("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500"); Video clip = new Video("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best); AudioUrl sing1 = new AudioUrl("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320, "http://mmm"); ImageURL photo1 = new ImageURL("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500", "http://mmm"); VideoURL clip1 = new VideoURL("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best, "http://mmm"); Disk disk = new Disk("MyDisk", DateTime.Now); disk.Add(sing); disk.Add(photo); disk.Add(clip); // Error Serial serial = new Serial("MySerial", DateTime.Now); serial.Add(new Video("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best)); serial.Add(new Image("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500")); serial.Add(new Audio("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320)); // Error History history = new History("MyHistory", DateTime.Now); history.Add(photo); history.Add(photo1); history.Add(clip); history.Add(clip1); history.Add(sing); // Error Compilation comp = new Compilation("MyCompilation", DateTime.Now); comp.Add(sing); comp.Add(photo); comp.Add(sing1); //Error foreach (var i in comp) { Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(i.OpenItem()); } Console.ForegroundColor = ConsoleColor.White; // Console.WriteLine( history.OpenItem()); Console.ReadKey(); }
protected void Button1_Click(object sender, EventArgs e) { string st = ImageURL.FileName; string path = Server.MapPath(@"..\Products"); ImageURL.SaveAs(path + @"..\" + st); st = @"..\Products\" + ImageURL.FileName; Product proudct = new Product(ProductName.Text, int.Parse(CategoryID.SelectedValue.ToString()), int.Parse(Price.Text), st, int.Parse(Amount.Text), (Size.SelectedValue.ToString()), SuperHero.Text, Description.Text); int check = proudct.Insert(); if (check == -1) { Label1.Text = "הכנסת מוצר לא הצליחה"; } else { Label1.Text = "הכנסת מוצר בוצעה בהצלחה"; } }
public override bool Equals(object obj) { if (!(obj is EventDto entity)) { return(false); } if (Id == entity.Id && Title.Equals(entity.Title, StringComparison.OrdinalIgnoreCase) && Description.Equals(entity.Description, StringComparison.OrdinalIgnoreCase) && ImageURL.Equals(entity.ImageURL, StringComparison.Ordinal) && LayoutId == entity.LayoutId && Date.Equals(entity.Date) && CreatedBy == entity.CreatedBy) { return(true); } return(false); }
/// ----------------------------------------------------------------------------- /// <summary> /// InstantiateIn instantiates the template (implementation of ITemplate) /// </summary> /// <remarks> /// </remarks> /// <param name="container">The parent container (DataGridItem)</param> /// ----------------------------------------------------------------------------- public void InstantiateIn(Control container) { switch (ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: case ListItemType.EditItem: if (EditMode == ImageCommandColumnEditMode.URL) { var hypLink = new HyperLink(); hypLink.ToolTip = Text; if (!String.IsNullOrEmpty(ImageURL) && ShowImage) { var img = new Image(); if (DesignMode) { img.ImageUrl = ImageURL.Replace("~/", "../../"); } else { img.ImageUrl = ImageURL; } hypLink.Controls.Add(img); img.ToolTip = Text; } else { hypLink.Text = Text; } hypLink.DataBinding += Item_DataBinding; container.Controls.Add(hypLink); } else { if (!String.IsNullOrEmpty(ImageURL) && ShowImage) { var colIcon = new ImageButton(); if (DesignMode) { colIcon.ImageUrl = ImageURL.Replace("~/", "../../"); } else { colIcon.ImageUrl = ImageURL; } colIcon.ToolTip = Text; if (!String.IsNullOrEmpty(OnClickJS)) { ClientAPI.AddButtonConfirm(colIcon, OnClickJS); } colIcon.CommandName = CommandName; colIcon.DataBinding += Item_DataBinding; container.Controls.Add(colIcon); } if (!String.IsNullOrEmpty(Text) && !ShowImage) { var colLink = new LinkButton(); colLink.ToolTip = Text; if (!String.IsNullOrEmpty(OnClickJS)) { ClientAPI.AddButtonConfirm(colLink, OnClickJS); } colLink.CommandName = CommandName; colLink.Text = Text; colLink.DataBinding += Item_DataBinding; container.Controls.Add(colLink); } } break; case ListItemType.Footer: case ListItemType.Header: container.Controls.Add(new LiteralControl(Text)); break; } }
/// <summary> /// 속성들을 Xml Attribute로 생성합니다. /// </summary> /// <param name="writer">Attribute를 쓸 Writer</param> public override void GenerateXmlAttributes(System.Xml.XmlWriter writer) { base.GenerateXmlAttributes(writer); if (Id.IsNotWhiteSpace()) { writer.WriteAttributeString("Id", Id); } if (AllowDrag.HasValue) { writer.WriteAttributeString("AllowDrag", AllowDrag.Value.GetHashCode().ToString()); } if (Shape.HasValue) { writer.WriteAttributeString("Shape", Shape.Value.ToString()); } if (Height.HasValue) { writer.WriteAttributeString("Height", Height.Value.ToString()); } if (Width.HasValue) { writer.WriteAttributeString("Width", Width.Value.ToString()); } if (Radius.HasValue) { writer.WriteAttributeString("Radius", Radius.Value.ToString()); } if (NumSides.HasValue) { writer.WriteAttributeString("NumSides", NumSides.Value.ToString()); } if (ImageNode.HasValue) { writer.WriteAttributeString("ImageNode", ImageNode.Value.GetHashCode().ToString()); } if (ImageURL.IsNotWhiteSpace()) { writer.WriteAttributeString("ImageURL", ImageURL); } if (ImageAlign.HasValue) { writer.WriteAttributeString("ImageAlign", ImageAlign.Value.ToString()); } if (ImageWidth.HasValue) { writer.WriteAttributeString("ImageWidth", ImageWidth.Value.ToString()); } if (ImageHeight.HasValue) { writer.WriteAttributeString("ImageHeight", ImageHeight.Value.ToString()); } if (LabelAlign.HasValue) { writer.WriteAttributeString("LabelAlign", LabelAlign.Value.ToString()); } if (X.HasValue) { writer.WriteAttributeString("X", X.Value.ToString()); } if (Y.HasValue) { writer.WriteAttributeString("Y", Y.Value.ToString()); } if (ShowValue.HasValue) { writer.WriteAttributeString("ShowValue", ShowValue.Value.GetHashCode().ToString()); } }
/// <summary> /// Method connected to the listitems "onclick" event and removes the item. /// </summary> /// <param name="url"></param> public void RemoveListItem(string url) { ImageURL.Remove(url); StateHasChanged(); }