public ActionResult Add(SaleMovement saleMovement)
 {
     saleMovement.Date = DateTime.Parse(DateTime.Now.ToShortDateString());
     db.SaleMovements.Add(saleMovement);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
 public ActionResult NewSale(SaleMovement sale)
 {
     sale.SaleMovementDate = DateTime.Parse(DateTime.Now.ToShortDateString());
     context.SaleMovements.Add(sale);
     context.SaveChanges();
     return(RedirectToAction("Index"));
 }
        public ActionResult Update(SaleMovement saleMovement)
        {
            var guncelle = db.SaleMovements.Find(saleMovement.SaleId);

            guncelle.CurrentAccountId = saleMovement.CurrentAccountId;
            guncelle.Number           = saleMovement.Number;
            guncelle.Price            = saleMovement.Price;
            guncelle.EmployeeId       = saleMovement.EmployeeId;
            guncelle.Date             = saleMovement.Date;
            guncelle.TotalAmount      = saleMovement.TotalAmount;
            guncelle.ProductId        = saleMovement.ProductId;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        public ActionResult UpdateSale(SaleMovement saleMovement)
        {
            var result = context.SaleMovements.Find(saleMovement.SaleMovementId);

            result.Customerid             = saleMovement.Customerid;
            result.Productid              = saleMovement.Productid;
            result.Employeeid             = saleMovement.Employeeid;
            result.SaleMovementPrice      = saleMovement.SaleMovementPrice;
            result.SaleMovementTotalPrice = saleMovement.SaleMovementTotalPrice;
            result.SaleMovementUnit       = saleMovement.SaleMovementUnit;
            result.SaleMovementDate       = saleMovement.SaleMovementDate;
            context.SaveChanges();
            return(RedirectToAction("Index"));
        }