Esempio n. 1
0
        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());


        }
Esempio n. 2
0
 public static void nhibernate_enumerable_test(PrjManager manager){
     IEnumerable<Cld_FCParameter> paras = manager.session.CreateQuery("select from Cld_FCParameter c")
         .Enumerable<Cld_FCParameter>();
     
     foreach(Cld_FCParameter p in paras){
         Console.WriteLine(p.Name);
     }
 }
Esempio n. 3
0
        private static void load_commit_test(PrjManager manager)
        {
            Prj_Sheet sheet = manager.SheetCRUD.Load_Sheet(2316);
            Prj_Sheet backup = ObjectCopier.Clone(sheet);


            Cld_FCBlock block = sheet.New_Cld_FCBlock();
            block.AlgName = "added";
            block.Sequence = 12;

            Cld_FCInput inpt = block.New_FCInput();
            inpt.Description = "added desc";
            inpt.PinName = "for test";

            Cld_FCOutput output = block.New_FCOutput();
            output.PinName = "for test output";


            SheetDiffer diff = manager.SheetCRUD.CompareSheet(backup, sheet);
            manager.SheetCRUD.Commit_Sheet(diff);
        }
Esempio n. 4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="session"></param>
 public BllManager(ISession session)
 {
     this.manager = new PrjManager(session);
     this.funcname_to_MetaFCMaster = new Hashtable();
 }
Esempio n. 5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="prjmanager"></param>
 public BllManager(PrjManager prjmanager)
 {
     this.manager = prjmanager;
     this.funcname_to_MetaFCMaster = new Hashtable();
 }
Esempio n. 6
0
        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());

            
        }