CY_ECommercePlatform/CY.WebForm/Pages/business/OrderDeatil.aspx.cs
@@ -30,6 +30,8 @@
using CY.BLL;
using CY.Model.Inquiry;
using CY.BLL.Sys;
using CY.SQLDAL;
using System.Data.SqlClient;
namespace CY.WebForm.Pages.business
{
@@ -40,6 +42,8 @@
    {
        EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
        Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象
        public int ContractCount = 0;
        public string BuyerId = "";
        /// <summary>
        /// 页面加载事件
        /// </summary>
@@ -108,11 +112,11 @@
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
            if (CurrentUser.MemberId!=Guid.Parse(UtilConst.AdminFirmId)&&_eC_OrderBasic.BuyerId != CurrentUser.MemberId && _eC_OrderBasic.SellerId != CurrentUser.MemberId)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
            //if (CurrentUser.MemberId!=Guid.Parse(UtilConst.AdminFirmId)&&_eC_OrderBasic.BuyerId != CurrentUser.MemberId && _eC_OrderBasic.SellerId != CurrentUser.MemberId)
            //{
            //    CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
            //    return false;
            //}
            EC_AcceptWayByOrderBLL _eC_AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL();
            EC_AcceptWayByOrder _eC_AcceptWayByOrder = _eC_AcceptWayByOrderBLL.GetModelByTargetId(orderId.Value);
            if (null == _eC_AcceptWayByOrder)
@@ -120,6 +124,9 @@
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
            _eC_AcceptWayByOrder.NumPerBag = _eC_OrderBasic.OrderExtend.NumPerBag;
            _eC_AcceptWayByOrder.BagNum = _eC_OrderBasic.OrderExtend.BagNum;
            EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
            EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId.Value);
@@ -145,6 +152,28 @@
            {
                _eC_OrderBasic.UnitName = sys_Dictionarie.Name;
            }
            BuyerId = _eC_OrderBasic.BuyerId.ToString();
            //查询客户是否有合同
            Database DC = new Database();
            try
            {
                string sqlStr = string.Format("select  count(*) from [dbo].[OA_CorporateClientContract] where CorporateClientsid='{0}'", _eC_OrderBasic.BuyerId);
                SqlCommand myCmd = new SqlCommand(sqlStr, DC.Connection);
                ContractCount = (int)myCmd.ExecuteScalar();
            }
            catch (Exception)
            {
                ContractCount = 0;
            }
            finally
            {
                if (DC.Connection.State != System.Data.ConnectionState.Closed)
                    DC.Connection.Close();
            }
            rptOrder.DataSource = new List<EC_OrderBasic>() { _eC_OrderBasic };
            rptOrder.DataBind();
            rptAccpteWay.DataSource = "自提".Equals(_inquiryCommonModel.DeliveryModeName) ? null : new List<EC_AcceptWayByOrder>() { _eC_AcceptWayByOrder };