Exemplo n.º 1
0
        public void DeleteHistory(int id)
        {
            var db   = new DataDeAnCEntities();
            var bill = db.Bills.Find(id);

            db.Bills.Remove(bill);
            db.SaveChanges();
        }
Exemplo n.º 2
0
        public void DeleteGood(int id)
        {
            var db   = new DataDeAnCEntities();
            var Good = db.Goods.Find(id);

            db.Goods.Remove(Good);
            db.SaveChanges();
        }
Exemplo n.º 3
0
        public void UpdateGood1(int id, int number)
        {
            var db  = new DataDeAnCEntities();
            var old = db.Goods.Find(id);

            old.Number          = number;
            db.Entry(old).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
Exemplo n.º 4
0
        public void UpdateGood(int id, string code, string nameitems, int number, DateTime date, int price, string status)
        {
            var db      = new DataDeAnCEntities();
            var Oldgood = db.Goods.Find(id);

            Oldgood.Code      = code;
            Oldgood.NameItems = nameitems;
            Oldgood.Number    = number;
            Oldgood.Date_Add  = date;
            Oldgood.UnitPrice = price;
            Oldgood.Status    = status;

            db.Entry(Oldgood).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
Exemplo n.º 5
0
        public void CreateBill(string item, int number, int unitprice, int totalprice, int good_id)
        {
            var bill = new Bill();

            bill.NameItems  = item;
            bill.Number     = number;
            bill.UnitPrice  = unitprice;
            bill.TotalPrice = totalprice;
            bill.Bill_id    = good_id;

            var db = new DataDeAnCEntities();

            db.Bills.Add(bill);
            db.SaveChanges();
        }
Exemplo n.º 6
0
        public void CreateGood(string code, string nameitems, int number, DateTime date, int price, string status)
        {
            var NewGood = new Good();

            NewGood.Code      = code;
            NewGood.NameItems = nameitems;
            NewGood.Number    = number;
            NewGood.Date_Add  = date;
            NewGood.UnitPrice = price;
            NewGood.Status    = status;

            var db = new DataDeAnCEntities();

            db.Goods.Add(NewGood);
            db.SaveChanges();
        }
Exemplo n.º 7
0
        public int CreateBuyGood(string customer, int phone, string email, string address, string note)
        {
            var Newbuygood = new BuyGood();

            Newbuygood.Customer_name = customer;
            Newbuygood.Phone_Number  = phone;
            Newbuygood.Email         = email;
            Newbuygood.Address       = address;
            Newbuygood.Note          = note;

            var db = new DataDeAnCEntities();

            db.BuyGoods.Add(Newbuygood);
            db.SaveChanges();
            return(Newbuygood.id);
        }