Exemplo n.º 1
0
        /// <summary>
        /// 根据计划信息自动生成施工进度
        /// </summary>
        /// <param name="ProjGuid"></param>
        /// <param name="ConstructYear"></param>
        /// <param name="ConstructMonth"></param>
        public static void CstrctScheduleByPlan(string ProjGuid, string ConstructYear, string ConstructMonth)
        {
            DataSet DataPlan     = IMCBaseInfo.GetCstrctPlanByProjGuid(ProjGuid);
            DataSet DataSchedule = IMCBaseInfo.GetCstrctScheduleByProjGuid(ProjGuid);

            if (DataPlan != null && DataPlan.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < DataPlan.Tables[0].Rows.Count; i++)
                {
                    string planguid = DataPlan.Tables[0].Rows[i]["Guid"].ToString();
                    if (planguid != "")
                    {
                        DataRow[] rows = DataSchedule.Tables[0].Select("ItemsPlanGuid='" + planguid + "' and ConstructMonth='" + ConstructMonth + "'");
                        if (rows.Length == 0)
                        {
                            IMCBaseInfo.CstrctScheduleByPlan(ProjGuid, planguid, ConstructYear, ConstructMonth);//planguid 概算明细主键
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据概算信息自动生成施工计划
        /// </summary>
        /// <param name="ProjGuid"></param>
        public static void CstrctPlanByEstimateDetail(string ProjGuid)
        {
            //DataSet DataEstimate = IMCBaseInfo.GetAllEstimateDetailByProjGuid(ProjGuid);
            DataTable EstimateDt = GetEstimateDetail(ProjGuid);
            DataSet   CstrctPlan = IMCBaseInfo.GetCstrctPlanByProjGuid(ProjGuid);

            if (EstimateDt != null && EstimateDt.Rows.Count > 0)
            {
                for (int i = 0; i < EstimateDt.Rows.Count; i++)
                {
                    DataRow   Row            = EstimateDt.Rows[i];
                    string    FundDetailGuid = Row["Guid"].ToString();            //概算明细主键
                    string    FundDetailName = Row["ProjOrCostName"].ToString();; //概算明细名称
                    DataRow[] row            = CstrctPlan.Tables[0].Select("FundDetailGuid='" + FundDetailGuid + "'");
                    if (row.Length == 0)
                    {
                        IMCBaseInfo.CstrctPlanByEstimateDetail(ProjGuid, FundDetailGuid, FundDetailName, Row["Code"].ToString(), Row["OrderNum"].ToString(), Row["Code"].ToString(), FundDetailName, FundDetailName);
                    }
                }
            }
        }