Ejemplo n.º 1
0
        private static TaxOnLine addTaxLine(LineViewModel l)
        {
            var o = new TaxOnLine();

            l.Update(o);
            return(o);
        }
Ejemplo n.º 2
0
        public static void Delete(TaxOnLine instance)
        {
            var db = new DefaultConnection();

            db.OrderLines.Remove(new LineViewModel(instance));
            db.SaveChanges();
        }
Ejemplo n.º 3
0
        public void AddTaxTest()
        {
            var fakeTaxOnLineOne = new TaxOnLine();
            var fakeTaxOnLineTwo = new TaxOnLine();

            M.AddTax(fakeTaxOnLineOne);
            Assert.AreEqual(1, TaxOnLines.Instance.Count);
            M.AddTax(fakeTaxOnLineTwo);
            Assert.AreEqual(2, TaxOnLines.Instance.Count);
        }
Ejemplo n.º 4
0
 public void Update(TaxOnLine line)
 {
     line.ExpectedDeliveryDate = ExpectedDeliveryDate;
     line.UniqueId             = UniqueId;
     line.OrderId     = OrderId;
     line.OrderLineId = OrderLineId;
     line.Rate        = TaxRate;
     line.Type        = TaxType;
     line.Comment     = Comment;
 }
Ejemplo n.º 5
0
 public LineEditModel(TaxOnLine line)
 {
     ExpectedDeliveryDate = line.ExpectedDeliveryDate;
     UniqueId             = line.UniqueId;
     OrderLineId          = line.OrderLineId;
     OrderId = line.OrderId;
     Comment = line.Comment;
     TaxType = line.Type;
     TaxRate = line.Rate;
 }
Ejemplo n.º 6
0
 public LineViewModel(TaxOnLine line)
 {
     ExpectedDeliveryDate = line.ExpectedDeliveryDate;
     LineType             = line.GetType().Name;
     UniqueId             = line.UniqueId;
     OrderId     = line.OrderId;
     OrderLineId = line.OrderLineId;
     TaxRate     = line.Rate;
     TaxType     = line.Type;
     Comment     = line.Comment;
 }
Ejemplo n.º 7
0
        public void RemoveTaxOnLineTest()
        {
            var fakeTaxOnLineOne = TaxOnLine.Random();
            var fakeTaxOnLineTwo = TaxOnLine.Random();

            Obj.AddTax(fakeTaxOnLineOne);
            Obj.AddTax(fakeTaxOnLineTwo);
            Assert.AreEqual(2, OrderLines.Instance.Count);
            Obj.RemoveTax(fakeTaxOnLineOne);
            Assert.AreEqual(1, OrderLines.Instance.Count);
        }
Ejemplo n.º 8
0
        public ActionResult CreateTaxOnLine(
            [Bind(Include = "UniqueID, OrderId, OrderLineId, TaxType, TaxRate, Comment")]
            LineEditModel k)
        {
            if (!ModelState.IsValid)
            {
                return(View("EditTaxOnLine", k));
            }
            var line = new TaxOnLine();

            k.Update(line);
            Business.Save(line);
            return(RedirectToAction("OrderDetails", "Order", new { id = k.OrderId }));
        }
Ejemplo n.º 9
0
        public ActionResult CreateTaxOnLine(
            [Bind(Include = "UniqueID, ExpectedDeliveryDate, Comment")]
            LineEditModel k)
        {
            if (!ModelState.IsValid)
            {
                return(View("EditTaxOnLine", k));
            }
            var line = new TaxOnLine();

            k.Update(line);
            OrderLines.Instance.Add(line);
            return(RedirectToAction("OrderDetails"));
        }
Ejemplo n.º 10
0
 public void Initialize()
 {
     T = new TaxOnLine();
 }
Ejemplo n.º 11
0
 public TaxOnLineDetailsViewModel(TaxOnLine taxonline)
 {
     Type = taxonline.Type;
     Rate = taxonline.Rate;
 }