Exemplo n.º 1
0
        public void UpdateTransportComment(int id, String comment, String userID)
        {
            using (SQLDBDataContext context = new SQLDBDataContext())
            {
                TransportRecords record = context.TransportRecords.FirstOrDefault(x => x.ID == id);
                if (record == null)
                {
                    throw new ApplicationException("要修改的记录不存在");
                }
                record.Comment = comment;
                record.TransportRecordsOptionHistory.Add(
                    new TransportRecordsOptionHistory()
                {
                    Description = string.Format("修改备注信息为: {0} ", comment),
                    LogDateTime = DateTime.Now,
                    Operation   = "更新",
                    UserID      = userID
                });

                context.SubmitChanges();
            }
        }
Exemplo n.º 2
0
 public void UpdateTransportErrorStatus(int id, bool error, string errorMessage, string userID)
 {
     using (SQLDBDataContext context = new SQLDBDataContext())
     {
         TransportRecords record = context.TransportRecords.FirstOrDefault(x => x.ID == id);
         if (record == null)
         {
             throw new ApplicationException("要修改的记录不存在");
         }
         record.Error        = error;
         record.ErrorMessage = errorMessage;
         record.TransportRecordsOptionHistory.Add(
             new TransportRecordsOptionHistory()
         {
             Description = string.Format("修改异常状态为{0}, 异常信息:{1}", error?"异常":"正常", errorMessage),
             LogDateTime = DateTime.Now,
             Operation   = "修改异常状态",
             UserID      = userID
         });
         context.SubmitChanges();
     }
 }
Exemplo n.º 3
0
 public void UpdateTransportModel(int id, string trayNo, double volume, int quantity, bool updateClientIndex, string userID)
 {
     using (SQLDBDataContext context = new SQLDBDataContext())
     {
         TransportRecords record = context.TransportRecords.FirstOrDefault(x => x.ID == id);
         if (record == null)
         {
             throw new ApplicationException("要修改的记录不存在");
         }
         record.TrayNo   = trayNo;
         record.Volume   = volume;
         record.Quantity = quantity;
         record.TransportRecordsOptionHistory.Add(
             new TransportRecordsOptionHistory()
         {
             Description = string.Format("更新单据内容,新内容 托编号:{0} 体积: {1} 数量:{2} ", trayNo, volume, quantity),
             LogDateTime = DateTime.Now,
             Operation   = "更新",
             UserID      = userID
         });
         if (updateClientIndex)
         {
             if (!string.IsNullOrEmpty(trayNo))
             {
                 Client client = context.Client.FirstOrDefault(x => x.ClientName == record.ClientName);
                 if (client != null)
                 {
                     client.Index = GetTrayNoIndex(trayNo);
                     if (client.IndexMonth != DateTime.Now.Month)
                     {
                         client.Index      = 0;
                         client.IndexMonth = DateTime.Now.Month;
                     }
                 }
             }
         }
         context.SubmitChanges();
     }
 }
Exemplo n.º 4
0
 public void UpdateTransportPrice(int id, double?deliverPrice, double?shortBargeFee, double?accoundPayable, string userID)
 {
     using (SQLDBDataContext context = new SQLDBDataContext())
     {
         TransportRecords record = context.TransportRecords.FirstOrDefault(x => x.ID == id);
         if (record == null)
         {
             throw new ApplicationException("要修改的记录不存在");
         }
         record.DeliverPrice  = deliverPrice;
         record.ShortBargeFee = shortBargeFee;
         record.AccountPayble = accoundPayable;
         record.TransportRecordsOptionHistory.Add(
             new TransportRecordsOptionHistory()
         {
             Description = string.Format("修改价格信息, 运费:{0},短驳费:{1},应付金额:{2}", deliverPrice, shortBargeFee, accoundPayable),
             LogDateTime = DateTime.Now,
             Operation   = "修改价格信息",
             UserID      = userID
         });
         context.SubmitChanges();
     }
 }