public IActionResult GetWhichIncludeColour(string colour) { var clothes = _finspoDbContext.Clothing.Where(c => c.Colour.ToLower() == colour.ToLower()).ToList(); List <Fashion> fashion = new List <Fashion>(); foreach (var c in clothes) { foreach (var f in _finspoDbContext.Fashion.ToList()) { if (f.Id == c.FashionId) { Fashion newFashion = new Fashion { Id = f.Id, Title = f.Title, Items = _finspoDbContext.Clothing.Where(c => c.FashionId == f.Id).ToList(), Link = f.Link, Source = f.Source }; fashion.Add(newFashion); } } } return(Ok(fashion)); }
public FashionEditWindow() { InitializeComponent(); bufferData = BufferData.GetInstance(); Fashion fashion = (Fashion)bufferData.CurrentRow; string str = bufferData.NameOfAttribDictinionary["IdFashion"]; label1.Content = str; str = bufferData.NameOfAttribDictinionary["Name"]; label2.Content = str; str = bufferData.NameOfAttribDictinionary["Definition"]; label3.Content = str; if (bufferData.EditMode == BufferData.EditModes.Update) { oldId = fashion.IdFashion; textBox1.Text = fashion.IdFashion.ToString(); textBox2.Text = fashion.Name; textBox3.Text = fashion.Definition; } if (bufferData.EditMode == BufferData.EditModes.Insert) { oldId = -1; textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; } }
// Methods protected override void Build() { // Get GameObjects Prefab = PrefabUtils.CopyPrefab(BaseItem); Prefab.name = NamePrefix + Name; Prefab.transform.localScale = Scale; // Load Components Fashion fash = Prefab.GetComponent <Fashion>(); Rigidbody body = Prefab.GetComponent <Rigidbody>(); Vacuumable vac = Prefab.GetComponent <Vacuumable>(); Identifiable iden = Prefab.GetComponent <Identifiable>(); Image front = Prefab.transform.Find("Icon Pivot/ShopIconUI/Image").GetComponent <Image>(); Image back = Prefab.transform.Find("Icon Pivot/ShopIconUI/Image Back").GetComponent <Image>(); // Setup Components fash.slot = Slot; fash.attachPrefab = AttachPrefab ? AttachPrefab : fash.attachPrefab; body.mass = Mass; vac.size = Size; iden.id = ID; front.sprite = Icon; back.sprite = Icon; }
public void ObserverTest() { var fashion = new Fashion(); var woman = new FashionWoman(fashion); fashion.FashionShow(); }
static void Main(string[] args) { Fashion fashionDepartment = new Fashion(); fashionDepartment.DisplayPromotions(); Console.ReadKey(); }
public static void Main(string[] args) { Fashion f = new Fashion(1, "ao", 20, 20, "Ngoc trinh", "tiep", "red", "m"); f.checkSizeColor("red", "m"); Diamon d = new Diamon(1, "ao", 20, 20, "Ngoc trinh", "tiep", 15); d.checkCare(); }
public static void Main(string[] args) { Product p = new Product(1, "xzy", 8000, 3, "as", "acs"); Diamon d = new Diamon(1, "xzy", 8000, 3, "as", "acs", 9); Fashion f = new Fashion(1, "xzy", 8000, 3, "as", "acs", "xanh", 2); f.color = "xanh"; f.size = 2; f.check("xanh", 2); }
public async Task <string> Handle(CreateFashionCommand request, CancellationToken cancellationToken) { var entity = new Fashion { Name = request.Name }; await _context.Fashions.AddAsync(entity); await _context.SaveChangesAsync(cancellationToken); return(entity.Name); }
public IActionResult Post([FromBody] Fashion fashion, string key) { if (!_finspoDbContext.AuthorizedUser.ToList().Any(au => au.Key == key)) { return(StatusCode(StatusCodes.Status401Unauthorized)); } foreach (Clothing item in fashion.Items) { _finspoDbContext.Clothing.Add(item); } _finspoDbContext.Fashion.Add(fashion); _finspoDbContext.SaveChanges(); return(StatusCode(StatusCodes.Status201Created, fashion)); }
// GET: Admin/Fashions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Fashion fashion = db.Fashions.Find(id); if (fashion == null) { return(HttpNotFound()); } ViewBag.AuthorId = new SelectList(db.Authors, "Id", "Name", fashion.AuthorId); ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", fashion.CategoryId); return(View(fashion)); }
// GET: Admin/Fashions/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Fashion fashion = db.Fashions.Find(id); if (fashion == null) { return(HttpNotFound()); } db.Fashions.Remove(fashion); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] args) { restaurants r = new restaurants(); Fashion Fash = new Fashion(); Fashion F = new Fashion(); Console.WriteLine("This is the main method landing page"); r.Chipotle(); F.pants(); F.shoes(); r.Benihana(); }
public ActionResult Create([Bind(Include = "Id,CategoryId,AuthorId,PhotoUpload,Tittle,Description,Date,Status,CreateAt")] Fashion fashion) { try { fashion.Photo = FileManager.Upload(fashion.PhotoUpload); } catch (Exception e) { ModelState.AddModelError("PhotoUpload", e.Message); } if (ModelState.IsValid) { db.Fashions.Add(fashion); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fashion)); }
public IActionResult Get() { var fashion = _finspoDbContext.Fashion; List <Fashion> newFashion = new List <Fashion>(); foreach (var f in fashion.ToList()) { Fashion newFashionItem = new Fashion { Id = f.Id, Title = f.Title, Items = _finspoDbContext.Clothing.Where(c => c.FashionId == f.Id).ToList(), Link = f.Link, Source = f.Source }; newFashion.Add(newFashionItem); } return(Ok(newFashion)); }
public ActionResult Edit([Bind(Include = "Id,CategoryId,AuthorId,Photo,Tittle,Description,Date,Status,CreateAt,PhotoUpload")] Fashion fashion) { try { fashion.Photo = FileManager.Upload(fashion.PhotoUpload); } catch (Exception e) { ModelState.AddModelError("PhotoUpload", e.Message); } if (ModelState.IsValid) { db.Entry(fashion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AuthorId = new SelectList(db.Authors, "Id", "Name", fashion.AuthorId); ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", fashion.CategoryId); return(View(fashion)); }
public static void Main(string[] args) { Product p1 = new Diamon(1, "Diamon 2C", 5000, 2, "link1", "desc", 2.0); Product p2 = new Fashion(1, "jeans", 50000, 10, "img1", "desc", "black", "XL"); Product p3 = new Product(1, "Toy", 100000, 10, "img1", "desc"); Cart c = new Cart(); c.city = "Hn"; c.country = "Vietnam"; c.addPro(p1); c.addPro(p1); c.addPro(p2); c.addPro(p2); c.show(); c.total(); c.addPro(p1); c.removePro(p2); c.addPro(p3); c.show(); c.total(); }
protected override void Build() { // Pre Build Manipulation // Build Control base.Build(); // Post Build Manipulation Fashion fash = Prefab.GetComponent <Fashion>(); Fashion other = SRObjects.Get <GameObject>("fashionHandlebar").GetComponent <Fashion>(); fash.attachPrefab = PrefabUtils.CopyPrefab(other.attachPrefab); Material mat = SRObjects.GetInst <Material>("FashionPod1"); for (int i = 0; i < 8; i++) { mat.SetColor("_Color" + i + "0", ColorUtils.FromHex("eeeeee")); mat.SetColor("_Color" + i + "1", ColorUtils.FromHex("aaaaaa")); } fash.attachPrefab.FindChild("model_fp_handlebars").GetComponent <MeshRenderer>().sharedMaterial = mat; }
public static void Main(string[] args) { Diamond dim = new Diamond(1, "Diamond Black", 10000, 1, "diamond.png", "This is a black diamond", 20); Product fs1 = new Fashion(2, "T-Shirt", 2000, 2, "t-shirt.jpg", "This is T-shirt", "red", "XL"); Product fs2 = new Fashion(3, "Adidas Ultraboost", 5000, 5, "ultraboot.png", "This is Ultraboost", "black", "44"); Cart ca = new Cart(1, "Dang Jinner", "Ninh Binh", "Vietnam"); ca.AddNewProduct(dim); ca.AddNewProduct(fs1); ca.AddNewProduct(fs2); ca.RemoveProduct(dim); ca.AddQuantityProduct(fs1, 10); ca.DecreaseQuantityProduct(fs2, 4); Console.WriteLine("ID khach hang: " + ca.Id); Console.WriteLine("Ten khach hang: " + ca.Customer); Console.WriteLine("Thanh pho: " + ca.City); Console.WriteLine("Quoc gia: " + ca.Country); Console.WriteLine("Gio hang: "); Console.WriteLine("---------------"); ca.GetProductInCart(); Console.WriteLine("---------------"); Console.WriteLine("Tong tien la: " + ca.CalcGrandTotal()); }
public static void Main(string[] args) { /*int n; * int n1 = 0; * int n2 = 1; * int n3; * Console.WriteLine("Nhap vao mot so n: "); * n = Convert.ToInt32(Console.ReadLine()); * * for (int i = 2; true; i++) * { * n3 = n1 + n2; * n1 = n2; * n2 = n3; * * if (n3 > n) * { * Console.WriteLine("So thuoc day fibonaci gan "+n +" la: " +n1); * break; * } * } * * Student s1 = new Student("Nguyen Hai Dang", 19); * s1.ShowInfo(); * * Student[] svArray = new Student[3]; * svArray[0] = s1; * svArray[1] = new Student("Nguyen Hai Dang", 19); * svArray[2] = new Student("Nguyen Hai Dang", 19); * * //list * List<Student> listStudents = new List<Student>(); * listStudents.Add(new Student("Nguyen Hai Dang", 19));*/ /*Product prod = new Product(1, "Iphone", 2000, 5, "image1", "SmartPhone"); * prod.GetInfo(); * prod.NotificationQuantity(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.AddImageToGallery(); * prod.DeleteImageInGallery(); * prod.GetInfo();*/ Fashion fs = new Fashion(1, "T-Shirt", 1000, 5, "im1", "clothes", "red", "M"); fs.GetInfo(); fs.NotificationQuantity(); fs.CheckInStock("red", "M"); fs.CheckInStock("red", "S"); Diamond diam = new Diamond(2, "Diamond", 10000000, 1, "imgdiamond", "diamond rare", 2); diam.GetInfo(); }