Beispiel #1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Activitie.StructSource.ModelSubheadingsFee.RemoveAll();
            this.Activitie.DataTemp.ZMQFDataTemp.IsChange = true;
            DataRow[] m_FBFXZM = this.Activitie.StructSource.ModelSubSegments.Select("LB='子目' OR LB='子目-降效' OR LB='子目-增加费'");
            DataRow[] m_CSXMZM = this.Activitie.StructSource.ModelMeasures.Select("LB='子目' OR LB='子目-降效' OR LB='子目-增加费'");
            this.m_ZMCount = m_FBFXZM.Length + m_CSXMZM.Length;
            foreach (DataRow item in m_FBFXZM)
            {
                _Entity_SubInfo m_Entity_SubInfo = new _Entity_SubInfo();
                _ObjectSource.GetObject(m_Entity_SubInfo, item);
                _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(this.CurrentBusiness, this.Activitie, m_Entity_SubInfo);

                m_Methods_Subheadings.CreateZMQFS();
            }
            foreach (DataRow item in m_CSXMZM)
            {
                _Entity_SubInfo m_Entity_SubInfo = new _Entity_SubInfo();
                _ObjectSource.GetObject(m_Entity_SubInfo, item);
                _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(this.CurrentBusiness, this.Activitie, m_Entity_SubInfo);

                m_Methods_Subheadings.CreateZMQFS();
            }
            GLODSOFT.QDJJ.BUSINESS._Project_Statistics m_Project_Statistics = new GLODSOFT.QDJJ.BUSINESS._Project_Statistics(this.Activitie, this.CurrentBusiness);
            m_Project_Statistics.Calculate();
            MsgBox.Alert(m_ZMCount + "条定额刷新成功");
        }
Beispiel #2
0
 public InventoryGraphAnalysis(_Business p_Business, _UnitProject p_Activitie, ABaseForm p_AParentForm)
 {
     this.CurrentBusiness  = p_Business;
     this.Activitie        = p_Activitie;
     this.AParentForm      = p_AParentForm;
     m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie);
     InitializeComponent();
 }
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="p_Business">当前业务</param>
 /// <param name="p_Activitie">当前单位工程</param>
 /// <param name="p_AParentForm">父级窗体</param>
 public StandardConversionForm(_Business p_Business, _UnitProject p_Activitie, ABaseForm p_AParentForm)
 {
     this.CurrentBusiness         = p_Business;
     this.Activitie               = p_Activitie;
     this.AParentForm             = p_AParentForm;
     m_Methods_Subheadings        = new _Methods_Subheadings(this.Activitie);
     m_Methods_StandardConversion = new _Methods_StandardConversion(this.Activitie);
     InitializeComponent();
 }
Beispiel #4
0
 public AreaQuantityUnit(_Business p_Business, _UnitProject p_Activitie, ABaseForm p_AParentForm, string p_FormName)
 {
     this.CurrentBusiness  = p_Business;
     this.Activitie        = p_Activitie;
     this.AParentForm      = p_AParentForm;
     m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie);
     this.Text             = p_FormName;
     InitializeComponent();
 }
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="p_Business">当前业务</param>
 /// <param name="p_Activitie">当前单位工程</param>
 /// <param name="p_AParentForm">父级窗体</param>
 public SubheadingsQuantityUnit(_Business p_Business, _UnitProject p_Activitie, ABaseForm p_AParentForm)
 {
     this.CurrentBusiness  = p_Business;
     this.Activitie        = p_Activitie;
     this.AParentForm      = p_AParentForm;
     m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie);
     m_Methods_Quantity    = new _Methods_Quantity(this.Activitie);
     m_Methods_YTLBSummary = new _Methods_YTLBSummary(this.Activitie);
     InitializeComponent();
 }
Beispiel #6
0
 /// <summary>
 /// 加载事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BatchSetForm_Load(object sender, EventArgs e)
 {
     m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie);
     m_Methods_YTLBSummary = new _Methods_YTLBSummary(this.Activitie);
     //this.radioGroupSZYTLB.SelectedIndex = -1;
 }
Beispiel #7
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            DataRowView info0 = this.textEdit1.Tag as DataRowView;

            if (info0 == null)
            {
                return;
            }
            _Entity_SubInfo info = new _Entity_SubInfo();

            _ObjectSource.GetObject(info, info0.Row);
            _Mothods_MFixed fix   = new _Mothods_MFixed(this.CurrentBusiness, this.Activitie, info);
            _Entity_SubInfo sinfo = new _Entity_SubInfo();
            //_FixedListInfo info1 = null;
            _Methods_Subheadings subfix = new _Methods_Subheadings(this.CurrentBusiness, this.Activitie, null);

            if (info != null)
            {
                using (var calculator = new Calculator(CurrentBusiness, Activitie))
                {
                    foreach (DataRowView item in this.bindingSource1)
                    {
                        _ObjectSource.GetObject(sinfo, item.Row);
                        // subfix.Current = sinfo;
                        // subfix.Begin();
                        var entity = fix.Create(-1, sinfo);
                        entity.BEIZHU = sinfo.BEIZHU;

                        DataRow[] rows1 = this.Activitie.StructSource.ModelQuantity.Select(string.Format("ZMID={0} and SSLB={1}", sinfo.ID, sinfo.SSLB));
                        for (int i = 0; i < rows1.Length; i++)
                        {
                            rows1[i].Delete();
                        }

                        DataRow[] rows = this.Activitie.StructSource.ModelQuantity.Select(string.Format("ZMID={0} and SSLB={1}", item["ID"], item["SSLB"]));
                        for (int i = 0; i < rows.Length; i++)
                        {
                            rows[i]["QDID"] = sinfo.PID;
                            rows[i]["ZMID"] = sinfo.ID;
                            rows[i]["SSLB"] = sinfo.SSLB;
                        }

                        //item["SC"] = false;
                        DataRow r = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(item["ID"].ToString());
                        if (r != null)
                        {
                            _Entity_SubInfo sinfo1 = new _Entity_SubInfo();
                            _ObjectSource.GetObject(sinfo1, r);
                            subfix.Current = sinfo1;
                            subfix.Begin(null);
                            calculator.Entities.Add(sinfo1);
                            calculator.CalculateFinish += new EventHandler(delegate(object o, EventArgs handler)
                            {
                                r["SC"] = false;
                            });
                        }
                    }

                    calculator.Entities.Add(info);
                }

                this.Close();
            }
        }
Beispiel #8
0
        /// <summary>
        /// 第一个石灰转换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit1_Click(object sender, EventArgs e)
        {
            if (radioGroup1.SelectedIndex == 1)
            {
                ArrayList m_ArrayList = this.GetAllSub(string.Format("ZCLB='W' AND YSBH IN({0})", _Constant.石灰转换定额范围));
                DataRow   new_info    = GetSSH();
                foreach (DataRow item in m_ArrayList)
                {
                    decimal yxhl  = 0m;
                    decimal xhl   = 0m;
                    DataRow sshkg = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W'AND YSBH='10900'", item["SSLB"], item["ID"])).FirstOrDefault();
                    DataRow ssht  = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W'AND YSBH='10901'", item["SSLB"], item["ID"])).FirstOrDefault();
                    if (sshkg != null)
                    {
                        yxhl += _ConvertUnit.Convert(sshkg["DW"].ToString(), "千克") * ToolKit.ParseDecimal(sshkg["XHL"]);
                        xhl  += _ConvertUnit.Convert(sshkg["DW"].ToString(), "千克") * ToolKit.ParseDecimal(sshkg["XHL"]) * 1.3m;
                        sshkg.Delete();
                    }
                    if (ssht != null)
                    {
                        yxhl += _ConvertUnit.Convert(ssht["DW"].ToString(), "千克") * ToolKit.ParseDecimal(ssht["XHL"]);
                        xhl  += _ConvertUnit.Convert(ssht["DW"].ToString(), "千克") * ToolKit.ParseDecimal(ssht["XHL"]) * 1.3m;
                        ssht.Delete();
                    }

                    new_info["YSXHL"] = xhl;
                    new_info["XHL"]   = xhl;
                    new_info["CTIME"] = DateTime.Now;
                    new_info["SSLB"]  = item["SSLB"];
                    new_info["EnID"]  = item["EnID"];
                    new_info["UnID"]  = item["UnID"];
                    new_info["ZMID"]  = item["ID"];
                    new_info["QDID"]  = item["PID"];
                    new_info["PID"]   = DBNull.Value;
                    this.Activitie.StructSource.ModelQuantity.Add(new_info);

                    DataRow rg = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB='{0}' AND ZMID={1} AND LB='{2}'", item["SSLB"], item["ID"], "人工"), "YSBH").FirstOrDefault();
                    if (rg != null)
                    {
                        rg["XHL"] = ToolKit.ParseDecimal(rg["XHL"]) - (yxhl * 0.001m) * 0.478m;
                    }
                    DataRow sui = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB='{0}' AND ZMID={1} AND YSBH='{2}'", item["SSLB"], item["ID"], "11610"), "YSBH").FirstOrDefault();
                    if (sui != null)
                    {
                        sui["XHL"] = ToolKit.ParseDecimal(sui["XHL"]) - (yxhl * 0.001m) * 0.043m;
                    }
                    _Entity_SubInfo m_Entity_SubInfo = new _Entity_SubInfo();
                    _ObjectSource.GetObject(m_Entity_SubInfo, item);
                    _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(this.CurrentBusiness, this.Activitie, m_Entity_SubInfo);
                    m_Methods_Subheadings.Begin(null);
                }
                MsgBox.Alert("【" + m_ArrayList.Count + "】条子目 生石灰-转换-熟石灰");
            }
            else
            {
                int       m_index     = 0;
                ArrayList m_ArrayList = this.GetAllSub("ZCLB='W' AND YSBH='10905'");
                foreach (DataRow item in m_ArrayList)
                {
                    _Entity_SubInfo m_QD_Entity_SubInfo = null;
                    _Entity_SubInfo m_Entity_SubInfo    = new _Entity_SubInfo();
                    _ObjectSource.GetObject(m_Entity_SubInfo, item);
                    if (m_Entity_SubInfo.SSLB == 0)
                    {
                        m_QD_Entity_SubInfo = new _Entity_SubInfo();
                        DataRow dr_qd = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(m_Entity_SubInfo.PID.ToString());
                        if (dr_qd != null)
                        {
                            _ObjectSource.GetObject(m_QD_Entity_SubInfo, dr_qd);
                            _Methods_Fixed  m_Methods_Fixed  = new _Methods_Fixed(this.CurrentBusiness, this.Activitie, m_QD_Entity_SubInfo);
                            _Entity_SubInfo f_Entity_SubInfo = GetZMByID(m_Entity_SubInfo.OLDXMBM);
                            if (f_Entity_SubInfo != null)
                            {
                                item.Delete();
                                f_Entity_SubInfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("GCSZ", ++m_index, m_Methods_Fixed.Current.OLDXMBM);
                                m_Methods_Fixed.Create(m_Entity_SubInfo.Sort - 1, f_Entity_SubInfo);
                            }
                        }
                    }
                    else
                    {
                        m_QD_Entity_SubInfo = new _Entity_SubInfo();
                        DataRow dr_qd = this.Activitie.StructSource.ModelMeasures.GetRowByOther(m_Entity_SubInfo.PID.ToString());
                        if (dr_qd != null)
                        {
                            _ObjectSource.GetObject(m_QD_Entity_SubInfo, dr_qd);
                            _Mothods_MFixed m_Mothods_MFixed = new _Mothods_MFixed(this.CurrentBusiness, this.Activitie, m_QD_Entity_SubInfo);
                            _Entity_SubInfo c_Entity_SubInfo = GetZMByID(m_Entity_SubInfo.OLDXMBM);
                            if (c_Entity_SubInfo != null)
                            {
                                item.Delete();
                                c_Entity_SubInfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("GCSZ", ++m_index, m_Mothods_MFixed.Current.OLDXMBM);
                                m_Mothods_MFixed.Create(m_Entity_SubInfo.Sort - 1, c_Entity_SubInfo);
                            }
                        }
                    }
                }
                MsgBox.Alert("【" + m_ArrayList.Count + "】条子目 熟石灰-转换-生石灰");
            }
        }
Beispiel #9
0
        /// <summary>
        /// 第二个砂浆转换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit2_Click(object sender, EventArgs e)
        {
            APP.UserPriceLibrary.AllQuantityUnit = this.Activitie.StructSource.ModelQuantity;
            APP.UserPriceLibrary.UnName          = this.Activitie.Name;
            APP.UserPriceLibrary.Range           = 1;
            if (this.radioGroup2.SelectedIndex == 1)
            {
                ArrayList m_ArrayList = this.GetAllSub("ZCLB='W' AND YSBH='J06016' AND XHL <> 0");
                int       count       = m_ArrayList.Count;
                //抹灰工程
                foreach (DataRow item in m_ArrayList)
                {
                    DataRow[] mh = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND YSBH IN({2})", item["SSLB"], item["ID"], _Constant.抹灰工程定额范围));
                    if (mh.Length > 0)
                    {
                        DataRow rg    = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND LB='人工'", item["SSLB"], item["ID"]), "YSBH").FirstOrDefault();
                        DataRow jx    = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND BH='J06016'", item["SSLB"], item["ID"]), "YSBH").FirstOrDefault();
                        decimal rgxhl = 0m;
                        foreach (DataRow dr in mh)
                        {
                            if (!dr["MC"].ToString().Contains("(预拌砂浆)"))
                            {
                                dr.BeginEdit();
                                dr["MC"] = dr["MC"].ToString() + "(预拌砂浆)";
                                APP.UserPriceLibrary.Update("MC", dr["MC", DataRowVersion.Current], dr);
                                dr.EndEdit();
                            }
                        }
                        //修改消耗量
                        foreach (DataRow mhs in mh)
                        {
                            rgxhl += ToolKit.ParseDecimal(mhs["XHL"]) * 1.1m * _ConvertUnit.Convert(mhs["DW"].ToString(), "立方米");
                        }
                        if (rg != null)
                        {
                            rg["XHL"] = ToolKit.ParseDecimal(rg["XHL"]) - rgxhl;
                        }
                        if (jx != null)
                        {
                            jx["XHL"] = 0m;
                        }
                    }

                    //砌筑工程
                    DataRow[] qz = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND YSBH IN ({2}) ", item["SSLB"], item["ID"], _Constant.筑工程定额范围));
                    if (qz.Count() > 0)
                    {
                        DataRow rg    = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND LB='人工'", item["SSLB"], item["ID"]), "YSBH").FirstOrDefault();
                        DataRow jx    = this.Activitie.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND ZCLB='W' AND BH='J06016'", item["SSLB"], item["ID"]), "YSBH").FirstOrDefault();
                        decimal rgxhl = 0m;
                        //修改名称
                        DataRow dr = qz.FirstOrDefault();
                        if (dr != null)
                        {
                            if (!dr["MC"].ToString().Contains("(预拌砂浆)"))
                            {
                                dr.BeginEdit();
                                dr["MC"] = dr["MC"].ToString() + "(预拌砂浆)";
                                APP.UserPriceLibrary.Update("MC", dr["MC", DataRowVersion.Current], dr);
                                dr.EndEdit();
                            }
                        }
                        foreach (DataRow qzs in qz)
                        {
                            rgxhl += ToolKit.ParseDecimal(qzs["XHL"]) * 0.69m * _ConvertUnit.Convert(qzs["DW"].ToString(), "立方米");
                        }
                        if (rg != null)
                        {
                            rg["XHL"] = ToolKit.ParseDecimal(rg["XHL"]) - rgxhl;
                        }
                        if (jx != null)
                        {
                            jx["XHL"] = 0m;
                        }
                    }
                    string m_NewSubheadings = item["EnID"] + "," + item["UnID"] + "," + item["SSLB"] + "," + item["ID"] + "|";
                    if (!APP.UserPriceLibrary.SubheadingsInfo.Contains(m_NewSubheadings))
                    {
                        APP.UserPriceLibrary.SubheadingsInfo += m_NewSubheadings;
                    }
                }
                _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie);
                m_Methods_Subheadings.BatchCalculate();
                MsgBox.Alert("【" + count + "】条子目 现场制拌砂浆-转换-预拌砂浆");
            }
            else
            {
                int       m_index     = 0;
                ArrayList m_ArrayList = this.GetAllSub("ZCLB='W' AND YSBH='J06016' AND XHL=0");
                foreach (DataRow item in m_ArrayList)
                {
                    _Entity_SubInfo m_QD_Entity_SubInfo = null;
                    _Entity_SubInfo m_Entity_SubInfo    = new _Entity_SubInfo();
                    _ObjectSource.GetObject(m_Entity_SubInfo, item);
                    if (m_Entity_SubInfo.SSLB == 0)
                    {
                        m_QD_Entity_SubInfo = new _Entity_SubInfo();
                        DataRow dr_qd = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(m_Entity_SubInfo.PID.ToString());
                        if (dr_qd != null)
                        {
                            _ObjectSource.GetObject(m_QD_Entity_SubInfo, dr_qd);
                            _Methods_Fixed  m_Methods_Fixed  = new _Methods_Fixed(this.CurrentBusiness, this.Activitie, m_QD_Entity_SubInfo);
                            _Entity_SubInfo f_Entity_SubInfo = GetZMByID(m_Entity_SubInfo.OLDXMBM);
                            if (f_Entity_SubInfo != null)
                            {
                                item.Delete();
                                f_Entity_SubInfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("GCSZ", ++m_index, m_Methods_Fixed.Current.OLDXMBM);
                                m_Methods_Fixed.Create(m_Entity_SubInfo.Sort - 1, f_Entity_SubInfo);
                            }
                        }
                    }
                    else
                    {
                        m_QD_Entity_SubInfo = new _Entity_SubInfo();
                        DataRow dr_qd = this.Activitie.StructSource.ModelMeasures.GetRowByOther(m_Entity_SubInfo.PID.ToString());
                        if (dr_qd != null)
                        {
                            _ObjectSource.GetObject(m_QD_Entity_SubInfo, dr_qd);
                            _Mothods_MFixed m_Mothods_MFixed = new _Mothods_MFixed(this.CurrentBusiness, this.Activitie, m_QD_Entity_SubInfo);
                            _Entity_SubInfo c_Entity_SubInfo = GetZMByID(m_Entity_SubInfo.OLDXMBM);
                            if (c_Entity_SubInfo != null)
                            {
                                item.Delete();
                                c_Entity_SubInfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("GCSZ", ++m_index, m_Mothods_MFixed.Current.OLDXMBM);
                                m_Mothods_MFixed.Create(m_Entity_SubInfo.Sort - 1, c_Entity_SubInfo);
                            }
                        }
                    }
                }
                MsgBox.Alert("【" + m_ArrayList.Count + "】条子目 预拌砂浆-转换-现场制拌砂浆");
            }
        }