Exemplo n.º 1
0
 public FDIPostRawMaterialBatch GetFDIPostRawMaterialBatchById(string Id)
 {
     using (IFDIPostRawMaterialBatchBLL FDIPostRawMaterialBatchBLL = BLLContainer.Resolve <IFDIPostRawMaterialBatchBLL>())
     {
         FDIPostRawMaterialBatch model = FDIPostRawMaterialBatchBLL.GetFirstOrDefault(Id);
         return(model);
     }
 }
Exemplo n.º 2
0
 public bool AddFDIPostRawMaterialBatch(FDIPostRawMaterialBatch mFDIPostRawMaterialBatch)
 {
     if (mFDIPostRawMaterialBatch == null)
     {
         return(false);
     }
     using (IFDIPostRawMaterialBatchBLL FDIPostRawMaterialBatchBLL = BLLContainer.Resolve <IFDIPostRawMaterialBatchBLL>())
     {
         return(FDIPostRawMaterialBatchBLL.Add(mFDIPostRawMaterialBatch));
     }
 }
Exemplo n.º 3
0
 public bool DelFDIPostRawMaterialBatch(string Id)
 {
     using (IFDIPostRawMaterialBatchBLL FDIPostRawMaterialBatchBLL = BLLContainer.Resolve <IFDIPostRawMaterialBatchBLL>())
     {
         try
         {
             FDIPostRawMaterialBatch item = FDIPostRawMaterialBatchBLL.GetFirstOrDefault(Id);
             return(FDIPostRawMaterialBatchBLL.Delete(item));
         }
         catch { return(false); }
     }
 }
Exemplo n.º 4
0
 public bool DelFDIPostRawMaterialBatchs(string[] Ids)
 {
     using (IFDIPostRawMaterialBatchBLL FDIPostRawMaterialBatchBLL = BLLContainer.Resolve <IFDIPostRawMaterialBatchBLL>())
     {
         try
         {
             List <FDIPostRawMaterialBatch> entitys = new List <FDIPostRawMaterialBatch>();
             foreach (string id in Ids)
             {
                 FDIPostRawMaterialBatch item = FDIPostRawMaterialBatchBLL.GetFirstOrDefault(id);
                 entitys.Add(item);
             }
             return(FDIPostRawMaterialBatchBLL.Delete(entitys));
         }
         catch { return(false); }
     }
 }
Exemplo n.º 5
0
        public string PostRawMaterial()
        {
            NetLog.Write("MES回传SAP原材料入库" + "   ");

            var oldBatchs = GetFDIPostRawMaterialBatchs("");
            List <FDIPostRawMaterialBatch> Batchs = new List <FDIPostRawMaterialBatch>();

            var oldDetails = GetFDIPostRawMaterialDetails("");

            var oldMains = GetFDIPostRawMaterials("");
            List <FDIPostRawMaterial> Mains = new List <FDIPostRawMaterial>();

            foreach (var m in oldMains)
            {
                FDIPostRawMaterial main = new FDIPostRawMaterial();
                main.CopyDataItem(m);

                main.Details = new List <FDIPostRawMaterialDetail>();
                foreach (var d in oldDetails.Where(c => c.DocEntry == m.DocEntry))
                {
                    FDIPostRawMaterialDetail detial = new FDIPostRawMaterialDetail();
                    detial.CopyDataItem(d);

                    detial.Batchs = new List <FDIPostRawMaterialBatch>();
                    foreach (var b in oldBatchs.Where(c => c.DocEntry == m.DocEntry && c.LineNum == d.LineId))
                    {
                        FDIPostRawMaterialBatch batch = new FDIPostRawMaterialBatch();
                        batch.CopyDataItem(b);

                        detial.Batchs.Add(batch);
                    }

                    main.Details.Add(detial);
                }


                Mains.Add(main);
            }

            string jsonText = SafeConverter.JsonSerializeObject(Mains);

            return(jsonText);
        }