分类目录

链接

2014年二月
« 1月   3月 »
 12
3456789
10111213141516
17181920212223
2425262728  

近期文章

热门标签

博主推荐

现在位置:    首页 > .NET > 正文
LINQ to SQL公共基类 demo
.NET 暂无评论 阅读(1,334)
 public Form1()
        {
            InitializeComponent();
        }

        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //XtraForm1 frm = new XtraForm1();
            //frm.ShowDialog();
            var old = DbFactory<Users>.Instance.GetSingle(f => f.UserID == 2);
            old.TrueName = DateTime.Now.ToString();

            DbFactory<Users>.Instance.Update();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            var list = DbFactory<Users>.Instance.GetAll().Take(10);
            this.gridControl1.DataSource = list;
        }

        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

        }

        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string msg = DbFactory<Users>.Instance.GetSingle(f => f.UserID == 1).UserName;
            DevExpress.XtraEditors.XtraMessageBox.Show(msg);
        }

        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Form1_Load(nullnull);
        }

        private void barButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var msg = DbFactory<Notice>.Instance.GetSingle().NoticeTitle;
            DevExpress.XtraEditors.XtraMessageBox.Show(msg);
        }

本文版权归数据库之家所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:LINQ to SQL公共基类 demo | 数据库之家