public void Delete(domain.Basic_Set entity) { using (ISession session = sessionFactory.OpenSession()) { session.Delete(entity); session.Flush(); } }
public object Save(domain.Basic_Set entity) { using (ISession session = sessionFactory.OpenSession()) { var id = session.Save(entity); session.Flush(); return(id); } }
/****************************我的工作台左测导航栏点击事件****************************************/ private void accordionControlElement35_Click(object sender, EventArgs e) { main_basic = new Basic_Set(); main_basic.Show(); main_basic.Dock = DockStyle.Fill; panel2.Controls.Clear(); panel2.Controls.Add(main_basic); domain.Basic_Set basic_set = new domain.Basic_Set(); Basic_Set dbs = new Basic_Set(); main_basic.gridControl2.DataSource = showData <domain.Basic_Set>(basic_set, main_basic.now_Page.ToString()); main_basic.gridView2.Columns[0].Caption = "编号"; main_basic.gridView2.BestFitColumns(); }
private void dataNavigator_Basic_Set_ButtonClick(object sender, NavigatorButtonClickEventArgs e) //分页 { NavigatorButtonType btnType = (NavigatorButtonType)e.Button.ButtonType; if (e.Button is NavigatorCustomButton) { NavigatorCustomButton btn = (NavigatorCustomButton)e.Button; if (btn.Tag.ToString() == "下一页" && now_Page < total_Page) { now_Page++; dataNavigator_Basic_Set.TextStringFormat = string.Format("第 {0}页,共 {1}页", now_Page, total_Page); domain.Basic_Set bs = new domain.Basic_Set(); gridControl2.DataSource = fc.showData <domain.Basic_Set>(bs, now_Page.ToString()); } else if (btn.Tag.ToString() == "上一页" && now_Page > 1) { now_Page--; dataNavigator_Basic_Set.TextStringFormat = string.Format("第 {0}页,共 {1}页", now_Page, total_Page); domain.Basic_Set bs = new domain.Basic_Set(); gridControl2.DataSource = fc.showData <domain.Basic_Set>(bs, now_Page.ToString()); } else if (btn.Tag.ToString() == "首页") { now_Page = 1; dataNavigator_Basic_Set.TextStringFormat = string.Format("第 {0}页,共 {1}页", now_Page, total_Page); domain.Basic_Set bs = new domain.Basic_Set(); gridControl2.DataSource = fc.showData <domain.Basic_Set>(bs, now_Page.ToString()); } else if (btn.Tag.ToString() == "尾页") { now_Page = total_Page; dataNavigator_Basic_Set.TextStringFormat = string.Format("第 {0}页,共 {1}页", now_Page, total_Page); domain.Basic_Set bs = new domain.Basic_Set(); gridControl2.DataSource = fc.showData <domain.Basic_Set>(bs, now_Page.ToString()); } } }