예제 #1
0
        public void Dump(string path, bool includePages, bool includeImages)
        {
            HelpDB tmp = new HelpDB();

            System.Data.DataTable dt;

            if (includePages)
            {
                dt = DB.hlpPage.GetChanges();
                if (dt != null)
                {
                    tmp.hlpPage.Merge(dt);
                }
                else
                {
                    tmp.hlpPage.Merge(DB.hlpPage);
                }
            }
            if (includeImages)
            {
                dt = DB.hlpImage.GetChanges();
                if (dt != null)
                {
                    tmp.hlpImage.Merge(dt);
                }
                else
                {
                    tmp.hlpImage.Merge(DB.hlpImage);
                }
            }

            tmp.hlpXml.Merge(DB.hlpXml);
            tmp.WriteXml(path);
        }
예제 #2
0
        public HelpManager(atriumBE.atriumManager atmng)
            : base(atmng.AppMan)
        {
            base.DAL = atmng.DALMngr;
            myatMng  = atmng;


            MyDS = new HelpDB();
            MyDS.EnforceConstraints = false;
        }
예제 #3
0
        public void Import(string path)
        {
            //load xml into dataset
            lmDatasets.HelpDB hlpDS = new HelpDB();
            hlpDS.ReadXml(path);

            //loop through page table
            foreach (lmDatasets.HelpDB.hlpPageRow hpr in hlpDS.hlpPage)
            {
                lmDatasets.HelpDB.hlpPageRow curr_hpr = DB.hlpPage.FindByFileNameLang(hpr.FileName, hpr.Lang);


                if (curr_hpr == null)
                {
                    //if record does not -add
                    curr_hpr = DB.hlpPage.NewhlpPageRow();
                    CopyRow(hpr, curr_hpr);
                    DB.hlpPage.AddhlpPageRow(curr_hpr);
                }
                else
                {
                    CopyRow(hpr, curr_hpr);
                }
            }
            //GethlpPage().Update();

            //myatMng.AppMan.Commit();
            //DB.hlpPage.AcceptChanges();

            //loop through image table
            foreach (lmDatasets.HelpDB.hlpImageRow hpr in hlpDS.hlpImage)
            {
                lmDatasets.HelpDB.hlpImageRow curr_hpr = DB.hlpImage.FindByFileName(hpr.FileName);


                if (curr_hpr == null)
                {
                    //if record does not -add
                    curr_hpr = DB.hlpImage.NewhlpImageRow();
                    CopyRow(hpr, curr_hpr);
                    DB.hlpImage.AddhlpImageRow(curr_hpr);
                }
                else
                {
                    CopyRow(hpr, curr_hpr);
                }

                //GethlpImage().Update();

                //myatMng.AppMan.Commit();
                //DB.hlpImage.AcceptChanges();
            }

            //loop through Xml table
            foreach (lmDatasets.HelpDB.hlpXmlRow hpr in hlpDS.hlpXml)
            {
                lmDatasets.HelpDB.hlpXmlRow curr_hpr = DB.hlpXml.FindByFileName(hpr.FileName);


                if (curr_hpr == null)
                {
                    //if record does not -add
                    curr_hpr = DB.hlpXml.NewhlpXmlRow();
                    CopyRow(hpr, curr_hpr);
                    DB.hlpXml.AddhlpXmlRow(curr_hpr);
                }
                else
                {
                    CopyRow(hpr, curr_hpr);
                }
            }
            //GethlpXml().Update();

            //myatMng.AppMan.Commit();
            //DB.hlpXml.AcceptChanges();

            atLogic.BusinessProcess bp = GetBP();
            bp.AddForUpdate(GethlpPage());
            bp.AddForUpdate(GethlpXml());
            bp.AddForUpdate(GethlpImage());
            bp.Update();
        }