Exemplo n.º 1
0
        /// <summary>
        /// 确定设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //确定时创建子目到清单
            _Entity_SubInfo info = new _Entity_SubInfo();
            DataRowView     view = this.bindingSource1.Current as DataRowView;

            ChangeDECJ(view);
            if (view != null)
            {
                using (var calculator = new Calculator(CurrentBusiness, Activitie))
                {
                    GLODSOFT.QDJJ.BUSINESS._Methods.SetSubheadingsInfo(info, view.Row, this.Activitie.Property.Libraries.FixedLibrary.FullName);
                    info.LB = "子目-降效";
                    _Mothods_MFixed fix            = new _Mothods_MFixed(this.CurrentBusiness, this.Activitie, this.m_MFixed);
                    var             createdMeasure = fix.Create(-1, info);
                    DataRow[]       rows           = this.Activitie.StructSource.ModelQuantity.Select(string.Format("ZMID={0} and SSLB={1}", info.ID, info.SSLB));
                    foreach (DataRow item in rows)
                    {
                        item["DEDJ"] = item["SCDJ"];
                    }
                    //fix.Calculate();
                    //var method = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntaceMet(this.CurrentBusiness, this.Activitie, createdMeasure);
                    //method.Calculate();
                    calculator.Entities.Add(info);

                    this.DialogResult = DialogResult.OK;
                }

                CurrentBusiness.FastCalculate();
            }
        }
Exemplo n.º 2
0
 private void NewProjectsInfo_Load(object sender, EventArgs e)
 {
     //创建新建项目操作流
     this.CurrentBusiness = APP.WorkFlows.Init(EWorkFlowType.PROJECT);
     //创建项目对象
     CurrentBusiness.Create();
     //设置项目路径
     this.CurrentBusiness.Current.Files = this.m_Profession.Files;
     //初始化默认数据
     this.basisInformation1.DataSource      = CurrentBusiness.Current;
     this.basisInformation1.CurrentBusiness = CurrentBusiness;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem13_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (this.m_Methods_Quantity.Current != null)
            {
                DialogResult dr = MsgBox.Show("确认删除?", MessageBoxButtons.YesNo);
                using (var calculator = new Calculator(CurrentBusiness, Activitie))
                {
                    if (dr == DialogResult.Yes)
                    {
                        this.GetCurrent();
                        this.GetPartQuantityUnit();
                        if (this.m_Methods_Quantity.Current["ZCLB"].Equals("W"))
                        {
                            this.m_Methods_Subheadings.Current.XMMC += "//删:" + this.m_Methods_Quantity.Current["MC"].ToString();
                            if (!this.m_Methods_Subheadings.Current.XMBM.Contains("换"))
                            {
                                this.m_Methods_Subheadings.Current.XMBM += "换";
                            }
                            if (this.m_Methods_Subheadings.Current.SSLB == 0)
                            {
                                this.Activitie.StructSource.ModelSubSegments.UpDate(this.m_Methods_Subheadings.Current);
                            }
                            else
                            {
                                this.Activitie.StructSource.ModelMeasures.UpDate(this.m_Methods_Subheadings.Current);
                            }
                            DataRow[] drs = this.m_Methods_Quantity.Current.GetChildRows("工料机-组成");
                            foreach (DataRow item in drs)
                            {
                                item.Delete();
                            }
                            this.m_Methods_Quantity.Current.Delete();
                            this.m_Methods_Subheadings.Begin(null);
                        }
                        else
                        {
                            APP.UserPriceLibrary.Range = 1;
                            this.m_Methods_Quantity.Current.Delete();
                            _Methods_Quantity.CalculateParentSCDJ(this.m_Methods_Quantity.Parent);
                            //this.m_Methods_Subheadings.BatchCalculate();
                        }

                        calculator.Entities.Add(m_Methods_Subheadings.Current);
                    }
                }
                CurrentBusiness.FastCalculate();
            }
        }
Exemplo n.º 4
0
        public void Load(string p_FileName)
        {
            /*object obj = CFiles.Deserialize(Path);
             * this.m_Source = obj as DataTable;
             * this.m_FilePath = Path;
             * FileInfo info = new FileInfo(Path);
             * this.m_FileName = info.Name.Replace(info.Extension, "");*/
            try
            {
                using (var calculator = new Calculator(CurrentBusiness, Unit))
                {
                    //删除工料机,子目取费。安装增加费
                    DataRow[] rowsGLJ = this.Unit.StructSource.ModelQuantity.Select("SSLB=1");
                    calculator.Entities.AddRange(_Entity_SubInfo.ParseMore(rowsGLJ));
                    foreach (DataRow item in rowsGLJ)
                    {
                        item.Delete();
                    }
                    DataRow[] rowsQF = this.Unit.StructSource.ModelSubheadingsFee.Select("SSLB=1");
                    calculator.Entities.AddRange(_Entity_SubInfo.ParseMore(rowsQF));
                    foreach (DataRow item in rowsQF)
                    {
                        item.Delete();
                    }
                    DataRow[] rowsZJF = this.Unit.StructSource.ModelIncreaseCosts.Select("SSLB=1");
                    calculator.Entities.AddRange(_Entity_SubInfo.ParseMore(rowsZJF));
                    foreach (DataRow item in rowsZJF)
                    {
                        item.Delete();
                    }
                    //更换模板
                    DataTable table = CFiles.Deserialize(p_FileName) as DataTable;
                    this.Unit.DataTemp.MDataTemp.FileName = p_FileName;
                    this.Unit.DataTemp.MDataTemp.IsChange = true;
                    //删除当前模板
                    this.Unit.StructSource.ModelMeasures.Clear();
                    this.Unit.StructSource.ModelMeasures.Add(this.Current);
                    this.Unit.StructSource.ModelMeasures.AcceptChanges();
                    this.LoadTempletTable(table, calculator);
                }

                CurrentBusiness.FastCalculate();
            }
            catch (Exception e)
            {
                throw e;
            }
        }