static void Main() { SessionManager sessionmanager = new SessionManager("hibernate_config.xml"); ISession session = sessionmanager.GetSession(); // 相关操作的接口 PrjManager manager = new PrjManager(session); //add your code bellow Prj_Sheet sheet = manager.SheetCRUD.GetPrj_Sheet_By_ID(202); Cld_FCBlock temp = sheet.New_Cld_FCBlock(); temp.AlgName = "weifdajflkjdlkajfkldjlkajfkdjkaljfkdjajfldjalfjlkajfldjlak"; manager.persistence_save(temp); //释放相关资源 manager.Close(); Console.WriteLine("\nPress Enter to Exit !"); Console.ReadKey(); //以下为GUI运行 //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); }
static void Main() { SessionManager sessionmanager = new SessionManager("hibernate_config.xml"); ISession session = sessionmanager.GetSession(); // 相关操作的接口 PrjManager manager = new PrjManager(session); //add your code bellow TDK.Core.Logic.URdoLib.URdoManager man = new TDK.Core.Logic.URdoLib.URdoManager(); StateManager sm = new StateManager(); for (int i = 169; i <= 179; i++) { Prj_Sheet sheet = manager.SheetCRUD.Load_Sheet(i,sm); Cld_FCBlock weiyuanke = sheet.New_Cld_FCBlock(); weiyuanke.FunctionName = "fortest"; manager.Save(weiyuanke); Cld_FCInput input = weiyuanke.New_FCInput(); Console.WriteLine(sheet.State); sheet.SheetName = "weiyuantafkjaljfl"; Console.WriteLine(sheet.State); Cld_FCBlock b = sheet.Cld_FCBlock_List[0] as Cld_FCBlock; Console.WriteLine(b.State); sheet.Cld_FCBlock_List.RemoveAt(0); Console.WriteLine(b.State); sheet.Cld_FCBlock_List.Add(b); Console.WriteLine(b.State); Cld_FCBlock temp = sheet.New_Cld_FCBlock(); Console.WriteLine(temp.State); sheet.Cld_FCBlock_List.Add(temp); Console.WriteLine(temp.State); } //GraphicsDocument.GenerateProjects(bll); // 产生xml文件的代码 //Prj_Sheet sheet = bll.manager.SheetCRUD.Load_Sheet(170); //Generate_Sheet_Xml(sheet, bll); //释放相关资源 //bll.Close(); Console.WriteLine("\nPress Enter to Exit !"); Console.ReadKey(); //以下为GUI运行 //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); }