Exemplo n.º 1
0
        private void Insert()
        {
            GoodTypeDataContext lq = new GoodTypeDataContext();
            GoodsType           gt = new GoodsType();

            gt.tName = txtName.Text.Trim();
            lq.GoodsType.InsertOnSubmit(gt);
            lq.SubmitChanges();
        }
Exemplo n.º 2
0
        private void Delete()
        {
            GoodTypeDataContext lq = new GoodTypeDataContext();
            var types = from gt in lq.GoodsType where gt.tName == txtNameDe.Text.Trim() select gt;

            foreach (var type in types)
            {
                lq.GoodsType.DeleteOnSubmit(type);
            }
            lq.SubmitChanges();
        }
Exemplo n.º 3
0
        private void Update()
        {
            GoodTypeDataContext lq = new GoodTypeDataContext();
            var types = from gt in lq.GoodsType where gt.tName == txtNamebe.Text.Trim() select gt;

            foreach (var type in types)
            {
                type.tName = txtNameaf.Text.Trim();
            }
            lq.SubmitChanges();
        }