示例#1
0
        //private functions
        private void AddPackLogs(List <PackPageData> pageDatas, string flag)
        {
            if (pageDatas == null || pageDatas.Count == 0)
            {
                return;
            }
            //add log
            RP_AUTOPACK_LOG_BLL logBLL = new RP_AUTOPACK_LOG_BLL();

            foreach (var item in pageDatas)
            {
                if (item.Details != null && item.Details.Count > 0)
                {
                    foreach (var d in item.Details)
                    {
                        if (logBLL.HasSuccessPrint(d.LODNUM))
                        {
                            continue;
                        }
                        else
                        {
                            RP_AUTOPACK_LOG model = new RP_AUTOPACK_LOG();
                            model.WH_ID           = d.WH_ID;
                            model.SHIP_ID         = d.SHIP_ID;
                            model.LODNUM          = d.LODNUM;
                            model.AUTO_PRINT_DATE = DateTime.Now;
                            model.SUCCEE_FLAG     = flag;
                            logBLL.AddOrUpdatePrintLog(model);
                        }
                    }
                }
            }
        }
示例#2
0
        public bool HasSuccessPrint(string lodNum)
        {
            RP_AUTOPACK_LOG exist = db.RP_AUTOPACK_LOG.FirstOrDefault(a => a.LODNUM == lodNum);

            if (exist == null)
            {
                return(false);
            }
            return((exist.SUCCEE_FLAG ?? "N") == CHubCommon.CHubConstValues.IndY);
        }
示例#3
0
        public void AddOrUpdatePrintLog(RP_AUTOPACK_LOG model)
        {
            RP_AUTOPACK_LOG exist = dal.GetSpecifyLog(model.LODNUM);

            if (exist == null)
            {
                dal.Add(model);
            }
            else
            {
                if ((exist.SUCCEE_FLAG ?? "N") != CHubCommon.CHubConstValues.IndY)
                {
                    exist.SUCCEE_FLAG     = model.SUCCEE_FLAG;
                    exist.AUTO_PRINT_DATE = model.AUTO_PRINT_DATE;
                    dal.Update(exist);
                }
            }
        }