|
|
@@ -34,6 +34,8 @@ using System.Security.Policy;
|
|
|
using System.Text;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading;
|
|
|
+using System.Web.UI;
|
|
|
+using System.Web;
|
|
|
using System.Web.UI.WebControls;
|
|
|
using Utils;
|
|
|
using Utils.Serialization;
|
|
|
@@ -12566,34 +12568,39 @@ namespace SiteCore.Handler
|
|
|
{
|
|
|
returnErrorMsg("文件地址为空");
|
|
|
return;
|
|
|
+
|
|
|
}
|
|
|
- CeErpTrade ceErpTrade = CeErpTrade.Get(tid);
|
|
|
- if (ceErpTrade == null)
|
|
|
- {
|
|
|
- returnErrorMsg("找不到订单");
|
|
|
- return;
|
|
|
- }
|
|
|
- DataTable dt = DbHelper.DbConn.ExecuteDataset(string.Format("select OrderState from ce_erptradecell where tid = '{0}'", tid)).Tables[0];
|
|
|
- bool isSend = false;
|
|
|
- if (dt != null && dt.Rows.Count > 0)
|
|
|
+ CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid);
|
|
|
+ if (ceErpTradeCell != null)
|
|
|
{
|
|
|
- foreach (DataRow row in dt.Rows)
|
|
|
+ CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
|
|
|
+ if (ceErpTrade == null)
|
|
|
{
|
|
|
- if (Convert.ToInt16(row["OrderState"]) > 6)
|
|
|
- {
|
|
|
- isSend = true;
|
|
|
- }
|
|
|
+ returnErrorMsg("找不到订单");
|
|
|
+ return;
|
|
|
}
|
|
|
- if (isSend)
|
|
|
+ DataTable dt = DbHelper.DbConn.ExecuteDataset(string.Format("select OrderState from ce_erptradecell where tid = '{0}'", ceErpTradeCell.tid)).Tables[0];
|
|
|
+ bool isSend = false;
|
|
|
+ if (dt != null && dt.Rows.Count > 0)
|
|
|
{
|
|
|
- returnErrorMsg("已发货无法修改");
|
|
|
+ foreach (DataRow row in dt.Rows)
|
|
|
+ {
|
|
|
+ if (Convert.ToInt16(row["OrderState"]) > 6 && tid.IndexOf("S_") == -1)
|
|
|
+ {
|
|
|
+ isSend = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isSend)
|
|
|
+ {
|
|
|
+ returnErrorMsg("已发货无法修改");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ceErpTrade.Attachments = atta;
|
|
|
+ ceErpTrade.Update();
|
|
|
+ LogHelper.addLog(tid, CurrentUser.UserID, "上传文件地址", 6);
|
|
|
+ returnSuccessMsg("上传成功!");
|
|
|
return;
|
|
|
}
|
|
|
- ceErpTrade.Attachments = atta;
|
|
|
- ceErpTrade.Update();
|
|
|
- LogHelper.addLog(tid, CurrentUser.UserID, "上传文件地址", 6);
|
|
|
- returnSuccessMsg("上传成功!");
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
returnErrorMsg("找不到订单");
|
|
|
@@ -12603,14 +12610,18 @@ namespace SiteCore.Handler
|
|
|
string tid = GetPostString("tid");
|
|
|
if (!string.IsNullOrEmpty(tid))
|
|
|
{
|
|
|
-
|
|
|
- CeErpTrade ceErpTrade = CeErpTrade.Get(tid);
|
|
|
- if (ceErpTrade == null)
|
|
|
+ CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid);
|
|
|
+ if (ceErpTradeCell != null)
|
|
|
{
|
|
|
- returnErrorMsg("找不到订单");
|
|
|
+ CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
|
|
|
+ if (ceErpTrade == null)
|
|
|
+ {
|
|
|
+ returnErrorMsg("找不到订单");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ returnSuccess(JsonConvert.SerializeObject(new { url = ceErpTrade.Attachments }));
|
|
|
+ return;
|
|
|
}
|
|
|
- returnSuccess(JsonConvert.SerializeObject(new { url = ceErpTrade.Attachments }));
|
|
|
- return;
|
|
|
}
|
|
|
returnErrorMsg("找不到订单");
|
|
|
}
|