コード例 #1
0
        public bool DealMessage302(string orderNoFake, string guid, string status, string returnTime, string returnInfo, string destPath)
        {
            bool success = true;

            try
            {
                EntryReceive entry = new EntryReceive();
                entry.ItemGuid   = new Guid(guid);
                entry.Status     = Convert.ToInt32(status);
                entry.ReturnTime = returnTime;
                entry.ReturnInfo = returnInfo;
                entry.FilePath   = destPath;
                using (var db = new EntryContext())
                {
                    var query = from m in db.MessageTracks.Include("Entry302s")
                                where m.OrderNoFake == orderNoFake
                                select m;
                    var msTrack = query.FirstOrDefault();
                    msTrack.Entry302s.Add(entry);
                    msTrack.LastUpdateTicks = DateTime.Now.Ticks;
                    if (msTrack.Schedule < 302)
                    {
                        msTrack.Schedule = 302;
                    }
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                Logs.Error(string.Format("DealMessage302 OrderNoFake: {0} , Exception: {1}", orderNoFake, ex.ToString()));
                success = false;
            }
            return(success);
        }
コード例 #2
0
        public bool DealMessage504(string logisticsNo, string guid, string status, string logisticsStatus, string returnTime, string returnInfo, string destPath)
        {
            bool success = true;

            try
            {
                EntryReceive entry = new EntryReceive();
                entry.ItemGuid   = new Guid(guid);
                entry.Status     = Convert.ToInt32(status);
                entry.ReturnTime = returnTime;
                entry.ReturnInfo = returnInfo;
                entry.FilePath   = destPath;
                entry.Commnet1   = logisticsStatus;
                using (var db = new EntryContext())
                {
                    var query = from m in db.MessageTracks.Include("Entry504s")
                                where m.LogisticsNo == logisticsNo
                                select m;
                    var msTrack = query.FirstOrDefault();
                    msTrack.Entry504s.Add(entry);
                    msTrack.LastUpdateTicks = DateTime.Now.Ticks;
                    msTrack.Schedule        = 504;
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                Logs.Error(string.Format("DealMessage504 LogisticsNo: {0} Exception: {1}", logisticsNo, ex.ToString()));
                success = false;
            }
            return(success);
        }