Exemplo n.º 1
0
        public string Save(ICPO_BOLentryModel ICPOBILL)
        {
            string FID = null;

            #region 执行前检测
            if (!ICPOBILL.FID.IsGuid())
            {
                ICPO_BOLentryModel temp = ICPO_BOLentryDAL.Instance.GetWhere(new { Ficbolno = ICPOBILL.Ficbolno }).FirstOrDefault();

                if (temp != null && temp.FID != ICPOBILL.FID)
                {
                    return("提货单号重复!");
                }
            }

            //foreach (var item in ICPOBILLENTRYList.GroupBy(i => i.FITEMID + i.FENTRYID))
            //{
            //    if (item.Count() > 1)
            //    {
            //        return "采购订单明细商品信息重复!";
            //    }
            //}

            //foreach (var item in ICPOPOLICYList.GroupBy(i => i.FITEMID + i.FSRCENTRYID))
            //{
            //    if (item.Count() > 1)
            //    {
            //        return "采购订单价格政策商品信息重复!";
            //    }
            //}

            #endregion

            #region 保存主表

            if (!ICPOBILL.FID.IsGuid())
            {
                FID = ICPO_BOLentryDAL.Instance.Insert(ICPOBILL);

                if (!FID.IsGuid())
                {
                    return("保存提货单失败!");
                }
            }
            else
            {
                FID = ICPOBILL.FID;

                var model = ICPOBILLDAL.Instance.Get(FID);
                ICPOBILLDAL.Instance.Update(model);
            }

            #endregion


            return(null);
        }
        public List <ICPO_BOLentryModel> Remote_GetICPO_BOEntry(string fbillno, string entryid)
        {
            List <ICPO_BOLentryModel> resultList = new List <ICPO_BOLentryModel>();

            FactoryService.APIServiceClient api = new FactoryService.APIServiceClient();
            List <FactoryService.ICPO_BOLentryModel_MNLS> tempModelList = api.GetICPO_BOEntry(fbillno, entryid).ToList();

            foreach (var sub in tempModelList)
            {
                ICPO_BOLentryModel model = new ICPO_BOLentryModel();
                model.FACCOUNT     = sub.FACCOUNT;
                model.Famount      = sub.Famount;
                model.FAUDQTY      = sub.FAUDQTY;
                model.FCOLORNO     = sub.FCOLORNO;
                model.FcommitQTY   = sub.FcommitQTY;
                model.FcontractNO  = sub.FcontractNO;
                model.FDATE        = sub.FDATE;
                model.Ficbolentry  = sub.Ficbolentry;
                model.Ficbolno     = sub.Ficbolno;
                model.FID          = sub.FID;
                model.FITEMID      = sub.FITEMID;
                model.Flevel       = sub.Flevel;
                model.Fpobillentry = sub.Fpobillentry;
                model.FPObillno    = sub.FPObillno;
                model.fprice       = sub.fprice;
                model.FprojectNO   = sub.FprojectNO;
                model.FREMARK      = sub.FREMARK;
                model.FSRCCODE     = sub.FSRCCODE;
                model.FSRCMODEL    = sub.FSRCMODEL;
                model.FSRCNAME     = sub.FSRCNAME;
                model.FstockNO     = sub.FstockNO;
                model.FSYNCSTATUS  = sub.FSYNCSTATUS;
                model.FTIMESTAMP   = sub.FTIMESTAMP;
                model.Funit        = sub.Funit;
                resultList.Add(model);
            }

            return(resultList);
        }