Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GoodTypeDataContext lq = new GoodTypeDataContext();
            var mylq = from gt in lq.GoodsType select gt;

            gvGoodsType.DataSource = mylq;
            gvGoodsType.DataBind();
        }
Exemple #2
0
        private void Insert()
        {
            GoodTypeDataContext lq = new GoodTypeDataContext();
            GoodsType           gt = new GoodsType();

            gt.tName = txtName.Text.Trim();
            lq.GoodsType.InsertOnSubmit(gt);
            lq.SubmitChanges();
        }
Exemple #3
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();
        }
Exemple #4
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();
        }