Exemplo n.º 1
0
        /// <summary>
        /// 移交客服
        /// </summary>
        /// <param name="QuestionIDs"></param>
        /// <param name="LastModifyByID"></param>
        /// <returns></returns>
        public int UpdateGetQuestionDetailsByQuestionID(int QuestionID, int LastModifyByID)//, string LastModifyTime)
        {
            string strSql = @"UPDATE XM_QuestionDetail set SrvAfterCustomerID=" + LastModifyByID + " ,LastModifyByID=" + LastModifyByID + "  WHERE  QuestionID =" + QuestionID;


            return(SqlDataHelper.ExcuteBySql(strSql));
        }
        public string CancelOrder(List <string> orderCodeList)
        {
            var errorstr = string.Empty;

            try
            {
                var sqlOrderCodeList = string.Join("','", orderCodeList);
                var sql = string.Format(@"select ID, OrderCode , IsAudit from XM_OrderInfo where OrderCode in ('{0}')", sqlOrderCodeList);
                var dt  = SqlDataHelper.GetDatatableBySql(sql);
                var ErpErpOrderInfoList = CurUtilManager.ToEntity <ErpOrderInfo>(dt);
                #region 判断是否所有传入的订单号都找得到对应的订单信息
                var ErpErpOrderCodeList = ErpErpOrderInfoList.Select(m => m.OrderCode).ToList();
                var ExceptList          = orderCodeList.Except(ErpErpOrderCodeList).ToList();
                if (ExceptList.Count > 0)
                {
                    return(string.Format("这些订单号{0}在ERP中无法找到对应的订单信息", string.Join(",", ExceptList)));
                }
                #endregion
                var notdeleteList = ErpErpOrderInfoList.Where(m => m.IsIsAudit == true).Select(m => m.OrderCode).ToList();
                if (notdeleteList.Count > 0)
                {
                    return(string.Format("这些订单号{0}已经审核无法取消", string.Join(",", notdeleteList)));
                }
                else
                {
                    var deleteIDList = ErpErpOrderInfoList.Select(m => m.ID).ToList();
                    var sqlwhereids  = string.Join(",", deleteIDList);
                    var deleteSql    = string.Format(@"delete from XM_OrderInfoProductDetails where OrderInfoID in ('{0}') delete from XM_OrderInfo where ID in ('{0}')", sqlwhereids);
                    SqlDataHelper.ExcuteBySql(deleteSql);
                }
            }catch (Exception ex)
            {
                InsertLog.Insert("取消订单接口报错:" + ex.Message, ex);
            }
            return(errorstr);
        }