Esempio n. 1
0
        /// <summary>
        /// 求和(12个月数据累加)
        /// </summary>
        /// <param name="detail"></param>
        /// <returns></returns>
        private decimal getSumAllCost(string id)
        {
            decimal sum = 0;

            HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail detail = new HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail();
            var field = base.XMFinancialFieldService.GetXMFinancialFieldById(int.Parse(id));

            if (field != null)
            {
                detail = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), DepartmentID, int.Parse(ddlYear.SelectedValue));
                if (detail != null)
                {
                    sum = detail.OneMonthCost.Value + detail.TwoMonthCost.Value + detail.ThreeMonthCost.Value + detail.FourMonthCost.Value + detail.FiveMonthCost.Value + detail.SixMonthCost.Value + detail.SevenMonthCost.Value + detail.EightMonthCost.Value + detail.NineMonthCost.Value + detail.TenMonthCost.Value + detail.ElevenMonthCost.Value + detail.TwelMonthCost.Value;
                }
            }
            if (field != null && (this.DepartmentID == 297 || this.DepartmentID == 63) && field.FieldName.Contains("营业业绩额"))
            {
                if (detail != null)
                {
                    YYYJCost = detail.OneMonthCost.Value + detail.TwoMonthCost.Value + detail.ThreeMonthCost.Value + detail.FourMonthCost.Value + detail.FiveMonthCost.Value + detail.SixMonthCost.Value + detail.SevenMonthCost.Value + detail.EightMonthCost.Value + detail.NineMonthCost.Value + detail.TenMonthCost.Value + detail.ElevenMonthCost.Value + detail.TwelMonthCost.Value;
                }
            }
            else if (this.DepartmentID == 507 && field.Id == 70)
            {
                if (detail != null)
                {
                    YYYJCost = detail.OneMonthCost.Value + detail.TwoMonthCost.Value + detail.ThreeMonthCost.Value + detail.FourMonthCost.Value + detail.FiveMonthCost.Value + detail.SixMonthCost.Value + detail.SevenMonthCost.Value + detail.EightMonthCost.Value + detail.NineMonthCost.Value + detail.TenMonthCost.Value + detail.ElevenMonthCost.Value + detail.TwelMonthCost.Value;
                }
            }
            return(sum);
        }
Esempio n. 2
0
        /// <summary>
        /// Update into XMOtherCostDetail
        /// </summary>
        /// <param name="xmothercostdetail">XMOtherCostDetail</param>
        public void UpdateXMOtherCostDetail(XMOtherCostDetail xmothercostdetail)
        {
            if (xmothercostdetail == null)
            {
                return;
            }

            if (this._context.IsAttached(xmothercostdetail))
            {
                this._context.XMOtherCostDetails.Attach(xmothercostdetail);
            }

            this._context.SaveChanges();
        }
Esempio n. 3
0
        /// <summary>
        /// Insert into XMOtherCostDetail
        /// </summary>
        /// <param name="xmothercostdetail">XMOtherCostDetail</param>
        public void InsertXMOtherCostDetail(XMOtherCostDetail xmothercostdetail)
        {
            if (xmothercostdetail == null)
            {
                return;
            }

            if (!this._context.IsAttached(xmothercostdetail))
            {
                this._context.XMOtherCostDetails.AddObject(xmothercostdetail);
            }

            this._context.SaveChanges();
        }
Esempio n. 4
0
        private void InitData()
        {
            //更具项目ID 查询字段是否设置
            var xmOtherInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(DepartmentID);

            if (xmOtherInclude == null)
            {
                base.ShowMessage("请先设置预算字段!");
                return;
            }
            else
            {
                //判断当前年份数据是否存在(如不存在自动添加)
                if (xmOtherInclude != null && !string.IsNullOrEmpty(xmOtherInclude.Fields))
                {
                    foreach (string id in xmOtherInclude.Fields.Split(','))
                    {
                        HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail cost = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), DepartmentID, int.Parse(ddlYear.SelectedValue));
                        if (cost == null)
                        {
                            //自动插入想关数据
                            HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail Info = new HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail();
                            Info.DepartmentID     = DepartmentID;
                            Info.FinancialFieldID = int.Parse(id);
                            Info.Year             = Convert.ToInt16(ddlYear.SelectedValue);
                            Info.OneMonthCost     = 0;
                            Info.TwoMonthCost     = 0;
                            Info.ThreeMonthCost   = 0;
                            Info.FourMonthCost    = 0;
                            Info.FiveMonthCost    = 0;
                            Info.SixMonthCost     = 0;
                            Info.SevenMonthCost   = 0;
                            Info.EightMonthCost   = 0;
                            Info.NineMonthCost    = 0;
                            Info.TenMonthCost     = 0;
                            Info.ElevenMonthCost  = 0;
                            Info.TwelMonthCost    = 0;
                            Info.IsEnable         = false;
                            Info.IsAudit          = false;
                            Info.CreateDate       = DateTime.Now;
                            Info.CreateID         = HozestERPContext.Current.User.CustomerID;
                            Info.UpdateDate       = DateTime.Now;
                            Info.UpdateID         = HozestERPContext.Current.User.CustomerID;
                            base.XMOtherCostDetailService.InsertXMOtherCostDetail(Info);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// 判断当年数据是否已经审核
        /// </summary>
        /// <returns></returns>
        private bool checkIsAudit()
        {
            bool isAudit = false;

            if (this.ProjectId != 0)     //如果是项目
            {
                string year = DateTime.Now.Year.ToString();
                //获取项目所属字段集合
                var xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(ProjectId);
                if (xmNickInclude != null && !string.IsNullOrEmpty(xmNickInclude.Fields))
                {
                    //拆分字段
                    foreach (string id in xmNickInclude.Fields.Split(','))
                    {
                        //根据字段ID,年份,项目ID 查询相关记录
                        HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail cost = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(id), ProjectId, int.Parse(year));
                        if (cost != null && cost.IsAudit != null)
                        {
                            isAudit = cost.IsAudit.Value;
                        }
                    }
                }
            }

            if (this.DepartmentId != 0)    //如果是部门
            {
                string year           = DateTime.Now.Year.ToString();
                var    xmOtherInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(this.DepartmentId);
                if (xmOtherInclude != null && !string.IsNullOrEmpty(xmOtherInclude.Fields))
                {
                    //拆分字段
                    foreach (string id in xmOtherInclude.Fields.Split(','))
                    {
                        HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail cost = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), DepartmentId, int.Parse(year));
                        if (cost != null && cost.IsAudit != null)
                        {
                            isAudit = cost.IsAudit.Value;
                        }
                    }
                }
            }

            return(isAudit);
        }
Esempio n. 6
0
        private bool getIsAuditByDepartmentID()
        {
            bool   isAudit       = false;
            string year          = ddlYear.SelectedValue;
            var    xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(DepartmentID);

            if (xmNickInclude != null && !string.IsNullOrEmpty(xmNickInclude.Fields))
            {
                foreach (string id in xmNickInclude.Fields.Split(','))
                {
                    HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail cost = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), DepartmentID, int.Parse(year));
                    if (cost != null && cost.IsAudit != null)
                    {
                        isAudit = cost.IsAudit.Value;
                    }
                }
            }
            return(isAudit);
        }
Esempio n. 7
0
        /// <summary>
        /// 反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnIsAuditFalse_Click(object sender, EventArgs e)
        {
            string year          = ddlYear.SelectedValue;
            var    xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(DepartmentID);

            if (xmNickInclude != null && !string.IsNullOrEmpty(xmNickInclude.Fields))
            {
                foreach (string id in xmNickInclude.Fields.Split(','))
                {
                    HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail cost = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), DepartmentID, int.Parse(year));
                    if (cost != null)
                    {
                        cost.IsAudit    = false;
                        cost.UpdateID   = HozestERPContext.Current.User.SCustomerInfo.CustomerID;
                        cost.UpdateDate = DateTime.Now;
                        base.XMOtherCostDetailService.UpdateXMOtherCostDetail(cost);
                    }
                }
                BindGrid();
                base.ShowMessage("操作成功!");
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="ID"></param>
        private void autoSaveData(string ids, int projectID, int departmentID, int nickID)
        {
            //插入项目数据
            if (!string.IsNullOrEmpty(ids) && projectID != 0)
            {
                foreach (string id in ids.Split(','))
                {
                    HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail cost = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(id), projectID, DateTime.Now.Year);
                    if (cost == null)
                    {
                        //自动插入想关数据
                        HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail Info = new HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail();
                        Info.ProjectId        = projectID;
                        Info.FinancialFieldID = int.Parse(id);
                        Info.Year             = DateTime.Now.Year;
                        Info.OneMonthCost     = 0;
                        Info.TwoMonthCost     = 0;
                        Info.ThreeMonthCost   = 0;
                        Info.FourMonthCost    = 0;
                        Info.FiveMonthCost    = 0;
                        Info.SixMonthCost     = 0;
                        Info.SevenMonthCost   = 0;
                        Info.EightMonthCost   = 0;
                        Info.NineMonthCost    = 0;
                        Info.TenMonthCost     = 0;
                        Info.ElevenMonthCost  = 0;
                        Info.TwelMonthCost    = 0;
                        Info.IsEnable         = false;
                        Info.IsAudit          = false;
                        Info.CreateDate       = DateTime.Now;
                        Info.CreateID         = HozestERPContext.Current.User.CustomerID;
                        Info.UpdateDate       = DateTime.Now;
                        Info.UpdateID         = HozestERPContext.Current.User.CustomerID;
                        base.XMProjectCostDetailService.InsertXMProjectCostDetail(Info);
                    }
                }
            }

            if (!string.IsNullOrEmpty(ids) && departmentID != 0)
            {
                foreach (string id in ids.Split(','))
                {
                    HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail othercost = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(id), departmentID, DateTime.Now.Year);
                    if (othercost == null)
                    {
                        //自动插入相关数据
                        HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail Info = new HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail();
                        Info.DepartmentID     = departmentID;
                        Info.FinancialFieldID = int.Parse(id);
                        Info.Year             = DateTime.Now.Year;
                        Info.OneMonthCost     = 0;
                        Info.TwoMonthCost     = 0;
                        Info.ThreeMonthCost   = 0;
                        Info.FourMonthCost    = 0;
                        Info.FiveMonthCost    = 0;
                        Info.SixMonthCost     = 0;
                        Info.SevenMonthCost   = 0;
                        Info.EightMonthCost   = 0;
                        Info.NineMonthCost    = 0;
                        Info.TenMonthCost     = 0;
                        Info.ElevenMonthCost  = 0;
                        Info.TwelMonthCost    = 0;
                        Info.IsEnable         = false;
                        Info.IsAudit          = false;
                        Info.CreateDate       = DateTime.Now;
                        Info.CreateID         = HozestERPContext.Current.User.CustomerID;
                        Info.UpdateDate       = DateTime.Now;
                        Info.UpdateID         = HozestERPContext.Current.User.CustomerID;
                        base.XMOtherCostDetailService.InsertXMOtherCostDetail(Info);
                    }
                }
            }

            if (!string.IsNullOrEmpty(ids) && nickID != 0)
            {
                foreach (string id in ids.Split(','))
                {
                    HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail cost = base.XMProjectCostDetailService.GetXMProjectCostDataByNick(int.Parse(id), nickID, DateTime.Now.Year);
                    if (cost == null)
                    {
                        //自动插入想关数据
                        HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail Info = new HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail();
                        Info.NickId           = nickID;
                        Info.FinancialFieldID = int.Parse(id);
                        Info.Year             = DateTime.Now.Year;
                        Info.OneMonthCost     = 0;
                        Info.TwoMonthCost     = 0;
                        Info.ThreeMonthCost   = 0;
                        Info.FourMonthCost    = 0;
                        Info.FiveMonthCost    = 0;
                        Info.SixMonthCost     = 0;
                        Info.SevenMonthCost   = 0;
                        Info.EightMonthCost   = 0;
                        Info.NineMonthCost    = 0;
                        Info.TenMonthCost     = 0;
                        Info.ElevenMonthCost  = 0;
                        Info.TwelMonthCost    = 0;
                        Info.IsEnable         = false;
                        Info.IsAudit          = false;
                        Info.CreateDate       = DateTime.Now;
                        Info.CreateID         = HozestERPContext.Current.User.CustomerID;
                        Info.UpdateDate       = DateTime.Now;
                        Info.UpdateID         = HozestERPContext.Current.User.CustomerID;
                        base.XMProjectCostDetailService.InsertXMProjectCostDetail(Info);
                    }
                }
            }
        }
Esempio n. 9
0
        private void GetFieldCostList()
        {
            StringBuilder str = new StringBuilder();

            if (this.ProjectID != 0 || this.NickID != 0)                       //如果是项目
            {
                string includefields = "";
                //获取项目所属字段集合字符串
                XMIncludeFields xmNickInclude = null;
                if (this.ProjectID != 0)
                {
                    xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(this.ProjectID);
                }
                if (this.NickID != 0)
                {
                    xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByNickID(this.NickID);
                }
                //var xmNickInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(this.ProjectID);
                if (xmNickInclude != null && !string.IsNullOrEmpty(xmNickInclude.Fields))
                {
                    includefields = xmNickInclude.Fields;
                }

                string[] parm = includefields.Split(',');
                string   pID  = "";           //父节点ID
                string   cID  = "";           //子节点ID
                if (parm != null && parm.Count() > 0)
                {
                    foreach (string id in parm)
                    {
                        var f = base.XMFinancialFieldService.GetXMFinancialFieldById(int.Parse(id));
                        if (f != null)
                        {
                            if (f.ParentID == 0)
                            {
                                pID += f.Id + ",";
                            }
                            else
                            {
                                cID += f.Id + ",";
                            }
                        }
                    }
                }

                if (pID != "" && pID.Length > 0)
                {
                    pID = pID.Substring(0, pID.Length - 1);
                }
                if (cID != "" && cID.Length > 0)
                {
                    cID = cID.Substring(0, cID.Length - 1);
                }
                string[] p = pID.Split(',');
                string[] c = cID.Split(',');
                str.Append("<table  border='1'  rules='all' width='480px'  id='tb1'>");
                str.Append("<tr  align='center' style='height:5px;height:5px;'>");

                if (p != null && p.Length > 0)
                {
                    for (int j = 0; j < p.Count(); j++)
                    {
                        decimal cost = 0;               //字段数值
                        HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail field = null;
                        if (this.ProjectID != 0)
                        {
                            field = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(p[j]), this.ProjectID, Year);
                        }
                        if (this.NickID != 0)
                        {
                            field = base.XMProjectCostDetailService.GetXMProjectCostDataByNick(int.Parse(p[j]), this.NickID, Year);
                        }
                        //HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail field = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(p[j]), this.ProjectID, Year);
                        //添加父节点
                        str.Append("<td style='width:40%;font-size:18px;text-align:left;'>" + field.FieldName + "</td>");
                        //遍历所有月份获取相应月份的数值
                        switch (Month)
                        {
                        case 1:
                            cost = field.OneMonthCost.Value;
                            break;

                        case 2:
                            cost = field.TwoMonthCost.Value;
                            break;

                        case 3:
                            cost = field.ThreeMonthCost.Value;
                            break;

                        case 4:
                            cost = field.FourMonthCost.Value;
                            break;

                        case 5:
                            cost = field.FiveMonthCost.Value;
                            break;

                        case 6:
                            cost = field.SixMonthCost.Value;
                            break;

                        case 7:
                            cost = field.SevenMonthCost.Value;
                            break;

                        case 8:
                            cost = field.EightMonthCost.Value;
                            break;

                        case 9:
                            cost = field.NineMonthCost.Value;
                            break;

                        case 10:
                            cost = field.TenMonthCost.Value;
                            break;

                        case 11:
                            cost = field.ElevenMonthCost.Value;
                            break;

                        case 12:
                            cost = field.TwelMonthCost.Value;
                            break;
                        }
                        bool isexsit = false;
                        if (this.ProjectID != 0)
                        {
                            isexsit = ishaveChildField(field.FinancialFieldID.ToString(), ProjectID, 0, 0);
                        }
                        if (this.NickID != 0)
                        {
                            isexsit = ishaveChildField(field.FinancialFieldID.ToString(), 0, 0, this.NickID);
                        }
                        //bool isexsit = ishaveChildField(field.FinancialFieldID.ToString(), ProjectID, 0,0);
                        bool isAuto = isAutoCalCulateField(field.FinancialFieldID.ToString());
                        if (isexsit || isAuto)
                        {
                            str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + field.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" disabled=\"disabled\" name=\"dd\" id='txtCost_" + field.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + field.FieldName + "'/></td></tr>");
                        }
                        else
                        {
                            str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + field.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" name=\"dd\" id='txtCost_" + field.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + field.FieldName + "'/></td></tr>");
                        }
                        if (HasChild(p[j]))
                        {
                            string newStr = childFieldIDs(p[j]);
                            foreach (string childID in c)
                            {
                                foreach (string str1 in newStr.Split(','))
                                {
                                    if (childID == str1)               //存在该子节点
                                    {
                                        HozestERP.BusinessLogic.ManageBusiness.XMProjectCostDetail f = null;
                                        if (this.ProjectID != 0)
                                        {
                                            f = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(childID), this.ProjectID, Year);
                                        }
                                        if (this.NickID != 0)
                                        {
                                            f = base.XMProjectCostDetailService.GetXMProjectCostDataByNick(int.Parse(childID), this.NickID, Year);
                                        }
                                        //var f = base.XMProjectCostDetailService.GetXMProjectCostDataByParm(int.Parse(childID), this.ProjectID, Year);
                                        switch (Month)
                                        {
                                        case 1:
                                            cost = f.OneMonthCost.Value;
                                            break;

                                        case 2:
                                            cost = f.TwoMonthCost.Value;
                                            break;

                                        case 3:
                                            cost = f.ThreeMonthCost.Value;
                                            break;

                                        case 4:
                                            cost = f.FourMonthCost.Value;
                                            break;

                                        case 5:
                                            cost = f.FiveMonthCost.Value;
                                            break;

                                        case 6:
                                            cost = f.SixMonthCost.Value;
                                            break;

                                        case 7:
                                            cost = f.SevenMonthCost.Value;
                                            break;

                                        case 8:
                                            cost = f.EightMonthCost.Value;
                                            break;

                                        case 9:
                                            cost = f.NineMonthCost.Value;
                                            break;

                                        case 10:
                                            cost = f.TenMonthCost.Value;
                                            break;

                                        case 11:
                                            cost = f.ElevenMonthCost.Value;
                                            break;

                                        case 12:
                                            cost = f.TwelMonthCost.Value;
                                            break;
                                        }
                                        str.Append("<tr align='center' style='height:5px;height:5px;'>");
                                        str.Append("<td style='width:40%;font-size:18px;text-align:right;font-size:13px;'>" + f.FieldName + "</td>");
                                        str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + f.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" name=\"dd\" id='txtCost_" + f.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + f.FieldName + "'/></td>");
                                        str.Append("</tr>");
                                    }
                                }
                            }
                        }
                    }
                    str.Append("</table>");
                    TableStr = str.ToString();
                }
            }
            else if (this.DepartmentID != 0)
            {
                string includefields = "";
                //获取项目所属字段集合字符串
                var xmOtherInclude = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(this.DepartmentID);
                if (xmOtherInclude != null && !string.IsNullOrEmpty(xmOtherInclude.Fields))
                {
                    includefields = xmOtherInclude.Fields;
                }

                string[] parm = includefields.Split(',');
                string   pID  = "";           //父节点ID
                string   cID  = "";           //子节点ID
                if (parm != null && parm.Count() > 0)
                {
                    foreach (string id in parm)
                    {
                        var f = base.XMFinancialFieldService.GetXMFinancialFieldById(int.Parse(id));
                        if (f != null)
                        {
                            if (f.ParentID == 0)
                            {
                                pID += f.Id + ",";
                            }
                            else
                            {
                                cID += f.Id + ",";
                            }
                        }
                    }
                }

                if (pID != "" && pID.Length > 0)
                {
                    pID = pID.Substring(0, pID.Length - 1);
                }
                if (cID != "" && cID.Length > 0)
                {
                    cID = cID.Substring(0, cID.Length - 1);
                }
                string[] p = pID.Split(',');
                string[] c = cID.Split(',');
                str.Append("<table  border='1'  rules='all' width='480px'  id='tb1'>");
                str.Append("<tr  align='center' style='background-color:" + "" + ";height:5px;height:5px;' oldcolor='" + "" + "'>");

                if (p != null && p.Length > 0)
                {
                    for (int j = 0; j < p.Count(); j++)
                    {
                        decimal cost = 0;               //字段数值
                        HozestERP.BusinessLogic.ManageBusiness.XMOtherCostDetail otherField = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(p[j]), this.DepartmentID, Year);
                        //添加父节点
                        str.Append("<td style='width:40%;font-size:18px;text-align:left;background-color:EAEAEA'>" + otherField.FieldName + "</td>");
                        //遍历所有月份获取相应月份的数值
                        switch (Month)
                        {
                        case 1:
                            cost = otherField.OneMonthCost.Value;
                            break;

                        case 2:
                            cost = otherField.TwoMonthCost.Value;
                            break;

                        case 3:
                            cost = otherField.ThreeMonthCost.Value;
                            break;

                        case 4:
                            cost = otherField.FourMonthCost.Value;
                            break;

                        case 5:
                            cost = otherField.FiveMonthCost.Value;
                            break;

                        case 6:
                            cost = otherField.SixMonthCost.Value;
                            break;

                        case 7:
                            cost = otherField.SevenMonthCost.Value;
                            break;

                        case 8:
                            cost = otherField.EightMonthCost.Value;
                            break;

                        case 9:
                            cost = otherField.NineMonthCost.Value;
                            break;

                        case 10:
                            cost = otherField.TenMonthCost.Value;
                            break;

                        case 11:
                            cost = otherField.ElevenMonthCost.Value;
                            break;

                        case 12:
                            cost = otherField.TwelMonthCost.Value;
                            break;
                        }
                        // 有子节点的不能编辑 和 (毛利,增值税,营业税附加,税前利润,所得税,直接净利润 字段无法输入,进行自动计算)
                        bool isexsit = ishaveChildField(otherField.FinancialFieldID.ToString(), 0, DepartmentID, 0);
                        bool isAuto  = isAutoCalCulateField(otherField.FinancialFieldID.ToString());
                        if (isexsit || isAuto)
                        {
                            str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + otherField.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" disabled=\"disabled\" name=\"dd\" id='txtCost_" + otherField.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + otherField.FieldName + "'/></td></tr>");
                        }
                        else
                        {
                            str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + otherField.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" name=\"dd\" id='txtCost_" + otherField.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + otherField.FieldName + "'/></td></tr>");
                        }
                        if (HasChild(p[j]))
                        {
                            string newStr = childFieldIDs(p[j]);
                            foreach (string childID in c)
                            {
                                foreach (string str1 in newStr.Split(','))
                                {
                                    if (childID == str1)               //存在该子节点
                                    {
                                        var f = base.XMOtherCostDetailService.GetXMOtherCostDataByParm(int.Parse(childID), this.DepartmentID, Year);
                                        switch (Month)
                                        {
                                        case 1:
                                            cost = f.OneMonthCost.Value;
                                            break;

                                        case 2:
                                            cost = f.TwoMonthCost.Value;
                                            break;

                                        case 3:
                                            cost = f.ThreeMonthCost.Value;
                                            break;

                                        case 4:
                                            cost = f.FourMonthCost.Value;
                                            break;

                                        case 5:
                                            cost = f.FiveMonthCost.Value;
                                            break;

                                        case 6:
                                            cost = f.SixMonthCost.Value;
                                            break;

                                        case 7:
                                            cost = f.SevenMonthCost.Value;
                                            break;

                                        case 8:
                                            cost = f.EightMonthCost.Value;
                                            break;

                                        case 9:
                                            cost = f.NineMonthCost.Value;
                                            break;

                                        case 10:
                                            cost = f.TenMonthCost.Value;
                                            break;

                                        case 11:
                                            cost = f.ElevenMonthCost.Value;
                                            break;

                                        case 12:
                                            cost = f.TwelMonthCost.Value;
                                            break;
                                        }
                                        str.Append("<tr  align='center' style='background-color:" + "" + ";height:5px;height:5px;' oldcolor='" + "" + "'>");
                                        str.Append("<td style='width:40%;font-size:18px;text-align:right;font-size:13px;background-color:#FFFFFF'>" + f.FieldName + "</td>");
                                        str.Append("<td style='width:50%;text-align:right'> <input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + f.FinancialFieldID + "'/><input type=\"text\"  runat=\"server\" name=\"dd\" id='txtCost_" + f.FinancialFieldID + "'  value='" + cost + "'/><input type=\"hidden\" id=\"hiddID\" runat=\"server\"  value=' " + f.FieldName + "'/></td>");
                                        str.Append("</tr>");
                                    }
                                }
                            }
                            str.Append("</tr>");
                        }
                    }
                    str.Append("</table>");
                    TableStr = str.ToString();
                }
            }
        }