/// <summary>
        /// 查询最终订单状态(供应商)
        /// </summary>
        /// <returns></returns>
        public static OrderInfoEntity orderQueryByOrderNum(OrderInfoEntity OrderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (OrderInfoEntity.OrderInfoDBEntity.Count > 0) ? OrderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            string DataString = "{\"orderNum\":\"" + dbParm.FOG_ORDER_NUM + "\"}";

            string HotelPrRoomPlanUrl = JsonRequestURLBuilder.orderQueryByOrderNumV2();
            CallWebPage callWebPage = new CallWebPage();
            string strHotelPrRoomPlan = callWebPage.CallWebByURL(HotelPrRoomPlanUrl, DataString);
            JObject oHotelPrRoomPlan = JObject.Parse(strHotelPrRoomPlan);

            if ("success".Equals(JsonRequestURLBuilder.GetJsonStringValue(oHotelPrRoomPlan, "message").Trim('"')))
            {

                OrderInfoEntity.ErrorMSG = oHotelPrRoomPlan.SelectToken("result").SelectToken("statusDesc").ToString().Trim('"') + "(" + oHotelPrRoomPlan.SelectToken("result").SelectToken("statusOriginal").ToString().Trim('"') + ")";//最终状态(状态描述)
                OrderInfoEntity.Result = 1;
            }
            else
            {
                OrderInfoEntity.ErrorMSG = "";
                OrderInfoEntity.Result = 2;
            }

            return OrderInfoEntity;
        }
    private void BandData(string hotelID, string outSDate, string outEDate, string orderStatus, string orderID)
    {
        lbFaxDate.Text = DateTime.Now.ToString();
        lbFrom.Text = UserSession.Current.UserDspName;
        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
        orderinfoEntity.HotelID = hotelID;
        orderinfoEntity.StartDate = outSDate;
        orderinfoEntity.EndDate = outEDate;
        orderinfoEntity.OrderID = orderID;
        orderinfoEntity.AuditStatus = orderStatus;
        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        DataSet dsResult = OrderInfoBP.BindOrderApprovePrint(_orderInfoEntity).QueryResult;

        //gridViewCSList.DataSource = dsResult.Tables["PRINT"].DefaultView;
        //gridViewCSList.DataKeyNames = new string[] { "ORDROOM" };//主键
        //gridViewCSList.DataBind();

        SerOrderList(dsResult);

        if (dsResult.Tables["HLEX"].Rows.Count > 0)
        {
            lbHotelID.Text = String.Format("酒店名称:{0}(ID:{1})", dsResult.Tables["HLEX"].Rows[0]["prop_name_zh"].ToString(), dsResult.Tables["HLEX"].Rows[0]["hotel_id"].ToString());

            string strTo = dsResult.Tables["HLEX"].Rows[0]["linkman"].ToString();
            string strTelTo = dsResult.Tables["HLEX"].Rows[0]["linktel"].ToString();
            string strFaxTo = dsResult.Tables["HLEX"].Rows[0]["linkfax"].ToString();
            int iHour = DateTime.Now.Hour;

            lbTo.Text = (strTo.Split('|').Length >= iHour) ? strTo.Split('|')[iHour].ToString() : "";
            lbTelTo.Text = (strTelTo.Split('|').Length >= iHour) ? strTelTo.Split('|')[iHour].ToString() : "";
            lbFaxTo.Text = (strFaxTo.Split('|').Length >= iHour) ? strFaxTo.Split('|')[iHour].ToString() : "";
        }
        else
        {
            lbHotelID.Text = "";
            lbTo.Text = "";
            lbTelTo.Text = "";
            lbFaxTo.Text = "";
            //lbTelFrom.Text = "";
            //lbFaxFrom.Text = "";
        }

        if (dsResult.Tables["UsersInfo"].Rows.Count > 0)
        {
            lbTelFrom.Text = dsResult.Tables["UsersInfo"].Rows[0]["User_Tel"].ToString();
        }
        else
        {
            lbTelFrom.Text = "";
        }
    }
        public static OrderInfoEntity BindOrderApproveList(OrderInfoEntity orderInfoEntity)
        {
            orderInfoEntity.LogMessages.MsgType = MessageType.INFO;
            orderInfoEntity.LogMessages.Content = _nameSpaceClass + "BindOrderApproveList";
            LoggerHelper.LogWriter(orderInfoEntity.LogMessages);

            try
            {
                return OrderInfoDA.BindOrderApproveList(orderInfoEntity);

            }
            catch (Exception ex)
            {
                orderInfoEntity.LogMessages.MsgType = MessageType.ERROR;
                orderInfoEntity.LogMessages.Content = _nameSpaceClass + "BindOrderApproveList  Error: " + ex.Message;
                LoggerHelper.LogWriter(orderInfoEntity.LogMessages);
                throw ex;
            }
        }
    private void ResetOrderConfirmListGrid()
    {
        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();

        orderinfoEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        string strOrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        string strfaxNum = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxNum"].ToString())) ? null : ViewState["FaxNum"].ToString();

        if (!String.IsNullOrEmpty(strOrderID) || !String.IsNullOrEmpty(strfaxNum))
        {
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.FaxNum = strfaxNum;
            orderinfoEntity.SqlType = "1";
        }
        else if (!String.IsNullOrEmpty(hidSelectCity.Value) || !String.IsNullOrEmpty(hidSelectHotel.Value) || !String.IsNullOrEmpty(hidSelectBussiness.Value))
        {
            orderinfoEntity.City = hidSelectCity.Value == "" ? "" : hidSelectCity.Value.Substring((hidSelectCity.Value.IndexOf('[') + 1), (hidSelectCity.Value.IndexOf(']') - 1)); //"";//城市ID
            //orderinfoEntity.HotelID = hidSelectHotel.Value == "" ? "" : hidSelectHotel.Value.Substring((hidSelectHotel.Value.IndexOf('[') + 1), (hidSelectHotel.Value.IndexOf(']') - 1));//"";//酒店ID
            orderinfoEntity.Bussiness = hidSelectBussiness.Value == "" ? "" : hidSelectBussiness.Value.Substring((hidSelectBussiness.Value.IndexOf('[') + 1), (hidSelectBussiness.Value.IndexOf(']') - 1));//"";//商圈ID
            orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
            orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
            orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();
            orderinfoEntity.FaxNum = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxNum"].ToString())) ? null : ViewState["FaxNum"].ToString();
            //orderinfoEntity.FaxStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxStatus"].ToString())) ? null : ViewState["FaxStatus"].ToString();
            orderinfoEntity.SqlType = "2";
        }
        else
        {
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
            orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
            orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
            orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();
            //orderinfoEntity.FaxStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxStatus"].ToString())) ? null : ViewState["FaxStatus"].ToString();
            orderinfoEntity.SqlType = "3";
        }

        //orderinfoEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        //orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
        //orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
        //orderinfoEntity.OrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        //orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
        //orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();

        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        DataSet dsResult = OrderInfoBP.BindOrderApproveFaxList(_orderInfoEntity).QueryResult;

        if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
        {
            dvGridMessage.InnerHtml = "无审核订单";
        }
        else
        {
            dvGridMessage.InnerHtml = "";
            if (dsResult.Tables[0].Select("ORDERST='未审核'").Length == 0)
            {
                for (int i = 0; i < gridHotelList.Rows.Count; i++)
                {
                    //首先判断是否是数据行
                    if (gridHotelList.Rows[i].RowType == DataControlRowType.DataRow && gridHotelList.DataKeys[i].Values[0].ToString().Equals(orderinfoEntity.HotelID))
                    {
                        gridHotelList.Rows[i].BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C");

                        gridHotelList.Rows[i].Attributes.Add("onMouseOver", "t=this.style.backgroundColor;this.style.backgroundColor='#ebebce';");
                        gridHotelList.Rows[i].Attributes.Add("onMouseOut", "this.style.backgroundColor=t;");
                        //gridHotelList.Rows[i].Cells[0].Attributes.Add("bgcolor", "#70A88C");
                        //gridHotelList.Rows[i].Cells[1].Attributes.Add("bgcolor", "#70A88C");

                        //gridHotelList.Rows[i].Cells[0].Attributes.Add("onMouseOver", "t=this.style.backgroundColor;this.style.backgroundColor='#ebebce';c=this.parentNode.parentNode.childNodes[" + i + "].childNodes[1].style.backgroundColor;this.parentNode.parentNode.childNodes[" + i + "].childNodes[1].style.backgroundColor='#ebebce';");
                        //gridHotelList.Rows[i].Cells[0].Attributes.Add("onMouseOut", "this.style.backgroundColor=t;this.parentNode.parentNode.childNodes[" + i + "].childNodes[1].style.backgroundColor=c;");

                        //gridHotelList.Rows[i].Cells[1].Attributes.Add("onMouseOver", "t=this.style.backgroundColor;this.style.backgroundColor='#ebebce';c=this.parentNode.parentNode.childNodes[" + i + "].childNodes[0].style.backgroundColor;this.parentNode.parentNode.childNodes[" + i + "].childNodes[0].style.backgroundColor='#ebebce';");
                        //gridHotelList.Rows[i].Cells[1].Attributes.Add("onMouseOut", "this.style.backgroundColor=t;this.parentNode.parentNode.childNodes[" + i + "].childNodes[0].style.backgroundColor=c;");
                    }
                }
            }
        }
        gridViewCSList.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");

        gridViewCSList.DataSource = dsResult.Tables[0].DefaultView;
        gridViewCSList.DataKeyNames = new string[] { "ORDERID" };//主键
        gridViewCSList.DataBind();
    }
        public static bool chkDApproveData(HotelInfoEntity hotelInfoEntity, DataRow drRow)
        {
            HotelInfoDBEntity dbParm = (hotelInfoEntity.HotelInfoDBEntity.Count > 0) ? hotelInfoEntity.HotelInfoDBEntity[0] : new HotelInfoDBEntity();

            string LDStatus = string.Empty;
            string NSStatus = string.Empty;
            string LDdbAppr = string.Empty;
            string NSdbAppr = string.Empty;
            string ADStatsBack = (String.IsNullOrEmpty(dbParm.ADStatsBack)) ? "" : dbParm.ADStatsBack;

            if (ADStatsBack.Contains("1") || ADStatsBack.Contains("3"))
            {
                LDStatus = "离店";
            }

            if (ADStatsBack.Contains("2") || ADStatsBack.Contains("4"))
            {
                NSStatus = "No-Show";
            }

            if (ADStatsBack.Contains("1"))
            {
                LDdbAppr = "0";
            }
            else if (ADStatsBack.Contains("3"))
            {
                LDdbAppr = "1";
            }

            if (ADStatsBack.Contains("2"))
            {
                NSdbAppr = "0";
            }
            else if (ADStatsBack.Contains("4"))
            {
                NSdbAppr = "1";
            }

            OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
            _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
            OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
            orderinfoEntity.HotelID = drRow["prop"].ToString();
            orderinfoEntity.OutDate = dbParm.OutDate;
            orderinfoEntity.OrderID = dbParm.OrderID;
            orderinfoEntity.AuditStatus = dbParm.AuditStatus;
            orderinfoEntity.ADStatsBack = dbParm.ADStatsBack;
            _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);

               DataSet dsOrders = OrderInfoDA.BindOrderApproveFaxList(_orderInfoEntity).QueryResult;
               DataSet dsResult = new DataSet();
               for (int i = dsOrders.Tables[0].Rows.Count - 1; i >= 0; i--)
               {
               if ("未审核".Equals(dsOrders.Tables[0].Rows[i]["ORDERST"].ToString()))
               {
                    continue;
               }

               if (!String.IsNullOrEmpty(ADStatsBack))
               {
                   DataCommand cmd = DataCommandManager.GetDataCommand("ChkApproveOrderList");
                   cmd.SetParameterValue("@ORDERID", dsOrders.Tables[0].Rows[i]["ORDERID"].ToString());
                   dsResult = cmd.ExecuteDataSet();

                   if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
                   {
                       dsOrders.Tables[0].Rows.RemoveAt(i);
                   }
                   else
                   {
                       if ("离店".Equals(dsResult.Tables[0].Rows[0]["OD_STATUS"].ToString()))
                       {
                           if (!(!String.IsNullOrEmpty(LDStatus) && LDdbAppr.Equals(dsResult.Tables[0].Rows[0]["ISDBAPPROVE"].ToString())))
                           {
                               dsOrders.Tables[0].Rows.RemoveAt(i);
                           }
                       }
                       else if ("No-Show".Equals(dsResult.Tables[0].Rows[0]["OD_STATUS"].ToString()))
                       {
                           if (!(!String.IsNullOrEmpty(NSStatus) && NSdbAppr.Equals(dsResult.Tables[0].Rows[0]["ISDBAPPROVE"].ToString())))
                           {
                               dsOrders.Tables[0].Rows.RemoveAt(i);
                           }
                       }
                       else
                       {
                           dsOrders.Tables[0].Rows.RemoveAt(i);
                       }
                   }
               }
               }

               if (dsOrders.Tables.Count > 0 && dsOrders.Tables[0].Rows.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    private void UnLockOrderConfirm(string orderID)
    {
        if (!String.IsNullOrEmpty(orderID))
        {
            OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
            _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
            _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
            _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
            _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

            _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
            OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();

            orderinfoEntity.OrderID = orderID;
            _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
            int iResut = OrderInfoBP.UnLockOrderConfirm(_orderInfoEntity).Result;

            _commonEntity.LogMessages = _orderInfoEntity.LogMessages;
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
            CommonDBEntity commonDBEntity = new CommonDBEntity();

            commonDBEntity.Event_Type = "订单操作-解锁";
            commonDBEntity.Event_ID = hidHotelID.Value;
            string conTent = GetLocalResourceObject("EventUnLockOrderMessage").ToString();

            conTent = string.Format(conTent, orderID, _orderInfoEntity.LogMessages.Username);
            commonDBEntity.Event_Content = conTent;

            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateUnLockOrderSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }
    }
        public static int InsertOrderActionHistoryList(OrderInfoEntity OrderEntity)
        {
            if (OrderEntity.OrderInfoDBEntity.Count == 0)
            {
                return 0;
            }

            OrderInfoDBEntity dbParm = (OrderEntity.OrderInfoDBEntity.Count > 0) ? OrderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertOrderActionHistoryList");

            cmd.SetParameterValue("@FGID", dbParm.ORDER_NUM);
            cmd.SetParameterValue("@EVENTTYPE", dbParm.EventType);
            cmd.SetParameterValue("@ACTIONID", dbParm.ActionID);
            cmd.SetParameterValue("@ODSTATUS", dbParm.OdStatus);
            cmd.SetParameterValue("@REMARK", dbParm.REMARK);
            cmd.SetParameterValue("@CANNEL", dbParm.CANNEL);
            cmd.SetParameterValue("@INROOMID", dbParm.InRoomID);
            cmd.SetParameterValue("@APPROVEID", dbParm.ApproveId);
            cmd.SetParameterValue("@USERID", (OrderEntity.LogMessages != null) ? OrderEntity.LogMessages.Userid : "");
            cmd.SetParameterValue("@ISDBAPPROVE", dbParm.IsDbApprove);
            cmd.ExecuteNonQuery();
            return 1;
        }
    protected void btnSet_Click(object sender, EventArgs e)
    {
        dvErrorInfo.InnerHtml = "";
        imgAlert.Src = "";
        string strOrderBookStatus = string.Empty;

        if (String.IsNullOrEmpty(hidOrderID.Value.Trim()))
        {
            imgAlert.Src = "../../Styles/images/err.png";
            dvImg.Style.Add("margin-left", "100px");
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorMessage").ToString();
            ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        if (String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()))
        {
            imgAlert.Src = "../../Styles/images/err.png";
            dvImg.Style.Add("margin-left", "100px");
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorEmptyRemark").ToString();
            ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        if (!String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()) && (StringUtility.Text_Length(txtBOOK_REMARK.Text.ToString().Trim()) > 250))
        {
            imgAlert.Src = "../../Styles/images/err.png";
            dvImg.Style.Add("margin-left", "10px");
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorRemark").ToString();
            ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        if (rdbCofRe.Checked)
        {
            trComfIn.Style.Add("display", "none");
            trCanlReson.Style.Add("display", "none");

            imgAlert.Src = "../../Styles/images/suc.png";
            dvImg.Style.Add("margin-left", "100px");
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateReSuccess").ToString();

            OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
            _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
            _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
            _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
            _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

            _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
            OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
            orderinfoEntity.EventType = "订单确认";
            orderinfoEntity.ORDER_NUM = hidOrderID.Value;
            orderinfoEntity.OdStatus = "备注";
            orderinfoEntity.REMARK = txtBOOK_REMARK.Text.Trim();
            orderinfoEntity.ActionID = "";
            orderinfoEntity.CANNEL = "";
            _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
            CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);
            ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenListAj()", true);
            return;
        }
        else
        {
            if (!"LMBAR".Equals(hidPriceCode.Value.ToUpper()))
            {
                if (rdbCofIn.Checked)
                {
                    strOrderBookStatus = "4";
                }
                else if (rdbCofCal.Checked)
                {
                    strOrderBookStatus = "9";
                }
                else
                {
                    strOrderBookStatus = "4";
                }
            }
            else
            {
                strOrderBookStatus = "4";
            }

            if ("LMBAR".Equals(hidPriceCode.Value.ToUpper()))
            {
                trComfIn.Style.Add("display", "none");
                trCanlReson.Style.Add("display", "");
            }
            else if (!"LMBAR".Equals(hidPriceCode.Value.ToUpper()) && "9".Equals(strOrderBookStatus))
            {
                trComfIn.Style.Add("display", "none");
                trCanlReson.Style.Add("display", "");
            }
            else
            {
                trComfIn.Style.Add("display", "");
                trCanlReson.Style.Add("display", "none");
            }
        }

        _lmSystemLogEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _lmSystemLogEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _lmSystemLogEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _lmSystemLogEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _lmSystemLogEntity.FogOrderID = hidOrderID.Value;

        _lmSystemLogEntity.OrderBookStatus = strOrderBookStatus;
        _lmSystemLogEntity.CanelReson = ddpCanelReson.SelectedValue.Trim();
        _lmSystemLogEntity.BookRemark = txtBOOK_REMARK.Text.Trim();
        _lmSystemLogEntity.FollowUp = (chkFollowUp.Checked) ? "1" : "0";
        _lmSystemLogEntity.ActionID = (!"LMBAR".Equals(hidPriceCode.Value.ToUpper())) ? txtCofNum.Text.Trim() : "";
        int iResult = LmSystemLogBP.SaveOrderOperation(_lmSystemLogEntity);

        _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "订单确认-保存";
        commonDBEntity.Event_ID = hidHotelID.Value + "-" + _lmSystemLogEntity.FogOrderID;
        string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

        conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.OrderBookStatus, _lmSystemLogEntity.BookRemark, _lmSystemLogEntity.CanelReson, _lmSystemLogEntity.FollowUp);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            imgAlert.Src = "../../Styles/images/suc.png";
            dvImg.Style.Add("margin-left", "100px");
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();

            OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
            _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
            _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
            _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
            _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

            _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
            OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
            orderinfoEntity.EventType = "订单确认";
            orderinfoEntity.ORDER_NUM = hidOrderID.Value;
            orderinfoEntity.OdStatus = SetActionTypeVal(strOrderBookStatus);
            orderinfoEntity.REMARK = txtBOOK_REMARK.Text.Trim();
            orderinfoEntity.ActionID = (!"LMBAR".Equals(hidPriceCode.Value.ToUpper())) ? txtCofNum.Text.Trim() : "";
            orderinfoEntity.CANNEL = ("9".Equals(strOrderBookStatus) || ("LMBAR".Equals(hidPriceCode.Value.ToUpper()) && "4".Equals(strOrderBookStatus))) ? ddpCanelReson.SelectedValue.Trim() : "";
            _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
            CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);
            RestControlVal();
            ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenListAj()", true);
        }
        else if (iResult == 2)
        {
            imgAlert.Src = "../../Styles/images/err.png";
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateLockErr").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateLockErr").ToString();
            dvImg.Style.Add("margin-left", "30px");
        }
        else
        {
            imgAlert.Src = "../../Styles/images/err.png";
            dvImg.Style.Add("margin-left", "100px");
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenList()", true);
    }
 public static OrderInfoEntity CommonCitySelect(OrderInfoEntity orderInfoEntity)
 {
     orderInfoEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_b_citylist", true);
     return orderInfoEntity;
 }
        public static OrderInfoEntity OrderApprovedReport(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            OracleParameter[] lmparm ={
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("CITYID",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                lmparm[0].Value = DBNull.Value;
            }
            else
            {
                lmparm[0].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                lmparm[1].Value = DBNull.Value;
            }
            else
            {
                lmparm[1].Value = dbParm.EndDate;
            }

            if (String.IsNullOrEmpty(dbParm.CITY_ID))
            {
                lmparm[2].Value = DBNull.Value;
            }
            else
            {
                lmparm[2].Value = dbParm.CITY_ID;
            }

            orderInfoEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_order_approved_report", true, lmparm);
            return orderInfoEntity;
        }
        public static OrderInfoEntity InsertOrderActionHisList(OrderInfoEntity orderInfoEntity, string Result)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            DataCommand cmd = DataCommandManager.GetDataCommand("InsertOrderActionHisList");
            cmd.SetParameterValue("@EVENTTYPE", dbParm.EventType);
            cmd.SetParameterValue("@FOGORDERNUM", dbParm.FOG_ORDER_NUM);
            cmd.SetParameterValue("@ACTIONID", dbParm.ActionID);
            cmd.SetParameterValue("@STATUS", dbParm.BOOK_STATUS);
            cmd.SetParameterValue("@REMARK", dbParm.REMARK);
            cmd.SetParameterValue("@CANNEL", dbParm.CanelReson);
            cmd.SetParameterValue("@EVENTUSER", dbParm.USER_ID);
            cmd.SetParameterValue("@APPROVEID", dbParm.ApproveId);
            cmd.SetParameterValue("@ROOMID", dbParm.ROOM_TYPE_CODE);
            cmd.SetParameterValue("@OPERATERESULT", Result);
            cmd.SetParameterValue("@ISDBAPPROVE", dbParm.IsDbApprove);

            orderInfoEntity.Result = cmd.ExecuteNonQuery();

            return orderInfoEntity;
        }
        /// <summary>
        /// 订单详情页  离店状态 获取房间号
        /// </summary>
        /// <param name="orderInfoEntity"></param>
        /// <returns></returns>
        public static OrderInfoEntity GetRoomNumber(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            DataCommand cmd = DataCommandManager.GetDataCommand("GetRoomNumber");
            cmd.SetParameterValue("@FOGID", dbParm.EventType);
            orderInfoEntity.QueryResult = cmd.ExecuteDataSet();

            return orderInfoEntity;
        }
        /// <summary>
        /// 退款列表
        /// </summary>
        /// <param name="orderInfoEntity"></param>
        /// <returns></returns>
        public static OrderInfoEntity GetRefundOrderList(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            OracleParameter[] lmparm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("SALES",OracleType.VarChar),
                                    new OracleParameter("FOGORDERNUM",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("PAYSTATUS",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.HOTEL_ID))
            {
                lmparm[0].Value = DBNull.Value;
            }
            else
            {
                lmparm[0].Value = dbParm.HOTEL_ID;
            }

            if (String.IsNullOrEmpty(dbParm.UserID))
            {
                lmparm[1].Value = DBNull.Value;
            }
            else
            {
                lmparm[1].Value = dbParm.UserID;
            }

            if (String.IsNullOrEmpty(dbParm.FOG_ORDER_NUM))
            {
                lmparm[2].Value = DBNull.Value;
            }
            else
            {
                lmparm[2].Value = dbParm.FOG_ORDER_NUM;
            }

            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                lmparm[3].Value = DBNull.Value;
            }
            else
            {
                lmparm[3].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                lmparm[4].Value = DBNull.Value;
            }
            else
            {
                lmparm[4].Value = dbParm.EndDate;
            }

            if (String.IsNullOrEmpty(dbParm.PAY_STATUS))
            {
                lmparm[5].Value = DBNull.Value;
            }
            else
            {
                lmparm[5].Value = dbParm.PAY_STATUS;
            }
            orderInfoEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_order_by_order_refund", true, lmparm);
            return orderInfoEntity;
        }
        public static OrderInfoEntity GetOrderListNum(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            DataCommand cmd = DataCommandManager.GetDataCommand("GetOrderListNum");
            cmd.SetParameterValue("@EVENTTYPE", dbParm.EventType);
            cmd.SetParameterValue("@StartDate", dbParm.StartDate);
            cmd.SetParameterValue("@EndDate", dbParm.EndDate);
            orderInfoEntity.QueryResult = cmd.ExecuteDataSet();

            return orderInfoEntity;
        }
    private void ResetOrderConfirmListGrid()
    {
        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
        orderinfoEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
        orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
        orderinfoEntity.OrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        DataSet dsResult = OrderInfoBP.BindOrderApproveList(_orderInfoEntity).QueryResult;

        if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
        {
            dvGridMessage.InnerHtml = "无审核订单";
        }
        else
        {
            dvGridMessage.InnerHtml = "";
        }
        gridViewCSList.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");

        gridViewCSList.DataSource = dsResult.Tables[0].DefaultView;
        gridViewCSList.DataKeyNames = new string[] { "ORDERID" };//主键
        gridViewCSList.DataBind();
    }
        public static OrderInfoEntity BindOrderList(OrderInfoEntity orderEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("HOTEL_ID",OracleType.VarChar),
                                    new OracleParameter("HOTEL_NAME",OracleType.VarChar),
                                    new OracleParameter("CITY_ID",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("BOOK_STATUS",OracleType.VarChar),
                                    new OracleParameter("PAY_STATUS",OracleType.VarChar),
                                    new OracleParameter("FOG_ORDER_NUM",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            if (String.IsNullOrEmpty(dbParm.HOTEL_ID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.HOTEL_ID;
            }

            if (String.IsNullOrEmpty(dbParm.HOTEL_NAME))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.HOTEL_NAME;
            }

            if (String.IsNullOrEmpty(dbParm.CITY_ID))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.CITY_ID;
            }

            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.EndDate;
            }

            if (String.IsNullOrEmpty(dbParm.BOOK_STATUS))
            {
                parm[5].Value = DBNull.Value;
            }
            else
            {
                parm[5].Value = dbParm.BOOK_STATUS;
            }

            if (String.IsNullOrEmpty(dbParm.PAY_STATUS))
            {
                parm[6].Value = DBNull.Value;
            }
            else
            {
                parm[6].Value = dbParm.PAY_STATUS;
            }

            if (String.IsNullOrEmpty(dbParm.FOG_ORDER_NUM))
            {
                parm[7].Value = DBNull.Value;
            }
            else
            {
                parm[7].Value = dbParm.FOG_ORDER_NUM;
            }

            orderEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_orderinfo_select", true, parm);
            return orderEntity;
        }
        public static OrderInfoEntity ChkOrderLock(OrderInfoEntity orderEntity)
        {
            //OracleParameter[] parm ={
            //                        new OracleParameter("ORDERID",OracleType.VarChar)
            //                    };

            //OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();
            //if (String.IsNullOrEmpty(dbParm.OrderID))
            //{
            //    parm[0].Value = DBNull.Value;
            //}
            //else
            //{
            //    parm[0].Value = dbParm.OrderID;
            //}

            //orderEntity.QueryResult = DbManager.Query("OrderInfo", "t_lm_orderappromginfo_chkOrderLock", false, parm);
            //return orderEntity;

            OracleParameter[] parm ={
                                    new OracleParameter("ORDERID",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();
            if (String.IsNullOrEmpty(dbParm.OrderID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.OrderID;
            }

            DataSet dsResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_order_operation_check", true, parm);

            if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
            {
                if ("2".Equals(dsResult.Tables[0].Rows[0]["status"].ToString().Trim()) && !orderEntity.LogMessages.Userid.Equals(dsResult.Tables[0].Rows[0]["ope_user"].ToString().Trim()))
                {
                    orderEntity.Result = 1;
                }
                else
                {
                    orderEntity.Result = 0;
                }
            }
            else
            {
                orderEntity.Result = 0;
            }
            return orderEntity;
        }
        public static OrderInfoEntity OrderOperateStatus(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            OracleParameter[] lmparm ={
                                    new OracleParameter("FOGORDERNUM",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.FOG_ORDER_NUM))
            {
                lmparm[0].Value = DBNull.Value;
            }
            else
            {
                lmparm[0].Value = dbParm.FOG_ORDER_NUM;
            }

            orderInfoEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_order_by_operatestatus", true, lmparm);
            return orderInfoEntity;
        }
        public static OrderInfoEntity GetApprovedUserListByCheck(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            DataCommand cmd = DataCommandManager.GetDataCommand("GetApprovedUserListByCheck");
            cmd.SetParameterValue("@EVENTTYPE", dbParm.EventType);
            if (string.IsNullOrEmpty(dbParm.CONTACT_NAME))
            {
                cmd.SetParameterValue("@EVENTUSER", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@EVENTUSER", dbParm.CONTACT_NAME);
            }
            cmd.SetParameterValue("@StartDate", dbParm.StartDate);
            cmd.SetParameterValue("@EndDate", dbParm.EndDate);
            orderInfoEntity.QueryResult = cmd.ExecuteDataSet();

            return orderInfoEntity;
        }
        public static OrderInfoEntity UnLockOrderConfirm(OrderInfoEntity orderInfoEntity)
        {
            OrderInfoDBEntity dbParm = (orderInfoEntity.OrderInfoDBEntity.Count > 0) ? orderInfoEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            OracleParameter[] lmparm ={
                                    new OracleParameter("ORDERID",OracleType.VarChar),
                                    new OracleParameter("OPEUSER",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.OrderID))
            {
                lmparm[0].Value = DBNull.Value;
            }
            else
            {
                lmparm[0].Value = dbParm.OrderID;
            }

            lmparm[1].Value = orderInfoEntity.LogMessages.Userid;

            orderInfoEntity.Result = HotelVp.Common.DBUtility.DbManager.ExecuteSql("OrderInfo", "t_lm_order_cof_unlock", lmparm);
            return orderInfoEntity;
        }
    private bool ChkOrderLock(string strHotelID)
    {
        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
        orderinfoEntity.OrderID = hidOrderID.Value;
        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        int iResult = OrderInfoBP.ChkOrderLock(_orderInfoEntity).Result;

        if (iResult == 1)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
        public static OrderInfoEntity BindOrderApproveFaxList(OrderInfoEntity orderEntity)
        {
            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();
            DataSet dsResult = new DataSet();
            if ("1".Equals(dbParm.SqlType))
            {
                OracleParameter[] parm ={
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("FaxNum",OracleType.VarChar)
                                };

                if (String.IsNullOrEmpty(dbParm.OrderID))
                {
                    parm[0].Value = DBNull.Value;
                }
                else
                {
                    parm[0].Value = dbParm.OrderID;
                }

                if (String.IsNullOrEmpty(dbParm.FaxNum))
                {
                    parm[1].Value = DBNull.Value;
                }
                else
                {
                    parm[1].Value = dbParm.FaxNum;
                }

                string SQLString = HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderappromginfo_fax_select_order");
                SQLString = SQLString + "order by t.fog_order_num " + dbParm.SortID + ", t.hotel_name";

                dsResult = DbHelperOra.Query(SQLString, false, parm);
            }
            else if ("2".Equals(dbParm.SqlType))
            {
                OracleParameter[] parm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("OutSDate",OracleType.VarChar),
                                    new OracleParameter("OutEDate",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("AuditStatus",OracleType.VarChar),
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("TRADEAREAID",OracleType.VarChar),
                                    new OracleParameter("FaxNum",OracleType.VarChar)
                                };

                if (String.IsNullOrEmpty(dbParm.HotelID))
                {
                    parm[0].Value = DBNull.Value;
                }
                else
                {
                    parm[0].Value = dbParm.HotelID;
                }

                if (String.IsNullOrEmpty(dbParm.StartDate))
                {
                    parm[1].Value = DBNull.Value;
                }
                else
                {
                    parm[1].Value = dbParm.StartDate;
                }

                if (String.IsNullOrEmpty(dbParm.EndDate))
                {
                    parm[2].Value = DBNull.Value;
                }
                else
                {
                    parm[2].Value = dbParm.EndDate;
                }

                if (String.IsNullOrEmpty(dbParm.OrderID))
                {
                    parm[3].Value = DBNull.Value;
                }
                else
                {
                    parm[3].Value = dbParm.OrderID;
                }

                if (String.IsNullOrEmpty(dbParm.AuditStatus))
                {
                    parm[4].Value = DBNull.Value;
                }
                else
                {
                    parm[4].Value = dbParm.AuditStatus;
                }

                if (String.IsNullOrEmpty(dbParm.City))
                {
                    parm[5].Value = DBNull.Value;
                }
                else
                {
                    parm[5].Value = dbParm.City;
                }

                if (String.IsNullOrEmpty(dbParm.Bussiness))
                {
                    parm[6].Value = DBNull.Value;
                }
                else
                {
                    parm[6].Value = dbParm.Bussiness;
                }

                if (String.IsNullOrEmpty(dbParm.FaxNum))
                {
                    parm[7].Value = DBNull.Value;
                }
                else
                {
                    parm[7].Value = dbParm.FaxNum;
                }

                string SQLString = HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderappromginfo_fax_select_hotel");
                SQLString = SQLString + "order by t.fog_order_num " + dbParm.SortID + ", t.hotel_name";

                dsResult = DbHelperOra.Query(SQLString, false, parm);
            }
            else
            {
                OracleParameter[] parm ={
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("OutSDate",OracleType.VarChar),
                                    new OracleParameter("OutEDate",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("AuditStatus",OracleType.VarChar)
                                };
                if (String.IsNullOrEmpty(dbParm.HotelID))
                {
                    parm[0].Value = DBNull.Value;
                }
                else
                {
                    parm[0].Value = dbParm.HotelID;
                }

                if (String.IsNullOrEmpty(dbParm.StartDate))
                {
                    parm[1].Value = DBNull.Value;
                }
                else
                {
                    parm[1].Value = dbParm.StartDate;
                }

                if (String.IsNullOrEmpty(dbParm.EndDate))
                {
                    parm[2].Value = DBNull.Value;
                }
                else
                {
                    parm[2].Value = dbParm.EndDate;
                }

                if (String.IsNullOrEmpty(dbParm.OrderID))
                {
                    parm[3].Value = DBNull.Value;
                }
                else
                {
                    parm[3].Value = dbParm.OrderID;
                }

                if (String.IsNullOrEmpty(dbParm.AuditStatus))
                {
                    parm[4].Value = DBNull.Value;
                }
                else
                {
                    parm[4].Value = dbParm.AuditStatus;
                }
                string SQLString = HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderappromginfo_fax_select");
                SQLString = SQLString + "order by t.fog_order_num " + dbParm.SortID + ", t.hotel_name";

                dsResult = DbHelperOra.Query(SQLString, false, parm);
            }

            #region 过滤复审
            if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
            {
                string LDStatus = string.Empty;
                string NSStatus = string.Empty;
                string LDdbAppr = string.Empty;
                string NSdbAppr = string.Empty;
                string ADStatsBack = (String.IsNullOrEmpty(dbParm.ADStatsBack)) ? "" : dbParm.ADStatsBack;

                if (ADStatsBack.Contains("1") || ADStatsBack.Contains("3"))
                {
                    LDStatus = "离店";
                }

                if (ADStatsBack.Contains("2") || ADStatsBack.Contains("4"))
                {
                    NSStatus = "No-Show";
                }

                if (ADStatsBack.Contains("1"))
                {
                    LDdbAppr = "0";
                }
                else if (ADStatsBack.Contains("3"))
                {
                    LDdbAppr = "1";
                }

                if (ADStatsBack.Contains("2"))
                {
                    NSdbAppr = "0";
                }
                else if (ADStatsBack.Contains("4"))
                {
                    NSdbAppr = "1";
                }
                DataSet dsOrders = new DataSet();
                for (int i = dsResult.Tables[0].Rows.Count - 1; i >= 0; i--)
                {
                    if ("未审核".Equals(dsResult.Tables[0].Rows[i]["ORDERST"].ToString()))
                    {
                        if (!String.IsNullOrEmpty(dsResult.Tables[0].Rows[i]["HVPNM"].ToString()))
                        {
                            dsResult.Tables[0].Rows[i]["HVPNM"] = GetSalesNUm(dsResult.Tables[0].Rows[i]["HVPNM"].ToString());
                        }
                        continue;
                    }

                    if (!String.IsNullOrEmpty(ADStatsBack))
                    {
                        DataCommand cmd = DataCommandManager.GetDataCommand("ChkApproveOrderList");
                        cmd.SetParameterValue("@ORDERID", dsResult.Tables[0].Rows[i]["ORDERID"].ToString());
                        dsOrders = cmd.ExecuteDataSet();

                        if (dsOrders.Tables.Count == 0 || dsOrders.Tables[0].Rows.Count == 0)
                        {
                            dsResult.Tables[0].Rows.RemoveAt(i);
                            continue;
                        }
                        else
                        {
                            if ("离店".Equals(dsOrders.Tables[0].Rows[0]["OD_STATUS"].ToString()))
                            {
                                if (!(!String.IsNullOrEmpty(LDStatus) && LDdbAppr.Equals(dsOrders.Tables[0].Rows[0]["ISDBAPPROVE"].ToString())))
                                {
                                    dsResult.Tables[0].Rows.RemoveAt(i);
                                    continue;
                                }
                            }
                            else if ("No-Show".Equals(dsOrders.Tables[0].Rows[0]["OD_STATUS"].ToString()))
                            {
                                if (!(!String.IsNullOrEmpty(NSStatus) && NSdbAppr.Equals(dsOrders.Tables[0].Rows[0]["ISDBAPPROVE"].ToString())))
                                {
                                    dsResult.Tables[0].Rows.RemoveAt(i);
                                    continue;
                                }
                            }
                            else
                            {
                                dsResult.Tables[0].Rows.RemoveAt(i);
                                continue;
                            }
                        }
                    }

                    if (!String.IsNullOrEmpty(dsResult.Tables[0].Rows[i]["HVPNM"].ToString()))
                    {
                        dsResult.Tables[0].Rows[i]["HVPNM"] = GetSalesNUm(dsResult.Tables[0].Rows[i]["HVPNM"].ToString());
                    }
                }
            }
            #endregion

            orderEntity.QueryResult = dsResult;
            return orderEntity;
        }
        public static LmSystemLogEntity SaveConfirmOrderList(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveConfirmOrderList";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (!LmSystemLogDA.ChkOrderOperationLock(lmSystemLogEntity))
                {
                    lmSystemLogEntity.Result = 2;
                    lmSystemLogEntity.ErrorMSG = "保存失败。订单:" + lmSystemLogEntity.FogOrderID + "已被其他人锁定,请稍后再试!";
                    return lmSystemLogEntity;
                }

                string[] ODList = lmSystemLogEntity.OrderList.TrimEnd(',').Split(',');
                string[] ODDetail;
                string strOdStatus = string.Empty;
                LmSystemLogEntity lmEntity = new LmSystemLogEntity();
                lmEntity.LogMessages = new LogMessage();
                lmEntity.LogMessages = lmSystemLogEntity.LogMessages;
                string strResult = string.Empty;
                string allMSG = string.Empty;
                int iCount = ODList.Length;
                foreach (string tempOD in ODList)
                {
                    strResult = "";
                    ODDetail = tempOD.Split('_');
                    lmEntity.FogOrderID = ODDetail[0].Trim();
                    if (!LmSystemLogDA.ChkOrderOperationLock(lmEntity))
                    {
                        lmSystemLogEntity.ErrorMSG += lmEntity.FogOrderID + ",";
                        iCount = iCount - 1;
                        continue;
                    }

                    if (!"2".Equals(ODDetail[1].Trim()))
                    {
                        lmEntity.OrderBookStatus = ("1".Equals(ODDetail[1].Trim())) ? "6" : "7";//CC确认  CC取消
                        lmEntity.OrderBookStatusOther = ("1".Equals(ODDetail[1].Trim())) ? "4" : "9";
                        lmEntity.CanelReson = ("0".Equals(ODDetail[1].Trim())) ? ODDetail[2].Trim() : "";
                        lmEntity.BookRemark = ODDetail[3].Trim();
                        lmEntity.FollowUp = ("true".Equals(ODDetail[4].Trim())) ? "1" : "0";
                        lmEntity.ActionID = ("1".Equals(ODDetail[1].Trim())) ? ODDetail[2].Trim() : "";
                        strResult = LmSystemLogBP.SaveOrderListInterFace(lmEntity);
                        allMSG += strResult;
                        iCount = (String.IsNullOrEmpty(strResult)) ? iCount : iCount - 1;
                    }

                    if (String.IsNullOrEmpty(strResult.Trim()))
                    {
                        if ("1".Equals(ODDetail[1].Trim()))
                        {
                            strOdStatus = "可入住";
                        }
                        else if ("0".Equals(ODDetail[1].Trim()))
                        {
                            strOdStatus = "CC取消";
                        }
                        else if ("2".Equals(ODDetail[1].Trim()))
                        {
                            strOdStatus = "备注";
                        }

                        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
                        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
                        _orderInfoEntity.LogMessages = lmSystemLogEntity.LogMessages;
                        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
                        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
                        orderinfoEntity.EventType = "订单确认";
                        orderinfoEntity.ORDER_NUM = ODDetail[0].Trim();
                        orderinfoEntity.OdStatus = strOdStatus;
                        orderinfoEntity.REMARK = (!"2".Equals(ODDetail[1].Trim())) ? ODDetail[3].Trim() : ODDetail[2].Trim();
                        orderinfoEntity.ActionID = ("1".Equals(ODDetail[1].Trim())) ? ODDetail[2].Trim() : "";
                        orderinfoEntity.CANNEL = ("0".Equals(ODDetail[1].Trim())) ? ODDetail[2].Trim() : "";
                        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
                        CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);
                    }
                }

                if (!String.IsNullOrEmpty(lmSystemLogEntity.ErrorMSG) || !String.IsNullOrEmpty(allMSG.Trim()))
                {
                    lmSystemLogEntity.Result = 3;
                    lmSystemLogEntity.ErrorMSG = ((iCount > 0) ? "其他订单保存成功。" : "保存失败。") + allMSG.Trim() + ((!String.IsNullOrEmpty(lmSystemLogEntity.ErrorMSG)) ? ("订单:" + lmSystemLogEntity.ErrorMSG.TrimEnd(',') + " 被其他人锁定,请稍后再试!") : "");
                }
                else
                {
                    lmSystemLogEntity.Result = 1;
                }
                return lmSystemLogEntity;
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveConfirmOrderList  Error: " + ex.Message + lmSystemLogEntity.OrderList;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static OrderInfoEntity BindOrderApproveFaxPrint(OrderInfoEntity orderEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("OrderList",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.HotelID;
            }

            ArrayList alList = new ArrayList();
            alList = dbParm.OrderList;
            string strList = "";
            foreach (string strSN in alList)
            {
                strList = strList + strSN + ",";
            }
            if (alList.Count == 0)
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = strList;
            }

            DataSet dsResult = DbManager.Query("OrderInfo", "t_lm_orderappromginfo_fax_print_select", false, parm);
            dsResult.Tables[0].TableName = "PRINT";

            OracleParameter[] htparm ={
                                    new OracleParameter("HotelID",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                htparm[0].Value = DBNull.Value;
            }
            else
            {
                htparm[0].Value = dbParm.HotelID;
            }

            DataTable dtHotelEx = new DataTable();
            dtHotelEx = DbManager.Query("OrderInfo", "t_lm_hotelex_print_select", false, htparm).Tables[0].Copy();
            dtHotelEx.TableName = "HLEX";

            DataTable dtUsersInfo = new DataTable();
            DataCommand cmd = DataCommandManager.GetDataCommand("GetCmsSysUsersInfo");
            cmd.SetParameterValue("@UserAccount", orderEntity.LogMessages.Userid);
            dtUsersInfo = cmd.ExecuteDataSet().Tables[0].Copy();
            dtUsersInfo.TableName = "UsersInfo";

            dsResult.Tables.Add(dtHotelEx);
            dsResult.Tables.Add(dtUsersInfo);
            orderEntity.QueryResult = dsResult;
            return orderEntity;
        }
    protected void btnSet_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";
        if (String.IsNullOrEmpty(hidOrderID.Value.Trim()))
        {
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorMessage").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorMessage").ToString();
            return;
        }

        if (!String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()) && (StringUtility.Text_Length(txtBOOK_REMARK.Text.ToString().Trim()) > 250))
        {
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorRemark").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorRemark").ToString();
            return;
        }

        _lmSystemLogEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _lmSystemLogEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _lmSystemLogEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _lmSystemLogEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _lmSystemLogEntity.FogOrderID = hidOrderID.Value;
        _lmSystemLogEntity.OrderBookStatus = ddpOrderStatus.SelectedValue.Trim();
        _lmSystemLogEntity.CanelReson = ddpCanelReson.SelectedValue.Trim();
        _lmSystemLogEntity.BookRemark = txtBOOK_REMARK.Text.Trim();
        _lmSystemLogEntity.FollowUp = (chkFollowUp.Checked) ? "1" : "0";

        int iResult = LmSystemLogBP.SaveOrderOperation(_lmSystemLogEntity);

        _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "订单操作-保存";
        commonDBEntity.Event_ID = hidHotelID.Value + "-" + _lmSystemLogEntity.FogOrderID;
        string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

        conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.OrderBookStatus, _lmSystemLogEntity.BookRemark, _lmSystemLogEntity.CanelReson, _lmSystemLogEntity.FollowUp);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateLockErr").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateLockErr").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateLockErr").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
        orderinfoEntity.EventType = "订单确认";
        orderinfoEntity.ORDER_NUM = hidOrderID.Value;
        orderinfoEntity.OdStatus = SetActionTypeVal(ddpOrderStatus.SelectedValue.Trim());
        orderinfoEntity.REMARK = txtBOOK_REMARK.Text.Trim();
        orderinfoEntity.ActionID = "";
        orderinfoEntity.CANNEL = ("9".Equals(ddpOrderStatus.SelectedValue.Trim())) ? ddpCanelReson.SelectedValue.Trim() : "";
        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);

        lbMemo1.Text = SetMemoVal(_lmSystemLogEntity.FogOrderID);
        RestControlVal();
    }
        public static OrderInfoEntity BindOrderApprovePrint(OrderInfoEntity orderEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("AuditStatus",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.HotelID;
            }
            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.EndDate;
            }

            if (String.IsNullOrEmpty(dbParm.OrderID))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.OrderID;
            }

            if (String.IsNullOrEmpty(dbParm.AuditStatus))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.AuditStatus;
            }

            DataSet dsResult = DbManager.Query("OrderInfo", "t_lm_orderappromginfo_print_select", false, parm);
            dsResult.Tables[0].TableName = "PRINT";

            OracleParameter[] htparm ={
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("AuditStatus",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                htparm[0].Value = DBNull.Value;
            }
            else
            {
                htparm[0].Value = dbParm.HotelID;
            }

            DataTable dtHotelEx = new DataTable();
            dtHotelEx = DbManager.Query("OrderInfo", "t_lm_hotelex_print_select", false, htparm).Tables[0].Copy();
            dtHotelEx.TableName = "HLEX";

            DataTable dtUsersInfo = new DataTable();
            DataCommand cmd = DataCommandManager.GetDataCommand("GetCmsSysUsersInfo");
            cmd.SetParameterValue("@UserAccount", orderEntity.LogMessages.Userid);
            dtUsersInfo = cmd.ExecuteDataSet().Tables[0].Copy();
            dtUsersInfo.TableName = "UsersInfo";

            dsResult.Tables.Add(dtHotelEx);
            dsResult.Tables.Add(dtUsersInfo);
            orderEntity.QueryResult = dsResult;
            return orderEntity;
        }
    private void BindOrderConfirmListGrid()
    {
        messageContent.InnerHtml = "";
        OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
        _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
        OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
        orderinfoEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        string strOrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        string strfaxNum = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxNum"].ToString())) ? null : ViewState["FaxNum"].ToString();

        if (!String.IsNullOrEmpty(strOrderID) || !String.IsNullOrEmpty(strfaxNum))
        {
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.FaxNum = strfaxNum;
            orderinfoEntity.SqlType = "1";
        }
        else if (!String.IsNullOrEmpty(hidSelectCity.Value) || !String.IsNullOrEmpty(hidSelectHotel.Value) || !String.IsNullOrEmpty(hidSelectBussiness.Value))
        {
            orderinfoEntity.City = hidSelectCity.Value == "" ? "" : hidSelectCity.Value.Substring((hidSelectCity.Value.IndexOf('[') + 1), (hidSelectCity.Value.IndexOf(']') - 1)); //"";//城市ID
            //orderinfoEntity.HotelID = hidSelectHotel.Value == "" ? "" : hidSelectHotel.Value.Substring((hidSelectHotel.Value.IndexOf('[') + 1), (hidSelectHotel.Value.IndexOf(']') - 1));//"";//酒店ID
            orderinfoEntity.Bussiness = hidSelectBussiness.Value == "" ? "" : hidSelectBussiness.Value.Substring((hidSelectBussiness.Value.IndexOf('[') + 1), (hidSelectBussiness.Value.IndexOf(']') - 1));//"";//商圈ID
            orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
            orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
            orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();
            orderinfoEntity.FaxNum = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxNum"].ToString())) ? null : ViewState["FaxNum"].ToString();
            //orderinfoEntity.FaxStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxStatus"].ToString())) ? null : ViewState["FaxStatus"].ToString();
            orderinfoEntity.SqlType = "2";
        }
        else
        {
            orderinfoEntity.OrderID = strOrderID;
            orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
            orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
            orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
            orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();
            //orderinfoEntity.FaxStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["FaxStatus"].ToString())) ? null : ViewState["FaxStatus"].ToString();
            orderinfoEntity.SqlType = "3";
        }

        //orderinfoEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        //orderinfoEntity.StartDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStartDate"].ToString())) ? null : ViewState["OutStartDate"].ToString();
        //orderinfoEntity.EndDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEndDate"].ToString())) ? null : ViewState["OutEndDate"].ToString();
        //orderinfoEntity.OrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        //orderinfoEntity.AuditStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["AuditStatus"].ToString())) ? null : ViewState["AuditStatus"].ToString();
        //orderinfoEntity.ADStatsBack = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["ADStatsBack"].ToString())) ? null : ViewState["ADStatsBack"].ToString();

        _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
        DataSet dsResult = OrderInfoBP.BindOrderApproveFaxList(_orderInfoEntity).QueryResult;

        gridViewCSList.DataSource = dsResult.Tables[0].DefaultView;
        gridViewCSList.DataKeyNames = new string[] { "ORDERID" };//主键
        gridViewCSList.DataBind();

        if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
        {
            dvGridMessage.InnerHtml = "无审核订单";
        }
        else
        {
            dvGridMessage.InnerHtml = "";
        }
        gridViewCSList.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");

        GetBasicOrderAprInfo(orderinfoEntity.HotelID);
        ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyalert", "BtnCompleteStyle();", true);
        //this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
    }
        public static OrderInfoEntity BindOrderConfirmList(OrderInfoEntity orderEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("CityID",OracleType.VarChar),
                                    new OracleParameter("CStatus",OracleType.VarChar),
                                    new OracleParameter("FStatus",OracleType.VarChar),
                                    new OracleParameter("HotelConfirm",OracleType.VarChar),
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("UserID",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("FollowUp",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar),
                                    new OracleParameter("FaxSNumber",OracleType.VarChar),
                                    new OracleParameter("FaxENumber",OracleType.VarChar),
                                    new OracleParameter("BStatusOther",OracleType.VarChar),
                                    new OracleParameter("PriceCode",OracleType.VarChar),
                                    new OracleParameter("BStatus",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            if (String.IsNullOrEmpty(dbParm.CityID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.CityID;
            }

            if (String.IsNullOrEmpty(dbParm.CStatus))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = ("3".Equals(dbParm.CStatus)) ? "" : dbParm.CStatus;
            }

            if (String.IsNullOrEmpty(dbParm.FStatus))
            {
                parm[2].Value = DBNull.Value;
                parm[10].Value = DBNull.Value;
                parm[11].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.FStatus;
                parm[10].Value = DBNull.Value;
                parm[11].Value = DBNull.Value;
                //if ("4".Equals(dbParm.FStatus))
                //{
                //    parm[2].Value = "1";
                //    parm[10].Value = "2";
                //    parm[11].Value = DBNull.Value;
                //}
                //else if ("1".Equals(dbParm.FStatus))
                //{
                //    parm[2].Value = dbParm.FStatus;
                //    parm[10].Value = "0";
                //    parm[11].Value = "1";
                //}
                //else
                //{
                //    parm[2].Value = dbParm.FStatus;
                //    parm[10].Value = DBNull.Value;
                //    parm[11].Value = DBNull.Value;
                //}
            }

            if (String.IsNullOrEmpty(dbParm.HotelConfirm))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.HotelConfirm;
            }

            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.HotelID;
            }

            if (String.IsNullOrEmpty(dbParm.UserID))
            {
                parm[5].Value = DBNull.Value;
            }
            else
            {
                parm[5].Value = dbParm.UserID;
            }

            if (String.IsNullOrEmpty(dbParm.OrderID))
            {
                parm[6].Value = DBNull.Value;
            }
            else
            {
                parm[6].Value = dbParm.OrderID;
            }

            if ("3".Equals(dbParm.CStatus))
            {
                parm[7].Value = "1";
            }
            else
            {
                parm[7].Value = DBNull.Value;
            }

            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                parm[8].Value = DBNull.Value;
            }
            else
            {
                parm[8].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                parm[9].Value = DBNull.Value;
            }
            else
            {
                parm[9].Value = dbParm.EndDate;
            }

            if (String.IsNullOrEmpty(dbParm.BOOK_STATUS_OTHER))
            {
                parm[12].Value = DBNull.Value;
            }
            else
            {
                parm[12].Value = dbParm.BOOK_STATUS_OTHER;
            }

            if (String.IsNullOrEmpty(dbParm.PRICE_CODE))
            {
                parm[13].Value = DBNull.Value;
            }
            else
            {
                parm[13].Value = dbParm.PRICE_CODE;
            }

            if (String.IsNullOrEmpty(dbParm.BOOK_STATUS))
            {
                parm[14].Value = DBNull.Value;
            }
            else
            {
                parm[14].Value = dbParm.BOOK_STATUS;
            }

            //string SQLString = ("1".Equals(dbParm.SType)) ? HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderconfirminfo_select_init") : HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderconfirminfo_select");
            string SQLString = ("1".Equals(dbParm.SType)) ? HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderconfirminfo_select_init_all") : HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderconfirminfo_select_all");

            if (String.IsNullOrEmpty(dbParm.SortID))
            {
                SQLString = SQLString + "order by t.price_code asc,t.create_time asc, toc.fax_status asc";
            }
            else
            {
                SQLString = SQLString + "order by t.price_code asc,toc.order_id " + dbParm.SortID;
            }

            orderEntity.QueryResult = DbHelperOra.Query(SQLString, false, parm);//HotelVp.Common.DBUtility.DbManager.Query("OrderInfo", "t_lm_orderconfirminfo_select",true, parm);
            return orderEntity;
        }
    protected void btnAddRemark_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()) && (StringUtility.Text_Length(txtBOOK_REMARK.Text.ToString().Trim()) > 250))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorRemark").ToString();
            ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        if ("8".Equals(hidActionType.Value) && String.IsNullOrEmpty(txtInRoomID.Text.Trim()))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorAction").ToString();
            ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        if (String.IsNullOrEmpty(hidActionType.Value))
        {
            if (String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()))
            {
                detailMessageContent.InnerHtml = GetLocalResourceObject("EmpryRemark").ToString();
                ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "setScript", "invokeOpenList()", true);
                return;
            }

            OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
            _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
            _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
            _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
            _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

            _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
            OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
            orderinfoEntity.EventType = "订单审核";
            orderinfoEntity.ORDER_NUM = hidOrderID.Value;
            orderinfoEntity.OdStatus = SetActionTypeVal(hidActionType.Value);
            orderinfoEntity.REMARK = txtBOOK_REMARK.Text.Trim();
            orderinfoEntity.CANNEL = "";
            orderinfoEntity.ApproveId = "";
            orderinfoEntity.InRoomID = "";
            orderinfoEntity.IsDbApprove = "1";
            _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
            CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);
            messageContent.InnerHtml = GetLocalResourceObject("RemarkSuccess").ToString();
        }
        else
        {
            LmSystemLogEntity _lmSystemLogEntity = new LmSystemLogEntity();
            _lmSystemLogEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
            _lmSystemLogEntity.LogMessages.Userid = UserSession.Current.UserAccount;
            _lmSystemLogEntity.LogMessages.Username = UserSession.Current.UserDspName;
            _lmSystemLogEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
            _lmSystemLogEntity.FogOrderID = hidOrderID.Value;
            _lmSystemLogEntity.OrderBookStatus = hidActionType.Value;
            _lmSystemLogEntity.CanelReson = ddpNoShow.SelectedValue;
            _lmSystemLogEntity.BookRemark = txtBOOK_REMARK.Text.Trim();
            _lmSystemLogEntity.ApproveId = txtActionID.Text.Trim();
            _lmSystemLogEntity.InRoomID = txtInRoomID.Text.Trim();
            _lmSystemLogEntity.IsDbApprove = "1";// (chkDbApprove.Checked) ? "1" : "0";
            _lmSystemLogEntity = LmSystemLogBP.SaveOrderOpeRemarkList(_lmSystemLogEntity);
            int iResult = _lmSystemLogEntity.Result;
            _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
            CommonDBEntity commonDBEntity = new CommonDBEntity();

            commonDBEntity.Event_Type = "订单审核-保存";
            commonDBEntity.Event_ID = hidOrderID.Value;
            string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

            conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.OrderBookStatus, _lmSystemLogEntity.BookRemark, _lmSystemLogEntity.InRoomID, _lmSystemLogEntity.ApproveId, _lmSystemLogEntity.CanelReson);
            commonDBEntity.Event_Content = conTent;

            if (iResult == 1)
            {
                OrderInfoEntity _orderInfoEntity = new OrderInfoEntity();
                _orderInfoEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
                _orderInfoEntity.LogMessages.Userid = UserSession.Current.UserAccount;
                _orderInfoEntity.LogMessages.Username = UserSession.Current.UserDspName;
                _orderInfoEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

                _orderInfoEntity.OrderInfoDBEntity = new List<OrderInfoDBEntity>();
                OrderInfoDBEntity orderinfoEntity = new OrderInfoDBEntity();
                orderinfoEntity.EventType = "订单审核";
                orderinfoEntity.ORDER_NUM = hidOrderID.Value;
                orderinfoEntity.OdStatus = SetActionTypeVal(hidActionType.Value);
                orderinfoEntity.REMARK = txtBOOK_REMARK.Text.Trim();
                orderinfoEntity.CANNEL = ("8".Equals(hidActionType.Value)) ? "" : ddpNoShow.SelectedValue;
                orderinfoEntity.ApproveId = ("5".Equals(hidActionType.Value)) ? "" : txtActionID.Text.Trim();
                orderinfoEntity.InRoomID = ("5".Equals(hidActionType.Value)) ? "" : txtInRoomID.Text.Trim();
                orderinfoEntity.IsDbApprove = "1";//(chkDbApprove.Checked) ? "1" : "0";
                _orderInfoEntity.OrderInfoDBEntity.Add(orderinfoEntity);
                CommonBP.InsertOrderActionHistoryList(_orderInfoEntity);

                string strMsg = "";
                if ("5".Equals(hidActionType.Value))
                {
                    strMsg = GetLocalResourceObject("UpdateSuccess12").ToString();
                }
                else if ("8".Equals(hidActionType.Value))
                {
                    strMsg = GetLocalResourceObject("UpdateSuccess11").ToString();
                }

                commonDBEntity.Event_Result = strMsg;
                messageContent.InnerHtml = strMsg;
                ResetOrderConfirmListGrid();
            }
            else if (iResult == 0)
            {
                commonDBEntity.Event_Result = GetLocalResourceObject("WarningMessage").ToString();
                detailMessageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            }
            else if (iResult == 2)
            {
                commonDBEntity.Event_Result = _lmSystemLogEntity.ErrorMSG;
                detailMessageContent.InnerHtml = _lmSystemLogEntity.ErrorMSG;
                ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "setScript", "invokeOpenList()", true);
                return;
            }
            else
            {
                commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
                messageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
            }
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }

        gridHotelList.SelectedIndex = int.Parse(this.HidSelIndex.Value);
        string PROP = gridHotelList.DataKeys[int.Parse(this.HidSelIndex.Value)].Values[0].ToString();

        int UADCUN = 0;
        int ADCUN = 0;
        int BCUN = 0;
        for (int i = 0; i < gridHotelList.Rows.Count; i++)
        {
            //首先判断是否是数据行
            if (gridHotelList.Rows[i].RowType == DataControlRowType.DataRow)
            {
                UADCUN = (String.IsNullOrEmpty(gridHotelList.DataKeys[i].Values[4].ToString())) ? 0 : int.Parse(gridHotelList.DataKeys[i].Values[4].ToString());
                ADCUN = (String.IsNullOrEmpty(gridHotelList.DataKeys[i].Values[5].ToString())) ? 0 : int.Parse(gridHotelList.DataKeys[i].Values[5].ToString());
                BCUN = (String.IsNullOrEmpty(gridHotelList.DataKeys[i].Values[6].ToString())) ? 0 : int.Parse(gridHotelList.DataKeys[i].Values[6].ToString());

                if (UADCUN == ADCUN)
                {
                    gridHotelList.Rows[i].BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C");
                }
                else if (BCUN > 0)
                {
                    gridHotelList.Rows[i].BackColor = System.Drawing.ColorTranslator.FromHtml("#94FB92");
                }
                gridHotelList.Rows[i].Attributes.Add("onMouseOver", "t=this.style.backgroundColor;this.style.backgroundColor='#ebebce';");
                gridHotelList.Rows[i].Attributes.Add("onMouseOut", "this.style.backgroundColor=t;");
            }
        }

        gridHotelList.Rows[gridHotelList.SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#FFCC66");

        ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "setScript", "invokeCloseList()", true);
    }
        public static OrderInfoEntity BindOrderConfirmManagerList(OrderInfoEntity orderEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("CityID",OracleType.VarChar),
                                    new OracleParameter("FGStatus",OracleType.VarChar),
                                    new OracleParameter("HotelID",OracleType.VarChar),
                                    new OracleParameter("UserID",OracleType.VarChar),
                                    new OracleParameter("OrderID",OracleType.VarChar),
                                    new OracleParameter("StartDate",OracleType.VarChar),
                                    new OracleParameter("EndDate",OracleType.VarChar)
                                };

            OrderInfoDBEntity dbParm = (orderEntity.OrderInfoDBEntity.Count > 0) ? orderEntity.OrderInfoDBEntity[0] : new OrderInfoDBEntity();

            if (String.IsNullOrEmpty(dbParm.CityID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.CityID;
            }

            if (String.IsNullOrEmpty(dbParm.FGStatus))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.FGStatus;
            }

            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.HotelID;
            }

            if (String.IsNullOrEmpty(dbParm.UserID))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.UserID;
            }

            if (String.IsNullOrEmpty(dbParm.OrderID))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.OrderID;
            }

            if (String.IsNullOrEmpty(dbParm.StartDate))
            {
                parm[5].Value = DBNull.Value;
            }
            else
            {
                parm[5].Value = dbParm.StartDate;
            }

            if (String.IsNullOrEmpty(dbParm.EndDate))
            {
                parm[6].Value = DBNull.Value;
            }
            else
            {
                parm[6].Value = dbParm.EndDate;
            }

            string SQLString = HotelVp.Common.DBUtility.XmlSqlAnalyze.GotSqlTextFromXml("OrderInfo", "t_lm_orderconfirmmginfo_select");
            SQLString = SQLString + "order by t.fog_order_num " + dbParm.SortID + ", t.hotel_name";

            DataSet dsResult = DbHelperOra.Query(SQLString, false, parm);

            if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dsResult.Tables[0].Rows.Count; i++)
                {
                    if (!String.IsNullOrEmpty(dsResult.Tables[0].Rows[i]["HVPNM"].ToString()))
                    {
                        dsResult.Tables[0].Rows[i]["HVPNM"] = GetSalesNUm(dsResult.Tables[0].Rows[i]["HVPNM"].ToString());
                    }
                }
            }

            orderEntity.QueryResult = dsResult;
            return orderEntity;
        }