分类

链接

2014 年 2 月
 12
3456789
10111213141516
17181920212223
2425262728  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > .NET > 正文
共享办公室出租
LINQ to SQL公共基类 demo
.NET 暂无评论 阅读(2,061)
 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's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:LINQ to SQL公共基类 demo | Bruce's Blog

发表评论

留言无头像?