Beispiel #1
0
        public override int RetrieveAll()
        {
            //初始化数据到,表里面去.
            ArrayList als = ClassFactory.GetObjects("BP.GPM.BarBase");

            foreach (var item in als)
            {
                if (item == null)
                {
                    continue;
                }

                BP.GPM.BarBase en = (BP.GPM.BarBase)item;
                if (en == null)
                {
                    continue;
                }

                BP.GPM.Bar bar = new Bar();
                bar.No      = en.No;
                bar.Name    = en.Name;
                bar.Title   = en.Title;
                bar.MoreUrl = en.More;
                bar.Height  = en.Height;
                bar.Width   = en.Width;
                bar.Save();

                if (en.IsCanView == false)
                {
                    continue;
                }


                BP.GPM.BarEmp barEmp = new BarEmp();
                barEmp.MyPK = en.No + "_" + Web.WebUser.No;
                int i = barEmp.RetrieveFromDBSources();

                barEmp.FK_Bar = en.No;
                barEmp.FK_Emp = Web.WebUser.No;
                barEmp.IsShow = true;
                barEmp.Title  = en.Name;
                if (i == 0)
                {
                    barEmp.Insert();
                }
            }
            return(base.RetrieveAll());
        }
        public void InitMyBars()
        {
            Bars bars = new Bars();

            bars.RetrieveAll();
            foreach (Bar b in bars)
            {
                BarEmp be = new BarEmp();
                be.MyPK = BP.Web.WebUser.No + "_" + b.No;
                if (be.RetrieveFromDBSources() == 1)
                {
                    continue;
                }

                be.FK_Bar = b.No;
                be.FK_Emp = BP.Web.WebUser.No;
                be.IsShow = true;
                be.Insert();
            }
        }