public int VerifyInDepot(int MainID, bool t, int TableTypeID)
        {
            Hownet.BLL.AmountInfo bllAI  = new AmountInfo();
            Hownet.BLL.Materiel   bllMat = new Materiel();

            Hownet.Model.ProductTaskMain   modPTM = GetModel(MainID);
            List <Hownet.Model.AmountInfo> liAI   = bllAI.DataTableToList(bllAI.GetList("(MainID=" + MainID + ") And (TableTypeID=" + TableTypeID + ")").Tables[0]);

            Hownet.BLL.Repertory   bllRe = new Repertory();
            Hownet.Model.Repertory modRe;
            Hownet.Model.Materiel  modMat = bllMat.GetModel(modPTM.MaterielID);
            int a = 0;

            if (liAI.Count > 0)
            {
                for (int i = 0; i < liAI.Count; i++)
                {
                    modRe              = new Model.Repertory();
                    modRe.Amount       = liAI[i].Amount;
                    modRe.BrandID      = modPTM.BrandID;
                    modRe.ColorID      = liAI[i].ColorID;
                    modRe.ColorOneID   = liAI[i].ColorOneID;
                    modRe.ColorTwoID   = liAI[i].ColorTwoID;
                    modRe.DepartmentID = modPTM.DeparmentID;
                    modRe.MaterielID   = modPTM.MaterielID;
                    modRe.MeasureID    = modMat.MeasureID;
                    modRe.MListID      = liAI[i].MListID;
                    modRe.SizeID       = liAI[i].SizeID;
                    bllRe.InOrOut(modRe, t);
                }
            }
            return(a);
        }
Example #2
0
        /// <summary>
        /// 将生产计划进行生产
        /// </summary>
        /// <param name="PlanID">计划单ID</param>
        /// <param name="TaskID">生产单ID</param>
        /// <param name="PlanTypeID">计划单类型</param>
        /// <param name="TaskTypeID">生产单类型</param>
        /// <param name="t">真为生产,假为取消生产单</param>
        public void UpPlanAmount(int PlanID, int TaskID, int PlanTypeID, int TaskTypeID, bool t)
        {
            Hownet.BLL.AmountInfo          bllAI = new AmountInfo();
            List <Hownet.Model.AmountInfo> liPP  = bllAI.DataTableToList(bllAI.GetList("(MainID=" + PlanID + ") And (TableTypeID=" + PlanTypeID + ")").Tables[0]);

            if (liPP.Count > 0)
            {
                List <Hownet.Model.AmountInfo> liTask = bllAI.DataTableToList(bllAI.GetList("(MainID=" + TaskID + ") And (TableTypeID=" + TaskTypeID + ")").Tables[0]);
                if (liTask.Count > 0)
                {
                    for (int i = 0; i < liPP.Count; i++)
                    {
                        for (int j = 0; j < liTask.Count; j++)
                        {
                            if (liPP[i].MListID == liTask[j].MListID)
                            {
                                if (t)
                                {
                                    liPP[i].NotAmount -= liTask[j].Amount;
                                }
                                else
                                {
                                    liPP[i].NotAmount += liTask[j].Amount;
                                }
                                bllAI.Update(liPP[i]);
                                break;
                            }
                        }
                    }
                }
            }
            Hownet.Model.ProductionPlan modPP = GetModel(PlanID);
            if (modPP.IsVerify < 4)
            {
                modPP.IsVerify = 4;
                Update(modPP);
            }
        }