Exemple #1
0
        public bool UpdateDeliverLog(DeliverLog obj)
        {
            LoggingData data   = new LoggingData(ip, username, password, database);
            bool        result = data.UpdateDeliverLog(obj.Id, obj.Sn, obj.CourierCode, obj.ReceiverTelNum, obj.BoxCode, obj.CreatedTime, Convert.ToByte(obj.ServerSaved), obj.Remark);

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 包裹投递成功后操作
        /// </summary>
        /// <param name="p"></param>
        void packageManager_PackageCreatedEvent(Package p)
        {
            bool savePackage    = false;
            bool updatePackage  = false;
            bool updateBox      = false;
            bool saveDeliverLog = false;

            if (p.IsNeedUpdate == false)
            {
                savePackage = this.databaseService.SavePackage(p);
            }
            else
            {
                updatePackage = this.databaseService.UpdatePackage(p);
            }
            //updateBox = this.databaseService.UpdateBox(p.Place);
            DeliverLog dLog = new DeliverLog();

            dLog.BoxCode        = p.Place.Code;
            dLog.CourierCode    = p.Courier.Code;
            dLog.CreatedTime    = p.CreatedTime;
            dLog.ReceiverTelNum = p.ReceiverTelNum;
            dLog.Remark         = p.RemarkInfo;
            dLog.Sn             = p.SN;

            saveDeliverLog = this.databaseService.SaveDeliverLog(dLog);

            CLog4net.LogInfo("包裹创建数据库更新:savePackage " + savePackage + " updatePackage " + updatePackage + " updateBox " + updateBox + " saveDeliverLog " + saveDeliverLog);
        }
Exemple #3
0
        public List <DeliverLog> GetDeliverLogNoUpload()
        {
            DataTable   table = null;
            LoggingData data  = new LoggingData(ip, username, password, database);

            table = data.GetDeliverLogNoUpload();
            if (table == null)
            {
                CLog4net.LogError("寄件日志表初始化错误");
                return(null);
            }
            List <DeliverLog> a = new List <DeliverLog>();

            foreach (System.Data.DataRow d in table.Rows)
            {
                DeliverLog dl = new DeliverLog();
                dl.Sn             = Convert.ToString(d[TbDeliverLog.packageCode]);
                dl.CourierCode    = Convert.ToString(d[TbDeliverLog.courierCode]);
                dl.ReceiverTelNum = Convert.ToString(d[TbDeliverLog.receiverTelNum]);
                dl.BoxCode        = Convert.ToInt32(d[TbDeliverLog.boxCode]);
                dl.CreatedTime    = Convert.ToDateTime(d[TbDeliverLog.createdTime]);
                dl.ServerSaved    = Convert.ToBoolean(d[TbDeliverLog.serverSaved]);
                dl.Remark         = Convert.ToString(d[TbDeliverLog.remark]);
                a.Add(dl);
            }
            return(a);
        }