public static LmSystemLogEntity OrderConfirmSendMsgToLMSales(LmSystemLogEntity dbParm, string strHotelID, string strSendMSG)
        {
            DataSet dsSales = LmSystemLogDA.GetSalesLMHotelInfo(strHotelID);

            if (dsSales.Tables.Count == 0 || dsSales.Tables[0].Rows.Count == 0 || String.IsNullOrEmpty(dsSales.Tables[0].Rows[0]["User_Tel"].ToString()))
            {
                return dbParm;
            }

            string DataString = "";
            DataString = DataString + "{\"method\":\"save\",\"data\":{\"syscode\":\"" + "CMS" + "\",\"reqid\":\"" + dsSales.Tables[0].Rows[0]["User_Tel"].ToString() + "\",\"bizcode\":\"" + "CMS-订单确认短信通知" + "\",";
            DataString = DataString + "\"cnfnum\":\"" + dbParm.FogOrderID + "\",\"mobiles\":\"" + dsSales.Tables[0].Rows[0]["User_Tel"].ToString() + "\",\"msg\":\"" + strSendMSG + "\",";
            DataString = DataString + "\"sign\":\"" + PostSignKey("CMS" + dsSales.Tables[0].Rows[0]["User_Tel"].ToString()) + "\"},\"version\":\"v1.0\"}";

            string HotelFullRoomUrl = JsonRequestURLBuilder.applySendMsgV2();
            CallWebPage callWebPage = new CallWebPage();
            string strHotelFullRoom = callWebPage.CallWebByURL(HotelFullRoomUrl, DataString);
            JObject oHotelFullRoom = JObject.Parse(strHotelFullRoom);
            if ("success".Equals(JsonRequestURLBuilder.GetJsonStringValue(oHotelFullRoom, "message").Trim('"')))
            {
                dbParm.Result = 1;
                dbParm.ErrorMSG = "发送成功!";
            }
            else
            {
                dbParm.Result = 2;
                dbParm.ErrorMSG = "发送失败!" + JsonRequestURLBuilder.GetJsonStringValue(oHotelFullRoom, "message").Trim('"');
            }

            return dbParm;
        }
    //导出Excel文件
    protected void btnExport_Click(object sender, EventArgs e)
    {
        LmSystemLogEntity _lmSystemLogEntity = new LmSystemLogEntity();
        CommonEntity _commonEntity = new CommonEntity();

        _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.EventID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();
        _lmSystemLogEntity.StartDTime = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["StartDTime"].ToString())) ? null : ViewState["StartDTime"].ToString(); ;
        _lmSystemLogEntity.EndDTime = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["EndDTime"].ToString())) ? null : ViewState["EndDTime"].ToString(); ;
        _lmSystemLogEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        _lmSystemLogEntity.CityID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["CityID"].ToString())) ? null : ViewState["CityID"].ToString();
        _lmSystemLogEntity.PayCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PayCode"].ToString())) ? null : ViewState["PayCode"].ToString();
        _lmSystemLogEntity.BookStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["BookStatus"].ToString())) ? null : ViewState["BookStatus"].ToString();
        _lmSystemLogEntity.PayStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PayStatus"].ToString())) ? null : ViewState["PayStatus"].ToString();
        _lmSystemLogEntity.PlatForm = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PlatForm"].ToString())) ? null : ViewState["PlatForm"].ToString();
        _lmSystemLogEntity.Ticket = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Ticket"].ToString())) ? null : ViewState["Ticket"].ToString();
        _lmSystemLogEntity.Mobile = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Mobile"].ToString())) ? null : ViewState["Mobile"].ToString();
        _lmSystemLogEntity.InStart = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["InStart"].ToString())) ? null : ViewState["InStart"].ToString();
        _lmSystemLogEntity.InEnd = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["InEnd"].ToString())) ? null : ViewState["InEnd"].ToString();
        _lmSystemLogEntity.Aprove = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Aprove"].ToString())) ? null : ViewState["Aprove"].ToString();
        DataSet dsResult = LmSystemLogBP.ReviewSelectByNew(_lmSystemLogEntity).QueryResult;
        if (dsResult.Tables.Count == 0 && dsResult.Tables[0].Rows.Count ==0)
        {
            messageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            return;
        }
        CommonFunction.ExportExcelForLM(dsResult);
    }
    public static string SetImagePreviewList(string Hid, string Otsd, string Oted, string Fst, string Oid, string Fnu)
    {
        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.HotelID = Hid;
        _lmSystemLogEntity.OutStart = Otsd;
        _lmSystemLogEntity.OutEnd = Oted;
        _lmSystemLogEntity.FaxStatus = Fst;

        _lmSystemLogEntity.FogOrderID = Oid;
        _lmSystemLogEntity.FaxNum = Fnu;
        string json = "";
        DataSet dsResult = LmSystemLogBP.HotelFaxHis(_lmSystemLogEntity).QueryResult;
        try
        {
            if (dsResult.Tables[0] != null && dsResult.Tables[0].Rows.Count > 0)
            {
                json = ToJson(dsResult.Tables[0]);
            }
            else
            {
                json = "[{\"FAXBDT\":\"\",\"FAXNID\":\"\",\"FAXUNID\":\"\",\"FAXID\":\"\",\"FAXDT\":\"\",\"FAXTST\":\"\",\"FAXBST\":\"\",\"FAXTURL\":\"\",\"FAXBURL\":\"\"}]";
            }
        }
        catch (Exception ex)
        {
            json = "[{\"FAXBDT\":\"\",\"FAXNID\":\"\",\"FAXUNID\":\"\",\"FAXID\":\"\",\"FAXDT\":\"\",\"FAXTST\":\"\",\"FAXBST\":\"\",\"FAXTURL\":\"\",\"FAXBURL\":\"\"}]";
        }

        return json;
    }
 public static string GetHCorderViewList(string orderID, string hotelID, string contTel)
 {
     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 = orderID;
     _lmSystemLogEntity.HotelID = hotelID;
     _lmSystemLogEntity.ContactTel = contTel;
     string json = "";
     DataSet dsResult = LmSystemLogBP.GetHCorderViewList(_lmSystemLogEntity).QueryResult;
     try
     {
         if (dsResult.Tables[0] != null && dsResult.Tables[0].Rows.Count > 0)
         {
             json = ToJson(dsResult.Tables[0]);
         }
         else
         {
             json = "[]";
         }
     }
     catch (Exception ex)
     {
         json = "[]";
     }
     return json;
 }
        public static LmSystemLogEntity ReviewOrderListSelect(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ReviewOrderListSelect";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return OrderSearchDA.ReviewOrderListSelect(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ReviewOrderListSelect  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static LmSystemLogEntity ChkOrderOperationSelect(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ChkOrderOperationSelect";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.ChkOrderOperationSelect(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ChkOrderOperationSelect  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    public static string SetMemoVal(string strKey)
    {
        StringBuilder sbMemo = new StringBuilder();
        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.MemoKey = strKey;

        DataSet dsResult = LmSystemLogBP.GetOrderActionHisList(_lmSystemLogEntity).QueryResult;

        if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                if ("订单确认".Equals(drRow["EVENT_TYPE"].ToString()))
                {
                    if (String.IsNullOrEmpty(drRow["CANNEL"].ToString()) && !"取消单".Equals(drRow["OD_STATUS"].ToString()))
                    {
                        sbMemo.Append(GetMenoHtml(0, drRow));
                    }
                    else
                    {
                        sbMemo.Append(GetMenoHtml(1, drRow));
                    }
                }
                else
                {
                    if (String.IsNullOrEmpty(drRow["CANNEL"].ToString()))
                    {
                        sbMemo.Append(GetMenoHtml(2, drRow));
                    }
                    else
                    {
                        sbMemo.Append(GetMenoHtml(3, drRow));
                    }
                }
            }
        }

        return sbMemo.ToString();
    }
        public static LmSystemLogEntity UserDetailListSelectByNew(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "UserDetailListSelectByNew";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.UserDetailListSelectByNew(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "UserDetailListSelectByNew  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static LmSystemLogEntity SendMsgToLMSales(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SendMsgToLMSales";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return OrderInfoSA.SendMsgToLMSales(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SendMsgToLMSales  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    private DataSet GetOrderInfoData(string orderID)
    {
        LmSystemLogEntity _lmSystemLogEntity = new LmSystemLogEntity();
        CommonEntity _commonEntity = new CommonEntity();
        _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 = orderID;

        return LmSystemLogBP.GetOrderInfoData(_lmSystemLogEntity).QueryResult;
    }
        public static LmSystemLogEntity OrderSurveyDetail(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "OrderSurveyDetail";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.OrderSurveyDetail(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "OrderSurveyDetail  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static string SaveOrderListInterFace(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (!LmSystemLogDA.ChkOrderOperationLock(lmSystemLogEntity))
                {
                    return "订单:" + lmSystemLogEntity.FogOrderID + " 被其他人锁定。请稍后重试!";
                }

                DataSet dsOrderInfo = LmSystemLogDA.GetSaveOrderOpeRemarkList(lmSystemLogEntity.FogOrderID);
                if (LmSystemLogDA.SaveOrderOpeRemarkListConfirm(lmSystemLogEntity, dsOrderInfo) != 1)
                {
                    return "订单:" + lmSystemLogEntity.FogOrderID + " 信息不存在。请确认!";
                }

                //string strMsg = OrderInfoSA.SaveOrderOperationList(lmSystemLogEntity);
                string strMsg = OrderInfoSA.SynOrderOperationList(lmSystemLogEntity);
                if (!String.IsNullOrEmpty(strMsg))
                {
                    return strMsg;// "订单:" + lmSystemLogEntity.FogOrderID + " " + strMsg;
                }

                OrderInfoSA.SaveOrderConfirmPlanMail(lmSystemLogEntity, dsOrderInfo);
                return "";
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static int SaveHotelExRemark(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveHotelExRemark";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (!LmSystemLogDA.ChkHotelExRemark(lmSystemLogEntity))
                {
                    return 2;
                }

                return LmSystemLogDA.SaveHotelExRemark(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveHotelExRemark  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        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 LmSystemLogEntity SaveBindReciveFax(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveBindReciveFax";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if ("0".Equals(lmSystemLogEntity.SendFaxType))
                {
                    DataSet dsBarCode = LmSystemLogDA.CheckBarCode(lmSystemLogEntity);
                    if (dsBarCode.Tables.Count == 0 || dsBarCode.Tables[0].Rows.Count == 0)
                    {
                        lmSystemLogEntity.Result = 2;
                        lmSystemLogEntity.ErrorMSG = "接收传真重新绑定保存失败 - 该二维码编号不存在,请修改!";
                        return lmSystemLogEntity;
                    }
                }
                return OrderInfoSA.SaveBindReciveFax(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveBindReciveFax  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    //导出Excel文件
    protected void btnExport_Click(object sender, EventArgs e)
    {
        LmSystemLogEntity _lmSystemLogEntity = new LmSystemLogEntity();
        CommonEntity _commonEntity = new CommonEntity();

        _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.OutTest = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutTest"].ToString())) ? null : ViewState["OutTest"].ToString();
        _lmSystemLogEntity.RestBookStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["RestBookStatus"].ToString())) ? null : ViewState["RestBookStatus"].ToString();

        _lmSystemLogEntity.StartDTime = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["StartDTime"].ToString())) ? null : ViewState["StartDTime"].ToString();//下单开始时间
        _lmSystemLogEntity.EndDTime = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["EndDTime"].ToString())) ? null : ViewState["EndDTime"].ToString();//下单结束时间
        _lmSystemLogEntity.GroupID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["GroupID"].ToString())) ? null : ViewState["GroupID"].ToString();//集团

        _lmSystemLogEntity.InStart = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["InStart"].ToString())) ? null : ViewState["InStart"].ToString();//入住开始日期
        _lmSystemLogEntity.InEnd = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["InEnd"].ToString())) ? null : ViewState["InEnd"].ToString();//入住结束日期
        _lmSystemLogEntity.CityID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["CityID"].ToString())) ? null : ViewState["CityID"].ToString();  //城市

        _lmSystemLogEntity.TagInfo = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Business"].ToString())) ? null : ViewState["Business"].ToString();//商圈
        _lmSystemLogEntity.OutStart = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutStart"].ToString())) ? null : ViewState["OutStart"].ToString();//离店开始时间
        _lmSystemLogEntity.OutEnd = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OutEnd"].ToString())) ? null : ViewState["OutEnd"].ToString();//离店结束时间

        _lmSystemLogEntity.Sales = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Sales"].ToString())) ? null : ViewState["Sales"].ToString(); //销售
        _lmSystemLogEntity.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();//酒店
        _lmSystemLogEntity.Mobile = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Mobile"].ToString())) ? null : ViewState["Mobile"].ToString();//登录手机

        _lmSystemLogEntity.FogOrderID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderID"].ToString())) ? null : ViewState["OrderID"].ToString();//订单ID
        _lmSystemLogEntity.GuestName = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["GuestName"].ToString())) ? null : ViewState["GuestName"].ToString();//入住人
        _lmSystemLogEntity.CreateStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["BookStatusOtherCreate"].ToString())) ? null : ViewState["BookStatusOtherCreate"].ToString();//创建状态   成功 失败

        _lmSystemLogEntity.UserCancel = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["UserCancel"].ToString())) ? null : ViewState["UserCancel"].ToString();//用户取消   1 是  2 否
        _lmSystemLogEntity.PriceCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PriceCode"].ToString())) ? null : ViewState["PriceCode"].ToString(); //价格代码
        _lmSystemLogEntity.AffirmStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["BookStatusOtherAffirm"].ToString())) ? null : ViewState["BookStatusOtherAffirm"].ToString();//确认状态

        _lmSystemLogEntity.Timeout = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Timeout"].ToString())) ? null : ViewState["Timeout"].ToString();//确认超时   1是  2 否
        _lmSystemLogEntity.Ticket = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Ticket"].ToString())) ? null : ViewState["Ticket"].ToString();//含返现券    1是  2 否
        _lmSystemLogEntity.PlatForm = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PlatForm"].ToString())) ? null : ViewState["PlatForm"].ToString();//订单平台

        _lmSystemLogEntity.OrderChannel = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["OrderChannel"].ToString())) ? null : ViewState["OrderChannel"].ToString();//订单渠道
        _lmSystemLogEntity.Aprove = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Aprove"].ToString())) ? null : ViewState["Aprove"].ToString();//审核状态
        _lmSystemLogEntity.HotelComfirm = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelComfirm"].ToString())) ? null : ViewState["HotelComfirm"].ToString();//酒店是否已确认

        _lmSystemLogEntity.BookStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["BookStatus"].ToString())) ? null : ViewState["BookStatus"].ToString();//LMBAR状态
        _lmSystemLogEntity.PayCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PayCode"].ToString())) ? null : ViewState["PayCode"].ToString();//支付方式
        _lmSystemLogEntity.PayStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["PayStatus"].ToString())) ? null : ViewState["PayStatus"].ToString();//支付状态

        #region  优惠券信息
        _lmSystemLogEntity.RestBookStatus = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["RestBookStatus"].ToString())) ? null : ViewState["RestBookStatus"].ToString();
        _lmSystemLogEntity.RestPriceCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["RestPriceCode"].ToString())) ? null : ViewState["RestPriceCode"].ToString();

        _lmSystemLogEntity.TicketType = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["TicketType"].ToString())) ? null : ViewState["TicketType"].ToString();
        _lmSystemLogEntity.TicketData = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["TicketData"].ToString())) ? null : ViewState["TicketData"].ToString();
        _lmSystemLogEntity.TicketPayCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["TicketPcode"].ToString())) ? null : ViewState["TicketPcode"].ToString();

        _lmSystemLogEntity.PackageName = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["packagename"].ToString())) ? null : ViewState["packagename"].ToString();
        _lmSystemLogEntity.AmountFrom = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["amountfrom"].ToString())) ? null : ViewState["amountfrom"].ToString();
        _lmSystemLogEntity.AmountTo = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["amountto"].ToString())) ? null : ViewState["amountto"].ToString();
        _lmSystemLogEntity.PickfromDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["pickfromdate"].ToString())) ? null : ViewState["pickfromdate"].ToString();
        _lmSystemLogEntity.PicktoDate = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["picktodate"].ToString())) ? null : ViewState["picktodate"].ToString();
        _lmSystemLogEntity.TicketTime = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["tickettime"].ToString())) ? null : ViewState["tickettime"].ToString();
        #endregion

        _lmSystemLogEntity.SortField = gridViewCSReviewLmSystemLogList.Attributes["SortExpression"].ToString();
        _lmSystemLogEntity.SortType = gridViewCSReviewLmSystemLogList.Attributes["SortDirection"].ToString();

        DataSet dsResult = new DataSet();
        if (ViewState["orderXPaymentCode"].ToString() != "" && ViewState["orderXPaymentCode"].ToString() == "QuFen")
        {
            //dsResult = LmSystemLogBP.order_XPayment_ReviewLmOrderLogExport(_lmSystemLogEntity).QueryResult;
        }
        else if (ViewState["orderInTheNight"].ToString() != "" && ViewState["orderInTheNight"].ToString() == "CKIN")
        {
            //dsResult = LmSystemLogBP.order_InTheNight_ReviewLmOrderLogExport(_lmSystemLogEntity).QueryResult;
        }
        else if (ViewState["Rests"].ToString() != "" && ViewState["Rests"].ToString() == "Rests")
        {
            //dsResult = LmSystemLogBP.ExportLmOrderSelectByRests(_lmSystemLogEntity).QueryResult;//其他  排除已存在的渠道
        }
        else
        {
            dsResult = OrderSearchBP.ExportOrderListSelect(_lmSystemLogEntity).QueryResult;
        }

        if (dsResult.Tables.Count == 0 && dsResult.Tables[0].Rows.Count == 0)
        {
            messageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            return;
        }
        if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
        {
            //for (int i = 0; i < dsResult.Tables[0].Rows.Count; i++)
            for (int i = dsResult.Tables[0].Rows.Count - 1; i >= 0; i--)
            {
                if (dsResult.Tables[0].Rows[i]["LOGIN_MOBILE"].ToString() == "" && (dsResult.Tables[0].Rows[i]["ORDER_CHANNEL"].ToString() == "HOTELVP" || dsResult.Tables[0].Rows[i]["ORDER_CHANNEL"].ToString() == "HOTELVPPRO" || dsResult.Tables[0].Rows[i]["ORDER_CHANNEL"].ToString() == "GETAROOM"))
                {
                    dsResult.Tables[0].Rows[i]["LOGIN_MOBILE"] = "游客";
                }
                else if (dsResult.Tables[0].Rows[i]["LOGIN_MOBILE"].ToString() == "" && dsResult.Tables[0].Rows[i]["ORDER_CHANNEL"].ToString() == "QUNAR")
                {
                    dsResult.Tables[0].Rows[i]["LOGIN_MOBILE"] = "QUNAR";
                }

                if (!string.IsNullOrEmpty(ViewState["Timeout"].ToString()))
                {
                    if (!string.IsNullOrEmpty(dsResult.Tables[0].Rows[i]["confirmTime"].ToString()))
                    {
                        if (ViewState["Timeout"].ToString() == "1")//只取超时订单
                        {
                            if (int.Parse(dsResult.Tables[0].Rows[i]["confirmTime"].ToString()) <= 30)
                            {
                                dsResult.Tables[0].Rows.Remove(dsResult.Tables[0].Rows[i]);
                            }
                        }
                        else//只取没有超时的订单
                        {
                            if (int.Parse(dsResult.Tables[0].Rows[i]["confirmTime"].ToString()) > 30)
                            {
                                dsResult.Tables[0].Rows.Remove(dsResult.Tables[0].Rows[i]);
                            }
                        }
                    }
                    else
                    {
                        dsResult.Tables[0].Rows.Remove(dsResult.Tables[0].Rows[i]);
                    }
                }
            }
        }

        CommonFunction.ExportExcelForLM(dsResult);
    }
    //导出Excel文件
    protected void btnExport_Click(object sender, EventArgs e)
    {
        if (gridViewCSReviewLmSystemLogList.Rows.Count == 0)
        {
            messageContent.InnerHtml = GetLocalResourceObject("RowsEmptyMessage").ToString();
            return;
        }

        LmSystemLogEntity _lmSystemLogEntity = new LmSystemLogEntity();
        CommonEntity _commonEntity = new CommonEntity();

        _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;
        chartData = "[";
        chartName = "[";
        DateTime dateTemp;
        for (int i = 0; i < gridViewCSReviewLmSystemLogList.Rows.Count; i++)
        {
            _lmSystemLogEntity.FogOrderID = gridViewCSReviewLmSystemLogList.Rows[i].Cells[2].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.Mobile = gridViewCSReviewLmSystemLogList.Rows[i].Cells[3].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.CityID = gridViewCSReviewLmSystemLogList.Rows[i].Cells[4].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.HotelID = gridViewCSReviewLmSystemLogList.Rows[i].Cells[5].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.StartDTime = gridViewCSReviewLmSystemLogList.Rows[i].Cells[6].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.EndDTime = gridViewCSReviewLmSystemLogList.Rows[i].Cells[7].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.InStart = gridViewCSReviewLmSystemLogList.Rows[i].Cells[8].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.InEnd = gridViewCSReviewLmSystemLogList.Rows[i].Cells[9].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.PayCode = gridViewCSReviewLmSystemLogList.Rows[i].Cells[10].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.BookStatus = gridViewCSReviewLmSystemLogList.Rows[i].Cells[11].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.HotelComfirm = gridViewCSReviewLmSystemLogList.Rows[i].Cells[12].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.PayStatus = gridViewCSReviewLmSystemLogList.Rows[i].Cells[13].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.Aprove = gridViewCSReviewLmSystemLogList.Rows[i].Cells[14].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.Ticket = gridViewCSReviewLmSystemLogList.Rows[i].Cells[15].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.PlatForm = gridViewCSReviewLmSystemLogList.Rows[i].Cells[16].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "");
            _lmSystemLogEntity.ShowType = ddpTimeSpace.SelectedValue.Trim();

            chartName = chartName + "'" + gridViewCSReviewLmSystemLogList.Rows[i].Cells[1].Text.ToString().Trim().Replace("amp;", "").Replace("&nbsp;", "") + "',";

            StringBuilder sb = new StringBuilder();
            string temp = string.Empty;
            DataSet dsResult = LmSystemLogBP.ChartExportLmOrderSelect(_lmSystemLogEntity).QueryResult;
            if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
            {
                dateTemp = DateTime.Parse(_lmSystemLogEntity.StartDTime);
                if (double.Parse(_lmSystemLogEntity.ShowType) > 1)
                {
                    chartData = chartData + "[['" + dateTemp.ToShortDateString() + "', 0]],";
                }
                else
                {
                    chartData = chartData + "[['" + dateTemp.ToString() + "', 0]],";
                }
                continue;
            }

            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                temp = "['" + drRow["Date"].ToString() + "'," + drRow["Volume"].ToString() + "]";
                sb.Append(temp);
                sb.Append(',');
            }
            chartData = chartData + "["+ sb.ToString().Trim(',') + "],";
        }

        chartData = chartData.Trim(',') + "]";
        chartName = chartName.Trim(',') + "]";
        if (double.Parse(_lmSystemLogEntity.ShowType) > 1)
        {
            hidFormatString.Value = "%#m/%#d/%y";
        }
        else
        {
            hidFormatString.Value = "%Y/%#m/%#d %H:%M:%S";
        }

        //dvBtnUpdate.Style.Add("display", "none");
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DrawingLines();", true);
    }
        public static LmSystemLogEntity GetOrderInfoData(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "GetOrderInfoData";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.GetOrderInfoData(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "GetOrderInfoData  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static LmSystemLogEntity HotelFaxHis(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "HotelFaxHis";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.HotelFaxHis(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "HotelFaxHis  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static int SaveOrderOperation(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (!LmSystemLogDA.ChkOrderOperationLock(lmSystemLogEntity))
                {
                    return 2;
                }

                DataSet dsOrderInfo = LmSystemLogDA.GetSaveOrderOpeRemarkList(lmSystemLogEntity.FogOrderID);
                //if (LmSystemLogDA.SaveOrderOpeRemarkList(lmSystemLogEntity) != 1)
                //{
                //    return 0;
                //}

                if (LmSystemLogDA.SaveOrderOpeRemarkListConfirm(lmSystemLogEntity, dsOrderInfo) != 1)
                {
                    return 0;
                }

                if (OrderInfoSA.SaveOrderOperation(lmSystemLogEntity) != 1)
                {
                    return 0;
                }

                OrderInfoSA.SaveOrderConfirmPlanMail(lmSystemLogEntity, dsOrderInfo);
                return 1;
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static LmSystemLogEntity order_XPayment_ReviewLmOrderLogExport(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "order_XPayment_ReviewLmOrderLogSelect";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.order_XPayment_ReviewLmOrderLogExport(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "order_XPayment_ReviewLmOrderLogSelect  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static int SaveOrderOpeRemark(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (LmSystemLogDA.SaveOrderOpeRemark(lmSystemLogEntity) != 1)
                {
                    return 0;
                }

                if (!String.IsNullOrEmpty(lmSystemLogEntity.OrderBookStatus))
                {
                    if (OrderInfoSA.SaveOrderOperation(lmSystemLogEntity) != 1)
                    {
                        return 0;
                    }
                }

                return 1;
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOperation  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
        public static LmSystemLogEntity ReviewLmOrderLogSelectCountByRests(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ReviewLmOrderLogSelectCountByRests";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.ReviewLmOrderLogSelectCountByRests(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "ReviewLmOrderLogSelectCountByRests  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    protected void btnSendFax_Click(object sender, EventArgs e)
    {
        string HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        if (String.IsNullOrEmpty(HotelID))
        {
            messageContent.InnerHtml = "发送传真失败,请选择酒店列表内酒店信息!";
            ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyalert", "grLayout();", true);
            return;
        }

        if (gridViewCSList.Rows.Count == 0)
        {
            messageContent.InnerHtml = "发送传真失败,选择酒店无审核订单信息,请修改!";
            ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyalert", "grLayout();", true);
            return;
        }

        ArrayList alList = new ArrayList();
        for (int i = 0; i < this.gridViewCSList.Rows.Count; i++)
        {
            System.Web.UI.HtmlControls.HtmlInputCheckBox ck = (System.Web.UI.HtmlControls.HtmlInputCheckBox)gridViewCSList.Rows[i].FindControl("chkItems");
            if (ck.Checked == true)
            {
                alList.Add(gridViewCSList.DataKeys[i].Value.ToString());
            }
        }

        if (alList.Count == 0)
        {
            messageContent.InnerHtml = "发送传真失败,请选择订单列表需要发送传真的订单!";
            ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyalert", "grLayout();", true);
            return;
        }

        //StringBuilder sbOrderList = new StringBuilder();
        //for (int i = 0; i < gridViewCSList.Rows.Count; i++)
        //{
        //    sbOrderList.Append("\"");
        //    sbOrderList.Append(gridViewCSList.DataKeys[i].Values[0].ToString());
        //    sbOrderList.Append("\",");
        //}

        StringBuilder sbOrderList = new StringBuilder();
        foreach (string strSN in alList)
        {
            sbOrderList.Append("\"");
            sbOrderList.Append(strSN);
            sbOrderList.Append("\",");
        }

        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.HotelID = HotelID;
        _lmSystemLogEntity.FogOrderID = sbOrderList.ToString().TrimEnd(',');
        _lmSystemLogEntity.SendFaxType = "4";
        _lmSystemLogEntity.BookRemark = "";
        _lmSystemLogEntity.ObjectID = HotelID;
        int iResult = LmSystemLogBP.SendFaxService(_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("EventSendFaxMessage").ToString();

        conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, sbOrderList.ToString().TrimEnd(','));
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SendFaxSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("SendFaxSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SendFaxError").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("SendFaxError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyalert", "BtnCompleteStyle();", true);
    }
        public static LmSystemLogEntity SaveOrderOpeRemarkList(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOpeRemarkList";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                if (LmSystemLogDA.SaveOrderOpeRemarkList(lmSystemLogEntity) != 1)
                {
                    lmSystemLogEntity.Result = 0;
                    return lmSystemLogEntity;
                }

                if ("1".Equals(lmSystemLogEntity.IsDbApprove))
                {
                    lmSystemLogEntity.ErrorMSG = OrderInfoSA.SaveOrderOperationDoubleApprove(lmSystemLogEntity);
                    lmSystemLogEntity.Result = (String.IsNullOrEmpty(lmSystemLogEntity.ErrorMSG)) ? 1 : 2;
                    return lmSystemLogEntity;
                }
                else
                {
                    if (!String.IsNullOrEmpty(lmSystemLogEntity.OrderBookStatus))
                    {
                        string strMsg = OrderInfoSA.SaveOrderOperationList(lmSystemLogEntity);
                        if (!String.IsNullOrEmpty(strMsg))
                        {
                            lmSystemLogEntity.Result = 2;
                            lmSystemLogEntity.ErrorMSG = strMsg;
                            return lmSystemLogEntity;
                        }
                    }
                }
                lmSystemLogEntity.Result = 1;
                return lmSystemLogEntity;
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveOrderOpeRemarkList  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    public static string UnlockOrder(string OrderID)
    {
        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 = OrderID;

        DataSet dsMainResult = LmSystemLogBP.ChkOrderOperationSelect(_lmSystemLogEntity).QueryResult;

        if (dsMainResult.Tables.Count == 0 || dsMainResult.Tables[0].Rows.Count == 0)
        {
            //imgAlert.Src = "../../Styles/images/err.png";
            //dvImg.Style.Add("margin-left", "100px");
            //dvErrorInfo.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            //ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.GetType(), "setScript", "invokeOpenList()", true);
            return "../../Styles/images/err.png" + "|" + "120px" + "|" + "该订单信息不存在,请确认!" + "|";
        }

        string strMsg = LmSystemLogBP.UnlockOrderConfirmControl(_lmSystemLogEntity).ErrorMSG;
        if (!String.IsNullOrEmpty(strMsg))
        {
            //dvErrorInfo.InnerHtml = strMsg;
            //imgAlert.Src = "../../Styles/images/err.png";
            //dvImg.Style.Add("margin-left", "100px");
            return "../../Styles/images/err.png" + "|" + "120px" + "|" + strMsg + "|";
        }
        else
        {
            CommonEntity _commonEntity = new CommonEntity();
            _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
            CommonDBEntity commonDBEntity = new CommonDBEntity();

            commonDBEntity.Event_Type = "订单确认-强制锁定";
            commonDBEntity.Event_ID = _lmSystemLogEntity.FogOrderID;
            string conTent = "订单确认强制锁定 - 订单ID:{0}  操作人:{1}";// GetLocalResourceObject("EventUnLockMessage").ToString();

            conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.LogMessages.Username);
            commonDBEntity.Event_Content = conTent;
            commonDBEntity.Event_Result = "&nbsp;&nbsp;订单确认锁定成功!&nbsp;";// GetLocalResourceObject("UpdateUnLockSuccess").ToString();
            //dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateUnLockSuccess").ToString();
            //imgAlert.Src = "../../Styles/images/suc.png";
            //dvImg.Style.Add("margin-left", "100px");
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);

            return "../../Styles/images/suc.png" + "|" + "120px" + "|" + "订单确认锁定成功!" + "|" + UserSession.Current.UserAccount;

            //lbActionUser.Text = UserSession.Current.UserAccount;
        }
        //return json;
    }
    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 int SaveReciveFax(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveReciveFax";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                return LmSystemLogDA.SaveReciveFax(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SaveReciveFax  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }
    //private int CountLmSystemLog()
    //{
    //    _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.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
    //    _lmSystemLogEntity.CityID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["CityID"].ToString())) ? null : ViewState["CityID"].ToString();
    //    _lmSystemLogEntity.Sales = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["SaleID"].ToString())) ? null : ViewState["SaleID"].ToString();
    //    _lmSystemLogEntity.IsReserve = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["DSourceType"].ToString())) ? null : ViewState["DSourceType"].ToString();
    //    _lmSystemLogEntity.GuestName = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["DSourceData"].ToString())) ? null : ViewState["DSourceData"].ToString();
    //    DataSet dsResult = LmSystemLogBP.HotelComparisonSelectCount(_lmSystemLogEntity).QueryResult;
    //    if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0 && !String.IsNullOrEmpty(dsResult.Tables[0].Rows[0][0].ToString()))
    //    {
    //        return int.Parse(dsResult.Tables[0].Rows[0][0].ToString());
    //    }
    //    return 0;
    //}
    private void BindReviewLmSystemLogListGrid()
    {
        //messageContent.InnerHtml = "";

        _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.HotelID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelID"].ToString())) ? null : ViewState["HotelID"].ToString();
        _lmSystemLogEntity.CityID = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["CityID"].ToString())) ? null : ViewState["CityID"].ToString();
        _lmSystemLogEntity.Sales = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["SaleID"].ToString())) ? null : ViewState["SaleID"].ToString();

        _lmSystemLogEntity.DSourceType = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["DSourceType"].ToString())) ? null : ViewState["DSourceType"].ToString();
        _lmSystemLogEntity.DSourceData = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["DSourceData"].ToString())) ? null : ViewState["DSourceData"].ToString();
        _lmSystemLogEntity.Discount = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["Discount"].ToString())) ? null : ViewState["Discount"].ToString();

        _lmSystemLogEntity.PageCurrent = AspNetPager1.CurrentPageIndex;
        _lmSystemLogEntity.PageSize = gridViewCSReviewLmSystemLogList.PageSize;

        _lmSystemLogEntity = LmSystemLogBP.HotelComparisonSelect(_lmSystemLogEntity);
        DataSet dsResult = _lmSystemLogEntity.QueryResult;
        gridViewCSReviewLmSystemLogList.DataSource = dsResult.Tables["Detail"].DefaultView;
        gridViewCSReviewLmSystemLogList.DataKeyNames = new string[] { "Hotel_ID" };//主键
        gridViewCSReviewLmSystemLogList.DataBind();

        if (dsResult.Tables.Count > 0 && dsResult.Tables["Detail"].Rows.Count > 0)
        {
            lbUpdatTime.Text = dsResult.Tables["Detail"].Rows[dsResult.Tables["Detail"].Rows.Count - 1]["Update_time"].ToString();
        }

        AspNetPager1.PageSize = gridViewCSReviewLmSystemLogList.PageSize;
        AspNetPager1.RecordCount = _lmSystemLogEntity.TotalCount;//CountLmSystemLog();

        if (dsResult.Tables.Count > 0 && dsResult.Tables["Master"].Rows.Count > 0)
        {
            lbBHLID.Text = dsResult.Tables["Master"].Rows[0]["BHLID"].ToString();
            lbLHLID.Text = dsResult.Tables["Master"].Rows[0]["LHLID"].ToString();
            lbDHLID.Text = dsResult.Tables["Master"].Rows[0]["DHLID"].ToString();

            lbBRMCD.Text = dsResult.Tables["Master"].Rows[0]["BRMCD"].ToString();
            lbLRMCD.Text = dsResult.Tables["Master"].Rows[0]["LRMCD"].ToString();
            lbDRMCD.Text = dsResult.Tables["Master"].Rows[0]["DRMCD"].ToString();
        }
        else
        {
            lbBHLID.Text = "0";
            lbLHLID.Text = "0";
            lbDHLID.Text = "0";

            lbBRMCD.Text = "0";
            lbLRMCD.Text = "0";
            lbDRMCD.Text = "0";
        }
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
    }
        public static LmSystemLogEntity SendFaxService(LmSystemLogEntity lmSystemLogEntity)
        {
            lmSystemLogEntity.LogMessages.MsgType = MessageType.INFO;
            lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SendFaxService";
            LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);

            try
            {
                DataSet dsResult = LmSystemLogDA.OrderOperationSelect(lmSystemLogEntity).QueryResult;
                if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
                {
                    string book_status_other = dsResult.Tables[0].Rows[0]["book_status_other"].ToString();
                    if ("3".Equals(book_status_other) || "9".Equals(book_status_other))
                    {
                        lmSystemLogEntity.SendFaxType = "2";
                    }
                }
                return OrderInfoSA.SendFaxService(lmSystemLogEntity);
            }
            catch (Exception ex)
            {
                lmSystemLogEntity.LogMessages.MsgType = MessageType.ERROR;
                lmSystemLogEntity.LogMessages.Content = _nameSpaceClass + "SendFaxService  Error: " + ex.Message;
                LoggerHelper.LogWriter(lmSystemLogEntity.LogMessages);
                throw ex;
            }
        }