Beispiel #1
0
        private void ProjectTAdjust(decimal d)
        {
            _Projects p = this.CurrentBusiness.Current as _Projects;

            DataRow[] EnRows = this.CurrentBusiness.Current.StructSource.ModelProject.Select("PID = 1");

            foreach (DataRow row in EnRows)
            {
                _Engineering einfo = this.CurrentBusiness.Current.Create() as _Engineering;
                _ObjectSource.GetObject(einfo, row);


                DataRow[]    UnRows = this.CurrentBusiness.Current.StructSource.ModelProject.Select(string.Format("PID = {0}", einfo.ID));
                _UnitProject pinfo  = null;

                foreach (DataRow r in UnRows)
                {
                    pinfo = r["UnitProject"] as _UnitProject;
                    if (pinfo == null)
                    {
                        //反序列化
                        pinfo = (this.CurrentBusiness as _Pr_Business).GetObject(r["OBJECT"]) as _UnitProject;
                        //回写到表中
                        pinfo.InSerializable(einfo);
                        _ObjectSource.GetObject(pinfo, r);
                        this.CurrentBusiness.Current.StructSource.ModelProject.AppendUnit(pinfo);
                        //pinfo.Property = new _Un_Property(pinfo);
                        //pinfo.Reveal = new
                    }

                    UnitProject(d, pinfo);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 创建项目欢迎界面
        /// </summary>
        /// <param name="p_Project"></param>
        public void CreateProjectWellCome(_Projects p_Project)
        {
            XtraTabPageEx xtp = null;

            xtp = XtraTabPageEx.CreateWellCome(p_Project);
            xtp.ShowCloseButton = DevExpress.Utils.DefaultBoolean.False;
            this.TabPages.Add(xtp);
        }
Beispiel #3
0
 public _Projects Import()
 {
     this.m_Business.Create();
     this.m_CProjects = this.m_Business.Current as _Projects;
     this.m_CProjects.Property.Name = m_建设项目.项目名称;
     this.m_Business.EndCreate();
     //APP.WorkFlows.Container.EndCreate();
     foreach (单项工程 item in m_建设项目.单项工程)
     {
         _Engineering Engineering = this.m_CProjects.Create() as _Engineering;
         SetEngineering(Engineering, item);
     }
     //  this.m_Business.EndCreate();
     return(this.m_CProjects);
     // return null;
 }
Beispiel #4
0
        /// <summary>
        /// 创建项目欢迎页面
        /// </summary>
        /// <param name="p_Project">当前项目</param>
        /// <returns></returns>
        public static XtraTabPageEx CreateWellCome(_Projects p_Project)
        {
            XtraTabPageEx xtp = new XtraTabPageEx();

            xtp.m_XtraTabType = "项目指引";
            xtp.Text          = p_Project.Property.Basis.Name;
            xtp.ImageIndex    = 0;
            CWellComeProject form = new CWellComeProject();

            form.FormBorderStyle = FormBorderStyle.None;
            form.Dock            = DockStyle.Fill;//设置样式是否填充整个PANEL
            //设置为非顶级控件
            form.TopLevel = false;
            //显示窗体
            form.Visible = true;
            xtp.Controls.Add(form);
            return(xtp);
        }
Beispiel #5
0
        public override void Calculate()
        {
            base.Calculate();
            //是否统计过
            //if (this.IsCalculate)

            /*{
             *  DialogResult r = MsgBox.Show(_Prompt.工程重新计算, MessageBoxButtons.YesNo);
             *  if (r == DialogResult.No)
             *  {
             *      return;
             *  }
             * }*/
            this.OnBeforeStatistical(this, null);

            _Projects info = this.CurrentBusiness.Current as _Projects;

            if (info != null)
            {
                if (info.Reveal == null)
                {
                    info.Reveal = new _Reveal(info);
                }
            }

            this.CurrentBusiness.Calculate();
            this.OnAfterStatisticaled(this, null);
            ActiveWindow.AppForm.SetWorkBar();
            this.IsCalculate = true;

            /*this.BWorker_Calculate.RunWorkerAsync();
             * ProgressFrom form = new ProgressFrom(this.BWorker_Calculate);
             * form.ShowDialog();*/

            /*this.CurrentBusiness.Current.Property.SubSegments.Statistics.Calculate();
             * this.CurrentBusiness.Current.Property.MeasuresProject.Load();
             * this.CurrentBusiness.Current.Property.MeasuresProject.Calculate();
             * this.CurrentBusiness.Current.Property.OtherProject.init();
             * this.CurrentBusiness.Current.Property.Metaanalysis.Init();
             * this.CurrentBusiness.Current.Property.Statistics.Begin();
             * this.CurrentBusiness.Current.Property.Metaanalysis.Calculate();
             * this.CurrentBusiness.Current.Property.Report.LoadDataSource();
             * this.IsCalculate = true;*/
        }
Beispiel #6
0
        private void ProjectsPeggingForm_Load(object sender, EventArgs e)
        {
            _Projects m_Projects = this.CurrentBusiness.Current as _Projects;

            if (m_Projects != null)
            {
                foreach (_Engineering m_Engineering in m_Projects.StrustObject.ObjectList.Values)
                {
                    foreach (_UnitProject m_UnitProject in m_Engineering.StrustObject.ObjectList.Values)
                    {
                        this.FileFBFX(m_UnitProject);
                        this.FileCSXM(m_UnitProject);
                    }
                }
                this.bindingSourceFBFX.DataSource = this.fbfx;
                this.bindingSourceCSXM.DataSource = this.csxm;
                this.gridViewCSXM.ExpandAllGroups();
                this.gridViewFBFX.ExpandAllGroups();
            }
        }
Beispiel #7
0
        /// <summary>
        ///公开的为CObject对象使用前调用的初始化对象(此前所有初始化数据对象的地方统一在此处调用)
        /// </summary>
        /// <param name="p_obj">业务对象</param>
        public void Init(_COBJECTS p_Info)
        {
            if (p_Info is _UnitProject)
            {
                _UnitProject info = p_Info as _UnitProject;
                this.Init(info);
                return;
            }

            if (p_Info is _Projects)
            {
                _Projects info = p_Info as _Projects;
                this.Init(info);
                return;
            }
            if (p_Info is _Engineering)
            {
                _Engineering info = p_Info as _Engineering;
                this.Init(info);
                return;
            }
        }
Beispiel #8
0
        void bWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker bWorker = sender as BackgroundWorker;

            object[]        param    = e.Argument as object[];
            _Projects       proj     = param[1] as _Projects;
            string          path     = param[0].ToString();
            int             percent  = 0;
            BinaryFormatter formater = new BinaryFormatter();

            using (FileStream stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                GZipStream zip = new GZipStream(stream, CompressionMode.Compress);
                {
                    bWorker.ReportProgress(++percent, proj);
                    using (MemoryStream ms = new MemoryStream())
                    {
                        //using (FileStream stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
                        {
                            /*GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true);
                             * //BinaryFormatter formater = new BinaryFormatter();
                             * proj.OutSerializable();
                             * formater.Serialize(zip, proj);
                             * byte[] buffer = ms.ToArray();
                             * zip.Write(buffer, 0, buffer.Length);
                             *
                             * stream.Write(
                             * zip.Close();
                             * stream.Close();*/

                            //GZipStream zip = new GZipStream(stream, CompressionMode.Compress,true);
                            //BinaryFormatter formater = new BinaryFormatter();
                            proj.OutSerializable();
                            formater.Serialize(ms, proj);
                            byte[] buffer = ms.ToArray();
                            zip.Write(buffer, 0, buffer.Length);
                            //zip.Close();
                            //stream.Close();
                            ms.Dispose();
                        }
                    }

                    //循环单项
                    foreach (_Engineering info in proj.StrustObject.ObjectList.Values)
                    {
                        bWorker.ReportProgress(++percent, info);
                        using (MemoryStream ms = new MemoryStream())
                        {
                            //using (FileStream stream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
                            {
                                //BinaryFormatter formater = new BinaryFormatter();

                                /*info.OutSerializable();
                                 * formater.Serialize(stream, info);
                                 * bWorker.ReportProgress(++percent, info);*/

                                //GZipStream zip = new GZipStream(stream, CompressionMode.Compress, true);
                                formater.Serialize(ms, info);
                                byte[] buffer = ms.ToArray();
                                zip.Write(buffer, 0, buffer.Length);
                                //zip.Close();
                                //stream.Close();
                            }
                            ms.Dispose();
                        }


                        foreach (_UnitProject up in info.StrustObject.ObjectList.Values)
                        {
                            bWorker.ReportProgress(++percent, up);
                            using (MemoryStream ms = new MemoryStream())
                            {
                                //using (FileStream stream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
                                {
                                    //BinaryFormatter formater = new BinaryFormatter();

                                    /*up.OutSerializable();
                                     * formater.Serialize(stream, up);
                                     * bWorker.ReportProgress(++percent, up);*/

                                    //GZipStream zip = new GZipStream(stream, CompressionMode.Compress, true);
                                    formater.Serialize(ms, up);
                                    byte[] buffer = ms.ToArray();
                                    zip.Write(buffer, 0, buffer.Length);
                                    //
                                    //zip.Close();
                                    //stream.Close();
                                }
                                ms.Dispose();
                            }
                        }
                    }

                    /*byte[] buffer = ms.ToArray();
                     * zip.Write(buffer, 0, buffer.Length);
                     * ms.Close();*/
                }
                zip.Dispose();
                stream.Dispose();
                GC.Collect();
            }
        }
Beispiel #9
0
 /// <summary>
 ///公开的为CObject对象使用前调用的初始化对象(此前所有初始化数据对象的地方统一在此处调用)
 /// </summary>
 /// <param name="p_obj">业务对象</param>
 public void Init(_Projects p_Info)
 {
     p_Info.Application = APP.Application;
     //初始化报表对象
     //p_Info.Property.Report.LoadReport(APP.Cache.BaseReport);
 }