public ActionResult Sales(TBLSATISLAR saleitem) { db.TBLSATISLAR.Add(saleitem); db.SaveChanges(); return(View("Index")); }
public ActionResult YeniSatis(TBLSATISLAR p) { db.TBLSATISLAR.Add(p); db.SaveChanges(); return(View("Index")); }
public ActionResult YeniSatis(TBLSATISLAR p) { //var urn = db.TBLURUNLER.Where(x => x.URUNID == p.TBLURUNLER.URUNID).FirstOrDefault(); //p.TBLURUNLER = urn; db.TBLSATISLAR.Add(p); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult YeniSatis(TBLSATISLAR p1) { // var musteri = db.TBLMUSTERILER.Where(m => m.MUSTERIID == p1.TBLMUSTERILER.MUSTERIID).FirstOrDefault(); // p1.TBLMUSTERILER = musteri; // var urun = db.TBLURUNLER.Where(m => m.URUNID == p1.TBLURUNLER.URUNID).FirstOrDefault(); // p1.TBLURUNLER = urun; db.TBLSATISLAR.Add(p1); db.SaveChanges(); return(View("Index")); }
public ActionResult SatisYap(TBLSATISLAR p) { var ktg = db.TBLMUSTERI.Where(m => m.MUSTERIID == p.TBLMUSTERI.MUSTERIID).FirstOrDefault(); p.TBLMUSTERI = ktg; db.TBLSATISLAR.Add(p); db.SaveChanges(); return(View("Index")); }
public ActionResult Selling(TBLSATISLAR p2) { var product = db.TBLURUNLER.Where(m => m.URUNID == p2.TBLURUNLER.URUNID).FirstOrDefault(); var customer = db.TBLMUSTERILER.Where(m => m.MUSTERIID == p2.TBLMUSTERILER.MUSTERIID).FirstOrDefault(); p2.TBLURUNLER = product; p2.TBLMUSTERILER = customer; db.TBLSATISLAR.Add(p2); db.SaveChanges(); return(RedirectToAction("Sell")); }
public ActionResult Guncelle(TBLSATISLAR p1) { var sat = db.TBLSATISLAR.Find(p1.SATISID); //sat.URUN = p1.URUN; //sat.MUSTERI = p1.MUSTERI; sat.FIYAT = p1.FIYAT; sat.ADET = p1.ADET; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult YeniSatis(TBLSATISLAR p) { var urun = db.TBLURUNLER.Where(x => x.id == p.TBLURUNLER.id).FirstOrDefault(); var musteri = db.TBLMUSTERI.Where(x => x.id == p.TBLMUSTERI.id).FirstOrDefault(); var personel = db.TBLPERSONEL.Where(x => x.id == p.TBLPERSONEL.id).FirstOrDefault(); p.TBLURUNLER = urun; p.TBLMUSTERI = musteri; p.TBLPERSONEL = personel; p.tarih = DateTime.Parse(DateTime.Now.ToShortDateString()); db.TBLSATISLAR.Add(p); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult YeniSatis(TBLSATISLAR p) { //var satis = db.TBLSATISLAR.Find(p.ADET); var satis = db.TBLURUNLER.Find(p.URUN); for (int i = 0; i > p.ADET; i++) { satis.STOK--; } satis.STOK--; db.TBLSATISLAR.Add(p); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult YeniSatis(SalesVM p1) { TBLSATISLAR sat = new TBLSATISLAR() { KATEGORI = p1.CategoryID, URUN = p1.ProductID, MUSTERI = p1.CustomerID, FIYAT = p1.price, ADET = (byte)p1.ProductPiece, }; service.salesRepository.Insert(sat); var urun = service.productRepository.Find((int)sat.URUN); urun.STOK = Convert.ToByte(Convert.ToInt32(urun.STOK) - Convert.ToInt32(sat.ADET)); service.productRepository.Guncelle(urun); return(RedirectToAction("Index", "Urun")); }
public ActionResult YeniSatis(TBLSATISLAR p, TBLURUNLER p1) { var urun = db.TBLURUNLER.Where(x => x.URUNID == p.TBLURUNLER.URUNID).FirstOrDefault(); p.TBLURUNLER = urun; var adsoyad = db.TBLMUSTERILER.Where(x => x.MUSTERIID == p.TBLMUSTERILER.MUSTERIID).FirstOrDefault(); p.TBLMUSTERILER = adsoyad; db.TBLSATISLAR.Add(p); p.DURUM = true; urun.STOK -= p.ADET; var satisFiyat = urun.FIYAT * p.ADET; p.FIYAT = satisFiyat; ViewBag.satisFiyat = satisFiyat; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult YeniSatis(TBLSATISLAR satıs) { entity.TBLSATISLAR.Add(satıs); entity.SaveChanges(); return(RedirectToAction("Index")); }