var sql = "UPDATE dbo.Purchase_Order SET StatusID = 14,StatusText='已合并', Remark=isnull(Remark, '') + '" + _orderInfo.OrderCode + "' WHERE Order_Id in (" + Order_Ids + ")";
Purchase_OrderRepository.Instance.DataContext.ExecuteNonQuery(CommandType.Text, sql);
--------------
sql = "select count(*) from Purchase_Order where Order_Id = " + info.idValue + " and StatusText = '终止'";
int reVal = base.Repository.DataContext.ExecuteScalar(CommandType.Text, sql).GetInt();
if (reVal < 0)
{
rinfo.Data = reVal;
rinfo.Result = false;
rinfo.Msg = "状态没有为终止,开启失败!";
}
------------
SqlParameter[] paramList = new SqlParameter[2];
where = "UserProductCode=@UserProductCode and OrderCode=@OrderCode OR TrackingNumber=@OrderCode";
paramList[0] = new SqlParameter("@OrderCode", OrderCode.SqlSecurity()) { DbType = DbType.String };
paramList[1] = new SqlParameter("@UserProductCode", UserProductCode.SqlSecurity()) { DbType = DbType.String };
Purchase_Order orderInfo = Purchase_OrderRepository.Instance.Get(where, paramList);
if (orderInfo == null)
{
info.Result = false;
info.Msg = "采购单数据不存在!";
return info;
}
if (orderInfo.StatusText == "完全交货")
{
info.Result = false;
info.Msg = "该订单已经完成交货!";
return info;
}
----------------------------------------------------------------------
sql = "select count(*) from TMS_Voyage where VoyageCode ='" + reqInfo.Code+"'" ;
DataTable table = TMS_VoyageRepository.Instance.DataContext.ExecuteDataSet(CommandType.Text, sql).Tables[0];
if (table != null && table.Rows.Count > 0)
{
sql = "Update TMS_Voyage set ActualTakeOffTime =" + reqInfo.ActualTakeOffTime + " where VoyageCode =" + reqInfo.Code;
TMS_VoyageRepository.Instance.DataContext.ExecuteNonQuery(CommandType.Text, sql);
info.Result = true;
}
-------------------------------------------
Where = "UserProduct_Id=@UserProduct_Id AND Enable =1";
var parmentlist = new List<SqlParameter>();
parmentlist.Add(new SqlParameter("@UserProduct_Id", UserHelper.UserInfo.UserProduct_Id));
var Consignlist = Base_ConsignorRepository.Instance.GetMany(Where, parmentlist.ToArray()).ToList();
if (Consignlist != null)
{
info.Result = true;
info.Data = Consignlist;
}