Exemplo n.º 1
0
        public void save(int billid, int date)
        {
            var bi = new Model.tripitem()
            {
                bill_id          = billid,
                item_id          = id,
                amount           = chargeamount,
                location_too     = to_id,
                location_form    = from_id,
                deliver_place    = deliver_place,
                date             = date,
                sender_name      = sendername,
                receivername     = receivername,
                receiverphone    = receiverphone,
                sender_phone     = senderphone,
                quantity         = quantity,
                unit             = unit,
                weight           = weight,
                created_at       = DateTime.Now,
                updated_at       = DateTime.Now,
                orderitemtype_id = itemtype_id,
                active           = true
            };
            var deactived = DB.Instance.orderitemlists.Find(id);

            deactived.active = false;
            DB.Instance.Entry(deactived).State = System.Data.Entity.EntityState.Modified;
            DB.Instance.tripitems.Add(bi);
            DB.Instance.SaveChanges();
        }
Exemplo n.º 2
0
        public void add(Model.tripitem billitem)
        {
            var viwer = new FinalDelivered.SenderViwer();

            viwer.id            = billitem.id;
            viwer.itemname      = (billitem.orderitemlist as Model.orderitemlist).itemname;
            viwer.sendername    = billitem.sender_name;
            viwer.receiverphone = billitem.receiverphone;
            viwer.receivername  = billitem.receivername;
            viwer.from          = (billitem.location as Model.location).name;
            viwer.tooo          = (billitem.location1 as Model.location).name;
            viwer.senderphone   = billitem.sender_phone;
            viwer.weight        = billitem.weight.Value;
            viwer.quantity      = billitem.quantity.Value;
            viwer.deliver_place = billitem.deliver_place;
            viwer.unit          = billitem.unit;
            viwer.rate          = billitem.amount.Value;
            viwer.Dock          = DockStyle.Top;
            panel_list.Controls.Add(viwer);
        }
Exemplo n.º 3
0
 public Viwer(Model.tripitem billitem, int sn)
 {
     for (int i = 0; i <= 16; i++)
     {
         SubItems.Add(new ListViewSubItem());
     }
     id                    = (int)billitem.item_id;
     sendername            = billitem.sender_name;
     senderphone           = billitem.sender_phone;
     receivername          = billitem.receivername;
     receiverphone         = billitem.receiverphone;
     itemname              = (billitem.orderitemlist as Model.orderitemlist).itemname;
     itemtype_id           = (int)billitem.orderitemtype_id;
     from_id               = (billitem.location as Model.location).id;
     to_id                 = (int)billitem.location_too;
     deliver_place         = billitem.deliver_place;
     unit                  = billitem.unit;
     quantity              = (decimal)billitem.quantity;
     weight                = (decimal)billitem.weight;
     date                  = (int)billitem.date;
     chargeamount          = (decimal)billitem.amount;
     this.SubItems[0].Text = sn.ToString();
 }