public void btnUpdateChannel(string destinationID, string nameCN, string parentsID, string onlineStatus)
    {
        detailMessageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(nameCN.Trim()))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString();
            return;
        }

        _destinationEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _destinationEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _destinationEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _destinationEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _destinationEntity.DestinationDBEntity = new List<DestinationDBEntity>();
        DestinationDBEntity destinationDBEntity = new DestinationDBEntity();
        destinationDBEntity.DestinationID = destinationID;
        destinationDBEntity.Name_CN = nameCN.Trim();
        destinationDBEntity.ParentsID = parentsID;
        destinationDBEntity.OnlineStatus = onlineStatus;
        _destinationEntity.DestinationDBEntity.Add(destinationDBEntity);

        int iResult = DestinationBP.Update(_destinationEntity);

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

        commonDBEntity.Event_Type = "目的地类别管理-修改";
        commonDBEntity.Event_ID = destinationID;

        string conTent = GetLocalResourceObject("EventUpdateMessage").ToString();
        conTent = string.Format(conTent, destinationDBEntity.ParentsID, destinationDBEntity.Name_CN, destinationDBEntity.OnlineStatus);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            Response.Write("<script>window.returnValue=true;window.opener = null;window.close();</script>");
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError2").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError2").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnAdd2_Click(object sender, EventArgs e)
    {
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        if (String.IsNullOrEmpty(wctHotel.AutoResult) || String.IsNullOrEmpty(hidHotelID2.Value.Trim()))
        {
            messageContent2.InnerHtml = GetLocalResourceObject("HotelIDError").ToString();
            return;
        }

        string strHotelNM = wctHotel.AutoResult.ToString();
        string strHotelID = strHotelNM.Substring((strHotelNM.IndexOf('[') + 1), (strHotelNM.IndexOf(']') - 1));

        appcontentDBEntity.HGroupID = hidHotelGroupID.Value;
        appcontentDBEntity.HotelID = strHotelID;
        appcontentDBEntity.GType = "1";
        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
        int iResult = APPContentBP.InsertHotelGroupList(_appcontentEntity);

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

        commonDBEntity.Event_Type = "核心酒店每日检查-酒店添加";
        commonDBEntity.Event_ID = strHotelID;
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        conTent = string.Format(conTent, hidHotelGroupID.Value, strHotelID, strHotelNM, "1");
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent2.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
            BindHotelListGrid2();
            RefreshHotelCount("1", UserSession.Current.UserDspName);
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertError").ToString();
            messageContent2.InnerHtml = GetLocalResourceObject("InsertError").ToString();
        }
        else if (iResult == 3)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertErrorHotel").ToString();
            messageContent2.InnerHtml = GetLocalResourceObject("InsertErrorHotel").ToString();
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    public void btnAddDestinationType()
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtDestinationTypeNM.Value.ToString().Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString();
            return;
        }

        _destinationEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _destinationEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _destinationEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _destinationEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _destinationEntity.DestinationDBEntity = new List<DestinationDBEntity>();
        DestinationDBEntity destinationDBEntity = new DestinationDBEntity();

        destinationDBEntity.Name_CN = txtDestinationTypeNM.Value.Trim();
        destinationDBEntity.ParentsID = ddpTypeList.SelectedValue;

        _destinationEntity.DestinationDBEntity.Add(destinationDBEntity);
        int iResult = DestinationBP.Insert(_destinationEntity);

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

        commonDBEntity.Event_Type = "目的地类别管理-添加";
        commonDBEntity.Event_ID = "";

        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        //conTent = string.Format(conTent, txtPaymentID.Value, txtPaymentName.Value);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
            BindTypeDDL();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error1").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error2").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString();
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (String.IsNullOrEmpty(txtRoleName.Text.ToString().Trim()))
        {
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('角色名称不能为空!');", true);
            return;
        }

        _roleEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _roleEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _roleEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _roleEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _roleEntity.RoleDBEntity = new List<RoleDBEntity>();
        RoleDBEntity roleDBEntity = new RoleDBEntity();
        roleDBEntity.RoleName = txtRoleName.Text.Trim();
        roleDBEntity.RoleCreator = UserSession.Current.UserAccount;
        roleDBEntity.UpdateTime = DateTime.Now.ToString();
        roleDBEntity.CreateTime = DateTime.Now.ToString();

        _roleEntity.RoleDBEntity.Add(roleDBEntity);
        int iResult = RoleBP.Insert(_roleEntity);

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

        commonDBEntity.Event_Type = "";
        commonDBEntity.Event_ID = "";

        //string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        //conTent = string.Format(conTent,txtRoleName.Text.Trim());
        //commonDBEntity.Event_Content = conTent;

        if (iResult == 1)//插入成功
        {
            commonDBEntity.Event_Result = Resources.MyGlobal.InsertSuccessText;
            messageContent.InnerHtml = Resources.MyGlobal.InsertSuccessText;
        }
        else if (iResult == 2)//表示该名称已经存在
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("PromptRoleExist").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("PromptRoleExist").ToString();
        }
        else//表示失败
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("PromptAddRoleFaild").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("PromptAddRoleFaild").ToString();
        }

        //_commonEntity.CommonDBEntity.Add(commonDBEntity);
        //CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        if (String.IsNullOrEmpty(WebAutoComplete.AutoResult))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("HotelIDError").ToString();
            PopReseachData();
            return;
        }

        string strHotelNM = WebAutoComplete.AutoResult.ToString();
        string strHotelID = strHotelNM.Substring((strHotelNM.IndexOf('[') + 1), (strHotelNM.IndexOf(']') - 1));
        string strTypeID = ddpAppIgnore.SelectedValue;
        string strTypeNM = ddpAppIgnore.SelectedItem.ToString();

        appcontentDBEntity.HotelID = strHotelID;
        appcontentDBEntity.TypeID = strTypeID;

        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
        int iResult = APPContentBP.InsertHotelCompareGrid(_appcontentEntity);

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

        commonDBEntity.Event_Type = "酒店数据同步检查-配置免检项目-添加";
        commonDBEntity.Event_ID = strHotelID;
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        conTent = string.Format(conTent, strHotelNM, strTypeID, strTypeNM);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertError").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("InsertError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        PopReseachData();
    }
    public void CreateCr()
    {
        MessageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtShipNM.Text.Trim()) || String.IsNullOrEmpty(txtDestination.Text.Trim()) || String.IsNullOrEmpty(txtDays.Text.Trim()) || String.IsNullOrEmpty(txtPort.Text.Trim()))
        {
            MessageContent.InnerHtml = "航线基础信息保存 *号位必填字段,请修改!";
            return;
        }

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

        _cruiseinfoEntity.CruiseInfoDBEntity = new List<CruiseInfoDBEntity>();
        CruiseInfoDBEntity cruiseInfoDBEntity = new CruiseInfoDBEntity();

        cruiseInfoDBEntity.CruiseID = hidCruiseID.Value.ToString();
        cruiseInfoDBEntity.ShipNM = txtShipNM.Text.Trim();
        cruiseInfoDBEntity.Destination = txtDestination.Text.Trim();
        cruiseInfoDBEntity.Days = txtDays.Text.Trim();
        cruiseInfoDBEntity.Port = txtPort.Text.Trim();

        _cruiseinfoEntity.CruiseInfoDBEntity.Add(cruiseInfoDBEntity);
        _cruiseinfoEntity = CruiseInfoBP.SaveCruiseInfo(_cruiseinfoEntity);
        int iResult = _cruiseinfoEntity.Result;
        string HotelID = _cruiseinfoEntity.ErrorMSG;
        _commonEntity.LogMessages = _cruiseinfoEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "航线基础信息-保存";
        commonDBEntity.Event_ID = HotelID;
        string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

        conTent = string.Format(conTent, HotelID, cruiseInfoDBEntity.ShipNM, cruiseInfoDBEntity.Destination, cruiseInfoDBEntity.Days, cruiseInfoDBEntity.Port);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = string.Format(GetLocalResourceObject("SaveSuccess").ToString(), HotelID);
            MessageContent.InnerHtml = string.Format(GetLocalResourceObject("SaveSuccess").ToString(), HotelID);
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SaveError").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("SaveError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    public void btnAddRegChannel()
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtRegChannelName.Value.ToString().Trim()) || String.IsNullOrEmpty(txtRegChannelID.Value.ToString().Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString();
            return;
        }

        _regChannelEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _regChannelEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _regChannelEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _regChannelEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _regChannelEntity.RegChannelDBEntity = new List<RegChannelDBEntity>();
        RegChannelDBEntity regChannelDBEntity = new RegChannelDBEntity();
        regChannelDBEntity.Name_CN = txtRegChannelName.Value;
        regChannelDBEntity.RegChannelID = txtRegChannelID.Value;
        _regChannelEntity.RegChannelDBEntity.Add(regChannelDBEntity);
        int iResult = RegChannelBP.Insert(_regChannelEntity);

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

        commonDBEntity.Event_Type = "注册渠道管理-添加";
        commonDBEntity.Event_ID = txtRegChannelID.Value;

        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        conTent = string.Format(conTent, txtRegChannelID.Value, txtRegChannelName.Value);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error1").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error2").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString();
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";

        _promotionTypeEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _promotionTypeEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _promotionTypeEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _promotionTypeEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _promotionTypeEntity.PromotiontypeDBEntity = new List<PromotionTypeDBEntity>();
        PromotionTypeDBEntity promotionTypeDBEntity = new PromotionTypeDBEntity();
        promotionTypeDBEntity.ID = ViewState["id"].ToString();
        promotionTypeDBEntity.Name = this.txtPromotionTypeName.Value;
        promotionTypeDBEntity.Seq = this.txtPromotionTypeSEQ.Value;

        _promotionTypeEntity.PromotiontypeDBEntity.Add(promotionTypeDBEntity);
        int iResult = PromotionTypeBP.Update(_promotionTypeEntity);

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

        commonDBEntity.Event_Type = "促销方式-修改";
        commonDBEntity.Event_ID = ViewState["id"].ToString();

        commonDBEntity.Event_Content = "促销方式-修改 ID:" + ViewState["id"].ToString() +";Name:" + this.txtPromotionTypeName.Value + ";SEQ:" + this.txtPromotionTypeSEQ.Value;
        commonDBEntity.IpAddress = UserSession.Current.UserIP;
        commonDBEntity.UserID = UserSession.Current.UserAccount;
        commonDBEntity.UserName = UserSession.Current.UserDspName;

        if (iResult == 1)
        {
            Response.Write("<script>window.returnValue=true;window.opener = null;window.close();</script>");
        }
        else
        {
            detailMessageContent.InnerHtml = "修改失败!";
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        if (String.IsNullOrEmpty(WebAutoComplete.AutoResult) || !WebAutoComplete.AutoResult.Trim().Equals(hidHotelID.Value.Trim()))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("HotelIDError").ToString();
            PopReseachData();
            return;
        }

        if (String.IsNullOrEmpty(dpStart.Value) || String.IsNullOrEmpty(dpEnd.Value))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("DTimeError").ToString();
            PopReseachData();
            return;
        }

        string strHotelNM = WebAutoComplete.AutoResult.ToString();
        string strHotelID = strHotelNM.Substring((strHotelNM.IndexOf('[') + 1), (strHotelNM.IndexOf(']') - 1));
        //string strTypeID = ddpAppIgnore.SelectedValue;
        //string strTypeNM = ddpAppIgnore.SelectedItem.ToString();

        appcontentDBEntity.HotelID = strHotelID;
        appcontentDBEntity.StartDTime = dpStart.Value;
        appcontentDBEntity.EndDTime = dpEnd.Value;
        appcontentDBEntity.UserCode = hidUserAccount.Value.Trim();

        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
        APPContentEntity appcontentRest  = APPContentBP.InsertSalesMangeGrid(_appcontentEntity);

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

        commonDBEntity.Event_Type = "酒店销售管理-添加";
        commonDBEntity.Event_ID = strHotelID + "-" + hidUserAccount.Value.Trim();
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        conTent = string.Format(conTent, strHotelNM, hidUserAccount.Value.Trim());
        commonDBEntity.Event_Content = conTent;

        if (appcontentRest.Result == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
            WebAutoComplete.AutoResult = "";
            dpStart.Value = "";
            dpEnd.Value = "";
        }
        else if (appcontentRest.Result == 2)
        {
            commonDBEntity.Event_Result = string.Format(GetLocalResourceObject("InsertError").ToString(), appcontentRest.ErrorMSG);
            detailMessageContent.InnerHtml = string.Format(GetLocalResourceObject("InsertError").ToString(), appcontentRest.ErrorMSG);
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        PopReseachData();
        SalesDetailManager();
    }
    /// <summary>
    /// 更新计划 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDivRenewPlan_Click(object sender, EventArgs e)
    {
        APPContentEntity _appcontentEntity = new APPContentEntity();
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        CommonEntity _commonEntity = new CommonEntity();
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _commonEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _commonEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();
        #region
        //城市ID
        string CityID = this.HidCityID.Value;
        appcontentDBEntity.CityID = CityID;
        //酒店ID
        string hotelID = this.HidPid.Value;
        appcontentDBEntity.HotelID = hotelID;
        //酒店名称
        string hotelName = this.HidPcode.Value;
        appcontentDBEntity.HotelNM = hotelName;
        //价格代码
        string priceCode = this.HiddenPriceCode.Value;
        appcontentDBEntity.PriceCode = priceCode;
        //价格
        string twoPrice = this.HiddenPrice.Value;
        appcontentDBEntity.TwoPrice = twoPrice;
        //状态     开启 关闭
        string status = this.dropDivStatusOpen.Checked == true ? "true" : "false";
        appcontentDBEntity.RoomStatus = status;
        appcontentDBEntity.PlanStatus = status;
        if (status == "true")
        {
            //房量
            if (this.txtDivRoomCount.Text.Trim() != "")
            {
                string roomNum = this.txtDivRoomCount.Text;
                appcontentDBEntity.RoomCount = roomNum;
            }
            //是否是保留房
            string isReserve = this.ckDivReserve.Checked == true ? "0" : "1";
            appcontentDBEntity.IsReserve = isReserve;
        }
        else
        {
            appcontentDBEntity.RoomCount = this.HiddenRoomNum.Value;
            appcontentDBEntity.IsReserve = this.HiddenIsReserve.Value;
        }
        //房型名称
        string RoomName = this.HiddenRoomName.Value;
        appcontentDBEntity.RoomName = RoomName;
        //房型Code
        string RoomCode = this.HiddenRoomCode.Value;
        appcontentDBEntity.RoomCode = RoomCode;

        bool IsFlag = false;

        //批量更新日期   开始  结束
        string divPlanStartDate = this.divPlanStartDate.Value;
        string divPlanEndDate = this.divPlanEndDate.Value;
        //if (DateTime.Parse(divPlanStartDate) >= System.DateTime.Now || DateTime.Parse(divPlanEndDate) <= System.DateTime.Now)
        if (DateTime.Parse(divPlanStartDate) == DateTime.Parse(System.DateTime.Now.ToShortDateString()))
        {
            IsFlag = true;
        }
        appcontentDBEntity.WeekList = "1,2,3,4,5,6,7";

        //备注
        string remark = this.txtRemark.Value;
        appcontentDBEntity.Remark = remark;
        //操作人
        string userName = UserSession.Current.UserAccount;
        appcontentDBEntity.CreateUser = userName;
        appcontentDBEntity.UpdateUser = userName;

        #endregion

        #region
        appcontentDBEntity.StartDTime = divPlanStartDate;
        appcontentDBEntity.EndDTime = divPlanEndDate;
        int DateDiff = calculateDateDiff(divPlanStartDate, divPlanEndDate);

        for (int j = 0; j <= DateDiff; j++)
        {
            appcontentDBEntity.PlanTime = DateTime.Parse(divPlanStartDate).AddDays(j).ToShortDateString();
            _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
            CommonBP.InsertConsultRoomHistory(_appcontentEntity);
            _appcontentEntity.APPContentDBEntity.Clear();
        }

        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);

        _appcontentEntity = HotelInfoBP.RenewPlanFullRoomByUpdatePlan(_appcontentEntity);

        int SelectedIndex = int.Parse(this.HidSelIndex.Value);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','false');", true);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','" + this.HidHotelEXLinkMan.Value + "','" + this.HidHotelEXLinkTel.Value + "','" + this.HidHotelEXLinkRemark.Value + "','false','true','false');", true);
        btnSingleHotel_Click(null, null);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "scrollReset", "GetResultFromServer();", true);
        if (IsFlag)
        {
            if (DateTime.Now.Hour >= 18)
            {
                if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#FF6666"))
                {
                    gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#FF6666";
                    gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#CD5C5C";
                    this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString();
                    gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#FF6666");
                    ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#CD5C5C");
                }
            }
            else
            {
                if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#80c0a0"))
                {
                    gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#80c0a0";
                    gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#70A88C";
                    this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString();
                    gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#80c0a0");
                    ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C");
                }
            }
        }
        #endregion
        ScriptManager.RegisterStartupScript(this.UpdatePanel10, this.GetType(), "keyinvokeCloseDiv", "invokeCloseDiv();", true);
        ScriptManager.RegisterStartupScript(this.UpdatePanel10, this.GetType(), "keyinvokeCloseDiv1", "BtnCompleteStyle();", true);
        this.UpdatePanel5.Update();
    }
    /// <summary>
    /// 计划关房(批量操作 关闭计划)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void btnPlanCloseRoom(string remark, string status, bool isRenew)
    {
        DataTable dtPlanLMBAR2 = new DataTable();
        DataTable dtPlanLMBAR = new DataTable();
        string hotelId = this.HidPid.Value;//酒店ID
        string dateSE = this.HidMarkFullRoom.Value;//起止日期

        #region
        APPContentEntity _appcontentEntity = new APPContentEntity();
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        CommonEntity _commonEntity = new CommonEntity();
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _commonEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _commonEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        bool IsFlag = false;
        if (!string.IsNullOrEmpty(dateSE))
        {

            DataTable dtPlan = GetBindLmbarPlanList(this.planStartDate.Value, this.planEndDate.Value, this.HidPid.Value).Tables[0];//总计划
            dtPlanLMBAR2 = dtPlan.Clone();
            dtPlanLMBAR = dtPlan.Clone();
            DataRow[] drPlanLMBAR2 = dtPlan.Select("RATECODE='LMBAR2'"); //LMBAR2计划
            for (int i = 0; i < drPlanLMBAR2.Length; i++)
            {
                dtPlanLMBAR2.ImportRow(drPlanLMBAR2[i]);
            }
            DataRow[] drPlanLMBAR = dtPlan.Select("RATECODE='LMBAR'"); //LMBAR计划
            for (int i = 0; i < drPlanLMBAR.Length; i++)
            {
                dtPlanLMBAR.ImportRow(drPlanLMBAR[i]);
            }

            string[] datas = dateSE.Split(',');
            for (int i = 0; i < datas.Length; i++)
            {
                if (!string.IsNullOrEmpty(datas[i].ToString()))
                {
                    if (DateTime.Parse(datas[i].ToString()).ToShortDateString() == System.DateTime.Now.ToShortDateString())
                    {
                        IsFlag = true;
                    }

                    string effDate = datas[i].ToString().Replace("/", "-");
                    #region
                    for (int l = 0; l < this.HidLastHotelRoomListLMBAR2.Value.Split(',').Length; l++)
                    {
                        DataRow[] rowsLmbar2 = dtPlanLMBAR2.Select("EFFECTDATESTRING='" + DateTime.Parse(effDate).ToString("yyyy-MM-dd") + "' and ROOMTYPECODE='" + this.HidLastHotelRoomListLMBAR2.Value.Split(',')[l].ToString() + "'");
                        for (int j = 0; j < rowsLmbar2.Length; j++)
                        {
                            if (!string.IsNullOrEmpty(rowsLmbar2[j]["RoomNum"].ToString()) && rowsLmbar2[j]["RoomNum"].ToString().ToLower() != "null")
                            {
                                //城市ID
                                appcontentDBEntity.CityID = this.HidCityID.Value;
                                //酒店ID
                                appcontentDBEntity.HotelID = hotelId;
                                //酒店名称
                                appcontentDBEntity.HotelNM = this.HidPcode.Value;
                                //PlanDate
                                appcontentDBEntity.PlanTime = DateTime.Parse(effDate).ToShortDateString();
                                //价格代码
                                appcontentDBEntity.PriceCode = rowsLmbar2[j]["RATECODE"].ToString();
                                //价格
                                appcontentDBEntity.TwoPrice = rowsLmbar2[j]["TWOPRICE"].ToString();
                                //状态     开启 关闭
                                //appcontentDBEntity.PlanStatus = rowsLmbar2[j]["STATUS"].ToString();
                                appcontentDBEntity.PlanStatus = status == "" ? rowsLmbar2[j]["STATUS"].ToString() : status;
                                appcontentDBEntity.RoomCount = rowsLmbar2[j]["ROOMNUM"].ToString();
                                appcontentDBEntity.IsReserve = rowsLmbar2[j]["ISRESERVE"].ToString();
                                //房型名称
                                appcontentDBEntity.RoomName = rowsLmbar2[j]["ROOMTYPENAME"].ToString();
                                //房型Code
                                appcontentDBEntity.RoomCode = rowsLmbar2[j]["ROOMTYPECODE"].ToString();

                                appcontentDBEntity.WeekList = "1,2,3,4,5,6,7";
                                //备注
                                appcontentDBEntity.Remark = remark;
                                //操作人
                                appcontentDBEntity.CreateUser = UserSession.Current.UserAccount;

                                _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
                                CommonBP.InsertConsultRoomHistory(_appcontentEntity);
                                _appcontentEntity.APPContentDBEntity.Clear();
                            }
                        }
                    }
                    #endregion
                    #region
                    for (int l = 0; l < this.HidLastHotelRoomListLMBAR.Value.Split(',').Length; l++)
                    {
                        DataRow[] rowsLmbar = dtPlanLMBAR.Select("EFFECTDATESTRING='" + DateTime.Parse(effDate).ToString("yyyy-MM-dd") + "' and ROOMTYPECODE='" + this.HidLastHotelRoomListLMBAR.Value.Split(',')[l].ToString() + "'");
                        for (int j = 0; j < rowsLmbar.Length; j++)
                        {
                            if (!string.IsNullOrEmpty(rowsLmbar[j]["ROOMNUM"].ToString()) && rowsLmbar[j]["RoomNum"].ToString().ToLower() != "null")
                            {
                                //城市ID
                                appcontentDBEntity.CityID = this.HidCityID.Value;
                                //酒店ID
                                appcontentDBEntity.HotelID = hotelId;
                                //酒店名称
                                appcontentDBEntity.HotelNM = this.HidPcode.Value;
                                //PlanDate
                                appcontentDBEntity.PlanTime = DateTime.Parse(effDate).ToShortDateString();
                                //价格代码
                                appcontentDBEntity.PriceCode = rowsLmbar[j]["RATECODE"].ToString();
                                //价格
                                appcontentDBEntity.TwoPrice = rowsLmbar[j]["TWOPRICE"].ToString();
                                //状态     开启 关闭
                                //appcontentDBEntity.PlanStatus = rowsLmbar[j]["STATUS"].ToString();
                                appcontentDBEntity.PlanStatus = status == "" ? rowsLmbar[j]["STATUS"].ToString() : status;
                                appcontentDBEntity.RoomCount = rowsLmbar[j]["ROOMNUM"].ToString();
                                appcontentDBEntity.IsReserve = rowsLmbar[j]["ISRESERVE"].ToString();
                                //房型名称
                                appcontentDBEntity.RoomName = rowsLmbar[j]["ROOMTYPENAME"].ToString();
                                //房型Code
                                appcontentDBEntity.RoomCode = rowsLmbar[j]["ROOMTYPECODE"].ToString();

                                appcontentDBEntity.WeekList = "1,2,3,4,5,6,7";
                                //备注
                                appcontentDBEntity.Remark = remark;
                                //操作人
                                appcontentDBEntity.CreateUser = UserSession.Current.UserAccount;
                                _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
                                CommonBP.InsertConsultRoomHistory(_appcontentEntity);
                                _appcontentEntity.APPContentDBEntity.Clear();
                            }
                        }
                    }
                    #endregion
                    if (isRenew)
                    {
                        appcontentDBEntity.HotelID = hotelId;
                        appcontentDBEntity.StartDTime = effDate;
                        appcontentDBEntity.EndDTime = effDate;
                        appcontentDBEntity.Lmbar2RoomCode = this.HidLastHotelRoomListLMBAR2.Value;
                        appcontentDBEntity.LmbarRoomCode = this.HidLastHotelRoomListLMBAR.Value;
                        appcontentDBEntity.TypeID = status == "true" ? "3" : "2";// "2";//type:1 满房、2 关房、3 开房
                        appcontentDBEntity.UpdateUser = UserSession.Current.UserAccount;
                        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);

                        _appcontentEntity = HotelInfoBP.BatchUpdatePlan(_appcontentEntity);

                        _appcontentEntity.APPContentDBEntity.Clear();
                    }
                }
            }
        }
        #endregion

        int SelectedIndex = int.Parse(this.HidSelIndex.Value);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyclosebtn", "BtnCompleteStyle();", true);

        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','" + this.HidHotelEXLinkMan.Value + "','" + this.HidHotelEXLinkTel.Value + "','" + this.HidHotelEXLinkRemark.Value + "','false','true','false');", true);

        //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "scrollReset", "GetResultFromServer();", true);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel11, this.GetType(), "keyclosebtn", "BtnCompleteStyle();", true);
        //btnSelect_Click(null, null);
        btnSingleHotel_Click(null, null);

        if (IsFlag)
        {
            if (DateTime.Now.Hour >= 18)
            {
                if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#FF6666"))
                {
                    gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#FF6666";
                    gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#CD5C5C";
                    this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString();
                    gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#FF6666");
                    ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#CD5C5C");
                }
            }
            else
            {
                if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#80c0a0"))
                {
                    gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#80c0a0";
                    gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#70A88C";
                    this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString();
                    gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#80c0a0");
                    ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C");
                }
            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(lbUserID.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("SaveError2").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        string strBackCashAmount = (!String.IsNullOrEmpty(lbBackCashAmount.Text.Trim()) && lbBackCashAmount.Text.Trim().IndexOf('.') >= 0) ? lbBackCashAmount.Text.Trim().Substring(0, lbBackCashAmount.Text.Trim().IndexOf('.')) : lbBackCashAmount.Text.Trim();
        if (String.IsNullOrEmpty(lbBackCashAmount.Text.Trim()) || !ChkNumber(strBackCashAmount))
        {
            messageContent.InnerHtml = GetLocalResourceObject("SaveError7").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        string errMsg = string.Empty;
        if ("0".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBankOwner.Text.Trim()) || String.IsNullOrEmpty(txtBankName.Text.Trim()) || String.IsNullOrEmpty(txtBankBranch.Text.Trim()) || String.IsNullOrEmpty(txtBankCardNumber.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError3").ToString();
        }
        else if ("1".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBackTel.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError4").ToString();
        }
        else if ("2".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBao.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError5").ToString();
        }
        else if ("2".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBaoName.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError8").ToString();
        }

        if (!String.IsNullOrEmpty(errMsg))
        {
            messageContent.InnerHtml = errMsg;
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

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

        _cashbackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashbackDBEntity = new CashBackDBEntity();
        cashbackDBEntity.UserID = lbUserID.Text.Trim();
        cashbackDBEntity.OrderNo = lbOrderNo.Text.Trim();
        cashbackDBEntity.BackCashAmount = lbBackCashAmount.Text.Trim();
        cashbackDBEntity.BackCashType = hidCommonType.Value.Trim();
        cashbackDBEntity.BankOwner = txtBankOwner.Text.Trim();
        cashbackDBEntity.BankName = txtBankName.Text.Trim();
        cashbackDBEntity.BankBranch = txtBankBranch.Text.Trim();
        cashbackDBEntity.BankCardNumber = txtBankCardNumber.Text.Trim();
        cashbackDBEntity.BackTel = txtBackTel.Text.Trim();
        cashbackDBEntity.BackBao = txtBao.Text.Trim();
        cashbackDBEntity.BackBaoName = txtBaoName.Text.Trim();
        cashbackDBEntity.Remark = txtRemark.Text.Trim();
        cashbackDBEntity.BackInType = "0";
        _cashbackEntity.CashBackDBEntity.Add(cashbackDBEntity);
        _cashbackEntity = CashBackBP.SaveCashBackRequest(_cashbackEntity);
        int iResult = _cashbackEntity.Result;

        _commonEntity.LogMessages = _cashbackEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();
        commonDBEntity.Event_Type = "创建提现申请-保存";
        commonDBEntity.Event_ID = lbUserID.Text.Trim();
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        conTent = string.Format(conTent, cashbackDBEntity.UserID, cashbackDBEntity.BackCashAmount, cashbackDBEntity.BackCashType, cashbackDBEntity.BankName, cashbackDBEntity.BankBranch, cashbackDBEntity.BankCardNumber, cashbackDBEntity.BackTel, cashbackDBEntity.BackBao, cashbackDBEntity.Remark, cashbackDBEntity.BackInType);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SaveSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("SaveSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SaveError1").ToString() + _cashbackEntity.ErrorMSG;
            messageContent.InnerHtml = GetLocalResourceObject("SaveError1").ToString() + _cashbackEntity.ErrorMSG;
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(hidHotelID.Value.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!wctHotel.AutoResult.Equals(hidHotelID.Value))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error19").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            return;
        }

        if (String.IsNullOrEmpty(dpKeepStart.Value.Trim()) || String.IsNullOrEmpty(dpKeepEnd.Value.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (String.IsNullOrEmpty(hidWeekList.Value.Trim(',')))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error11").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if ("2".Equals(ddpSaveType.SelectedValue.Trim()) && String.IsNullOrEmpty(hidPlanWeekList.Value.Trim(',')))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error16").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if ("2".Equals(ddpSaveType.SelectedValue.Trim()) && (String.IsNullOrEmpty(dpKeepStart.Value.Trim()) || String.IsNullOrEmpty(dpKeepEnd.Value.Trim()) || String.IsNullOrEmpty(dpPlanTime.Value.Trim())))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error17").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if ("1".Equals(ddpSaveType.SelectedValue.Trim()) && (String.IsNullOrEmpty(dpPlanDTime.Value.Trim())))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error18").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        //if (String.IsNullOrEmpty(hidCommonList.Value.Trim()))
        //{
        //    messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString();
        //    //UpdatePanel6.Update();
        //    return;
        //}

        if (String.IsNullOrEmpty(ddpHotelRoomList.SelectedValue.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (String.IsNullOrEmpty(ddpSup.SelectedValue.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error21").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if ("true".Equals(ddpRoomStatus.SelectedValue.Trim().ToLower()) && String.IsNullOrEmpty(txtTwoPrice.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error12").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!IsValidNumber(txtOnePrice.Text.Trim()) || !IsValidNumber(txtThreePrice.Text.Trim()) || !IsValidNumber(txtFourPrice.Text.Trim()) || !IsValidNumber(txtBedPrice.Text.Trim()) || !IsValidNumber(txtBreakPrice.Text.Trim()) || !IsValidNumber(txtNetPrice.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error13").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!IsValidTwoPrice(txtTwoPrice.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error15").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!ChkNumber(txtOffsetval.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error14").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if ("true".Equals(ddpRoomStatus.SelectedValue.Trim().ToLower()) && String.IsNullOrEmpty(txtRoomCount.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error4").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!ChkNumber(txtRoomCount.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error4").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        if (!String.IsNullOrEmpty(txtTwoPrice.Text.Trim()) && !ChkLowPrice(txtTwoPrice.Text.Trim()))
        {
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

        string effHour = "";
        effHour = GetEffHourVal(ddpEffHour.SelectedValue.Trim());
        if ("99".Equals(ddpEffHour.SelectedValue.Trim()) && String.IsNullOrEmpty(effHour))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error22").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
            //UpdatePanel6.Update();
            return;
        }

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

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        appcontentDBEntity.HotelID = hidHotelID.Value.ToString().Trim();
        appcontentDBEntity.PriceCode = ddpPriceType.SelectedValue.Trim();
        //appcontentDBEntity.RoomList = hidCommonList.Value.ToString().Trim();
        appcontentDBEntity.RoomCode = ddpHotelRoomList.SelectedValue.Trim();
        appcontentDBEntity.RoomName = (ddpHotelRoomList.SelectedItem.Text.Trim().Contains("]")) ? ddpHotelRoomList.SelectedItem.Text.Trim().Substring(ddpHotelRoomList.SelectedItem.Text.Trim().IndexOf(']') + 1) : ddpHotelRoomList.SelectedItem.Text.Trim();
        appcontentDBEntity.StartDTime = dpKeepStart.Value.ToString().Trim();
        appcontentDBEntity.EndDTime = dpKeepEnd.Value.ToString().Trim();
        appcontentDBEntity.EffHour = effHour;
        appcontentDBEntity.WeekList = hidWeekList.Value.Trim(',');

        //if ("lmbar".Equals(ddpPriceType.SelectedValue.Trim().ToLower()))
        //{
        //    appcontentDBEntity.Note1 = lbNote1.Text.Trim().Substring(1, lbNote1.Text.Trim().IndexOf('】') -1);
        //    appcontentDBEntity.Note2 = lbNote11.Text.Trim().Substring(1, lbNote11.Text.Trim().IndexOf('】') -1);
        //}
        //else
        //{
        //    appcontentDBEntity.Note1 = lbNote2.Text.Trim().Substring(1, lbNote2.Text.Trim().IndexOf('】') - 1);
        //    appcontentDBEntity.Note2 = lbNote22.Text.Trim().Substring(1, lbNote22.Text.Trim().IndexOf('】') - 1 );
        //}

        appcontentDBEntity.Note1 = ddpGuaid.SelectedValue.Trim();
        appcontentDBEntity.Note2 = ddpCxlid.SelectedValue.Trim();

        appcontentDBEntity.OnePrice = txtOnePrice.Text.Trim();
        appcontentDBEntity.TwoPrice = txtTwoPrice.Text.Trim();
        appcontentDBEntity.ThreePrice = txtThreePrice.Text.Trim();
        appcontentDBEntity.FourPrice = txtFourPrice.Text.Trim();
        appcontentDBEntity.BedPrice = txtBedPrice.Text.Trim();
        appcontentDBEntity.NetPrice = txtNetPrice.Text.Trim();
        appcontentDBEntity.BreakfastNum = ddpBreakfastNum.SelectedValue.Trim();
        appcontentDBEntity.BreakPrice = txtBreakPrice.Text.Trim();
        appcontentDBEntity.IsNetwork = ddpIsNetwork.SelectedValue.Trim();
        appcontentDBEntity.Offsetval = txtOffsetval.Text.Trim();
        appcontentDBEntity.Offsetunit = ddpOffsetunit.SelectedValue.Trim();
        appcontentDBEntity.RoomStatus = ddpRoomStatus.SelectedValue.Trim();
        appcontentDBEntity.RoomCount = txtRoomCount.Text.Trim();
        appcontentDBEntity.IsReserve = ddpIsReserve.SelectedValue.Trim();

        appcontentDBEntity.SaveType = ddpSaveType.SelectedValue.Trim();
        appcontentDBEntity.PlanDTime = dpPlanDTime.Value.Trim();
        appcontentDBEntity.PlanTime = dpPlanTime.Value.Trim();
        appcontentDBEntity.PlanStart = dpKeepStart.Value.ToString().Trim(); //dpPlanStart.Value.Trim();
        appcontentDBEntity.PlanEnd = dpKeepEnd.Value.ToString().Trim(); //dpPlanEnd.Value.Trim();
        appcontentDBEntity.PlanWeek = hidWeekList.Value.Trim(','); //hidPlanWeekList.Value.Trim(',');

        appcontentDBEntity.Supplier = ddpSup.SelectedValue.Trim();

        appcontentDBEntity.UpdateUser = UserSession.Current.UserDspName;
        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);

        _appcontentEntity = APPContentBP.CreateSalesPlan(_appcontentEntity);
        int iResult = _appcontentEntity.Result;
        string strPlanID = _appcontentEntity.APPContentDBEntity[0].PlanID;
        _commonEntity.LogMessages = _appcontentEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "酒店销售计划-保存";
        commonDBEntity.Event_ID = strPlanID;
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        string msgCommon = string.Empty;
        msgCommon = ddpHotelRoomList.SelectedItem.Text;// +"[" + ddpHotelRoomList.SelectedValue + "]";
        string msgPlanDTime = "";
        string PlanStart = "";
        string PlanWeekList = "";

        if ("1".Equals(ddpSaveType.SelectedValue.Trim()))
        {
            msgPlanDTime = dpPlanDTime.Value;
        }
        else if ("2".Equals(ddpSaveType.SelectedValue.Trim()))
        {
            msgPlanDTime = dpPlanTime.Value;
            PlanStart = dpKeepStart.Value.ToString().Trim() + "-" + dpKeepEnd.Value.ToString().Trim();
            PlanWeekList = hidWeekList.Value.Trim(',');
        }

        conTent = string.Format(conTent, hidHotelID.Value.ToString().Trim(), msgCommon, dpKeepStart.Value, dpKeepEnd.Value, ddpEffHour.SelectedValue.Trim(), ddpPriceType.SelectedValue, txtRoomCount.Text.Trim(), ddpRoomStatus.SelectedValue.Trim(), hidWeekList.Value.Trim(','), txtOnePrice.Text.Trim(), txtTwoPrice.Text.Trim(), txtThreePrice.Text.Trim(), txtFourPrice.Text.Trim(), txtBedPrice.Text.Trim(), txtNetPrice.Text.Trim(), ddpBreakfastNum.SelectedValue.Trim(), txtBreakPrice.Text.Trim(), ddpIsNetwork.SelectedValue.Trim(), txtOffsetval.Text.Trim(), ddpOffsetunit.SelectedValue.Trim(), ddpIsReserve.SelectedValue.Trim(), ddpSaveType.SelectedValue.Trim(), msgPlanDTime, PlanStart, PlanWeekList, strPlanID, ddpSup.SelectedValue);
        commonDBEntity.Event_Content = conTent;
        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error8").ToString() + _appcontentEntity.ErrorMSG;
            messageContent.InnerHtml = GetLocalResourceObject("Error8").ToString() + _appcontentEntity.ErrorMSG;
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true);
        //UpdatePanel6.Update();
    }
    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();
    }
    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 bool btnUpdateRegChannel(string regChannelNo, string regChannelID, string nameCN, string onlineStatus)
    {
        messageContent.InnerHtml = "";

        _regChannelEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _regChannelEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _regChannelEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _regChannelEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _regChannelEntity.RegChannelDBEntity = new List<RegChannelDBEntity>();
        RegChannelDBEntity regChannelDBEntity = new RegChannelDBEntity();
        regChannelDBEntity.RegChannelNo = regChannelNo;
        regChannelDBEntity.RegChannelID = regChannelID;
        regChannelDBEntity.Name_CN = nameCN;
        regChannelDBEntity.OnlineStatus = onlineStatus;
        _regChannelEntity.RegChannelDBEntity.Add(regChannelDBEntity);
        int iResult = RegChannelBP.Update(_regChannelEntity);

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

        commonDBEntity.Event_Type = "注册渠道管理-修改";
        commonDBEntity.Event_ID = regChannelID;

        string conTent = GetLocalResourceObject("EventUpdateMessage").ToString();
        conTent = string.Format(conTent, regChannelDBEntity.RegChannelID, regChannelDBEntity.Name_CN, regChannelDBEntity.OnlineStatus);
        commonDBEntity.Event_Content = conTent;
        bool returnValue = true;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError2").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateError2").ToString();
            returnValue = false;
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
            returnValue = false;
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        return returnValue;
    }
    protected void gridViewCSAPPContenList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string strHotelID = gridViewCSAPPContenList.Rows[e.RowIndex].Cells[0].Text.ToString();
        string strHotelNM = gridViewCSAPPContenList.Rows[e.RowIndex].Cells[1].Text.ToString();

        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        appcontentDBEntity.HotelID = strHotelID;
        appcontentDBEntity.HGroupID = hidHotelGroupID.Value;
        appcontentDBEntity.GType = "0";
        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
        int iResult = APPContentBP.DeteleHotelGroupList(_appcontentEntity);

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

        commonDBEntity.Event_Type = "核心酒店每日检查-酒店删除";
        commonDBEntity.Event_ID = strHotelID;
        string conTent = GetLocalResourceObject("EventDeteleMessage").ToString();
        conTent = string.Format(conTent, hidHotelGroupID.Value, strHotelID, strHotelNM, "0");
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("DeteleSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("DeteleSuccess").ToString();
            BindHotelListGrid();
            RefreshHotelCount("0", "");
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("DeteleError").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("DeteleError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    //protected void gridViewCSAPPContenList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{
    //    this.gridViewCSAPPContenList.PageIndex = e.NewPageIndex;
    //    BindDataListGrid();
    //}
    protected void myGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string strHotelID = myGridView.Rows[e.RowIndex].Cells[0].Text.ToString();
        _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>();
        APPContentDBEntity appcontentDBEntity = new APPContentDBEntity();

        appcontentDBEntity.HotelID = strHotelID;
        appcontentDBEntity.UserCode = hidUserAccount.Value.Trim();

        _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity);
        int iResult = APPContentBP.DeleteSalesManagerGrid(_appcontentEntity);

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

        commonDBEntity.Event_Type = "酒店销售管理-删除";
        commonDBEntity.Event_ID = strHotelID + "-" + hidUserAccount.Value.Trim();
        string conTent = GetLocalResourceObject("EventDeleteMessage").ToString();
        conTent = string.Format(conTent, strHotelID, hidUserAccount.Value.Trim());
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("DeleteSuccess").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("DeleteSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("DeleteError").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("DeleteError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        PopReseachData();
    }
    protected void btnSet_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";
        if (String.IsNullOrEmpty(hidOrderID.Value.Trim()))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorMessage").ToString();
            return;
        }

        if (!String.IsNullOrEmpty(txtBOOK_REMARK.Text.Trim()) && (StringUtility.Text_Length(txtBOOK_REMARK.Text.ToString().Trim()) > 250))
        {
            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.SelectedItem.Text.Trim();
        _lmSystemLogEntity.BookRemark = txtBOOK_REMARK.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;
        string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

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

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtName.Value.ToString().Trim()))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError4").ToString();
            return;
        }

        if (txtName.Value.ToString().Trim().Length > 12)
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError3").ToString();
            return;
        }

        if (String.IsNullOrEmpty(ddpFtTypeList.SelectedValue))
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError5").ToString();
            return;
        }

        _hotelfacilitiesEntity.HotelFacilitiesDBEntity = new List<HotelFacilitiesDBEntity>();

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

        _hotelfacilitiesEntity.HotelFacilitiesDBEntity = new List<HotelFacilitiesDBEntity>();
        HotelFacilitiesDBEntity hotelFacilitiesDBEntity = new HotelFacilitiesDBEntity();
        hotelFacilitiesDBEntity.ID = hiddenId.Value;
        hotelFacilitiesDBEntity.Name_CN = txtName.Value;
        hotelFacilitiesDBEntity.OnlineStatus = ddpStatusList.SelectedValue;
        hotelFacilitiesDBEntity.Type = ddpFtTypeList.SelectedValue;
        hotelFacilitiesDBEntity.FTSeq = lbFtSeq.Text;
        _hotelfacilitiesEntity.HotelFacilitiesDBEntity.Add(hotelFacilitiesDBEntity);

        int iResult = HotelFacilitiesBP.Update(_hotelfacilitiesEntity);
        _commonEntity.LogMessages = _hotelfacilitiesEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        string conTent = "";
        conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        conTent = string.Format(conTent, txtName.Value, ddpStatusList.SelectedValue);
        commonDBEntity.Event_Type = "酒店设置服务详细-更新";
        commonDBEntity.Event_ID = txtName.Value;
        commonDBEntity.Event_Content = conTent;
        if (iResult == 1)
        {
            Response.Write("<script>window.returnValue=true;window.opener = null;window.close();</script>");
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else if (iResult == 2)
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError2").ToString();
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError2").ToString();
        }
        else
        {
            detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString();
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError1").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    private void BindViewCSSystemLogMain()
    {
        _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;

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

        if (dsMainResult.Tables.Count == 0 || dsMainResult.Tables[0].Rows.Count == 0)
        {
            hidOrderID.Value = "";
            btnPrint.Visible = false;
            btnSendFax.Visible = false;
            btnSet.Visible = false;
            btnUnlock.Visible = false;
            detailMessageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            return;
        }

        string strMsg = LmSystemLogBP.ChkOrderOperationControl(_lmSystemLogEntity).ErrorMSG;
        if (!String.IsNullOrEmpty(strMsg))
        {
            //hidOrderID.Value = "";
            btnPrint.Visible = false;
            btnSendFax.Visible = false;
            btnSet.Visible = false;
            //detailMessageContent.InnerHtml = strMsg;
            dvErrorInfo.InnerHtml = strMsg;
            //return;
        }
        else
        {
            _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
            CommonDBEntity commonDBEntity = new CommonDBEntity();

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

            conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.LogMessages.Username);
            commonDBEntity.Event_Content = conTent;

            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateLockSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }
        ViewState["baseDtResult"] = dsMainResult.Tables[0];

        btnPrint.Visible = true;
        btnSendFax.Visible = true;
        btnSet.Visible = true;
        btnUnlock.Visible = true;
        lbCREATE_TIME.Text = dsMainResult.Tables[0].Rows[0]["create_time"].ToString();
        lbORDER_CHANNEL.Text = dsMainResult.Tables[0].Rows[0]["ORDER_CHANNEL"].ToString();
        lbPRICE_CODE.Text = dsMainResult.Tables[0].Rows[0]["price_code_nm"].ToString();
        hidPriceCode.Value = dsMainResult.Tables[0].Rows[0]["price_code"].ToString().Trim().ToUpper();
        lbBOOK_STATUS.Text = "LMBAR".Equals(dsMainResult.Tables[0].Rows[0]["price_code"].ToString().Trim().ToUpper()) ? dsMainResult.Tables[0].Rows[0]["book_status_nm"].ToString() : dsMainResult.Tables[0].Rows[0]["book_status_other_nm"].ToString();
        lbIS_GUA.Text = dsMainResult.Tables[0].Rows[0]["is_gua_nm"].ToString();
        lbRESV_GUA_HOLD_TIME.Text = dsMainResult.Tables[0].Rows[0]["RESV_GUA_HOLD_TIME"].ToString();
        lbUSER_HOLD_TIME.Text = dsMainResult.Tables[0].Rows[0]["USER_HOLD_TIME"].ToString();
        lbRESV_GUA_NM.Text = dsMainResult.Tables[0].Rows[0]["RESV_GUA_DESC"].ToString();
        lbRESV_CXL_NM.Text = dsMainResult.Tables[0].Rows[0]["RESV_CXL_DESC"].ToString();
        lbPAY_STATUS.Text = dsMainResult.Tables[0].Rows[0]["pay_status_nm"].ToString();
        lbHOTEL_NAME.Text = dsMainResult.Tables[0].Rows[0]["hotel_name"].ToString() + " - " + dsMainResult.Tables[0].Rows[0]["hotel_id"].ToString();
        hidIssueNm.Value = "[" + dsMainResult.Tables[0].Rows[0]["hotel_id"].ToString() + "] - [" + dsMainResult.Tables[0].Rows[0]["hotel_name"].ToString() + "] - " + hidOrderID.Value + " - 订单确认问题";
        lbFax.Text = dsMainResult.Tables[0].Rows[0]["linkfax"].ToString();
        lbLINKTEL.Text = dsMainResult.Tables[0].Rows[0]["linktel"].ToString();
        lbGUEST_NAMES.Text = dsMainResult.Tables[0].Rows[0]["guest_names"].ToString();
        lbCONTACT_NAME.Text = dsMainResult.Tables[0].Rows[0]["contact_name"].ToString();
        lbCONTACT_TEL.Text = dsMainResult.Tables[0].Rows[0]["contact_tel"].ToString();
        lbLOGIN_MOBILE.Text = dsMainResult.Tables[0].Rows[0]["LOGIN_MOBILE"].ToString();
        lbOrderDays.Text = SetOrderDaysVal(dsMainResult.Tables[0].Rows[0]["in_date"].ToString(), dsMainResult.Tables[0].Rows[0]["out_date"].ToString());
        lbIN_DATE.Text = dsMainResult.Tables[0].Rows[0]["in_date_nm"].ToString();
        lbOUT_DATE.Text = dsMainResult.Tables[0].Rows[0]["out_date_nm"].ToString();
        lbROOM_TYPE_NAME.Text = dsMainResult.Tables[0].Rows[0]["room_type_name"].ToString();
        lbBOOK_ROOM_NUM.Text = dsMainResult.Tables[0].Rows[0]["book_room_num"].ToString();
        lbARRIVE_TIME.Text = dsMainResult.Tables[0].Rows[0]["ARRIVE_TIME"].ToString();
        lbTICKET_USERCODE.Text = dsMainResult.Tables[0].Rows[0]["ticket_usercode"].ToString();
        lbTICKET_PAGENM.Text = dsMainResult.Tables[0].Rows[0]["packagename"].ToString();
        lbTICKET_AMOUNT.Text = dsMainResult.Tables[0].Rows[0]["ticket_amount"].ToString();
        lbBOOK_REMARK.Text = dsMainResult.Tables[0].Rows[0]["BOOK_REMARK"].ToString();
        lbORDER_NUM.Text = dsMainResult.Tables[0].Rows[0]["order_id"].ToString();
        chkFollowUp.Checked = ("1".Equals(dsMainResult.Tables[0].Rows[0]["FOLLOW_UP"].ToString())) ? true : false;
        hidHotelID.Value = dsMainResult.Tables[0].Rows[0]["hotel_id"].ToString();
        lbMemo1.Text = SetMemoVal(_lmSystemLogEntity.FogOrderID);
        lblSalesMG.Text = SetHotelSalesInfo(dsMainResult.Tables[0].Rows[0]["hotel_id"].ToString());
        BindViewCSSystemLogDetail();
        SetOrderSettingControlVal(dsMainResult.Tables[0].Rows[0]["price_code"].ToString(), dsMainResult.Tables[0].Rows[0]["book_status_other"].ToString(), dsMainResult.Tables[0].Rows[0]["order_cancle_reason"].ToString());

        tbDetail.Style.Add("display", "");
        tbControl.Style.Add("display", "");

        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "SetRefeshVal()", true);
    }
    protected void btnUnlock_Click(object sender, EventArgs e)
    {
        detailMessageContent.InnerHtml = "";
        if (String.IsNullOrEmpty(hidOrderID.Value.Trim()))
        {
            dvErrorInfo.InnerHtml = GetLocalResourceObject("ErrorMessage").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("ErrorMessage").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;

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

        if (dsMainResult.Tables.Count == 0 || dsMainResult.Tables[0].Rows.Count == 0)
        {
            //hidOrderID.Value = "";
            btnPrint.Visible = false;
            btnSendFax.Visible = false;
            btnSet.Visible = false;
            dvErrorInfo.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            return;
        }

        string strMsg = LmSystemLogBP.UnlockOrderConfirmControl(_lmSystemLogEntity).ErrorMSG;
        if (!String.IsNullOrEmpty(strMsg))
        {
            //hidOrderID.Value = "";
            btnPrint.Visible = false;
            btnSendFax.Visible = false;
            btnSet.Visible = false;
            //detailMessageContent.InnerHtml = strMsg;
            dvErrorInfo.InnerHtml = strMsg;
            return;
        }
        else
        {
            _commonEntity.LogMessages = _lmSystemLogEntity.LogMessages;
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
            CommonDBEntity commonDBEntity = new CommonDBEntity();

            commonDBEntity.Event_Type = "订单操作-强制锁定";
            commonDBEntity.Event_ID = hidHotelID.Value;
            string conTent = GetLocalResourceObject("EventUnLockMessage").ToString();

            conTent = string.Format(conTent, _lmSystemLogEntity.FogOrderID, _lmSystemLogEntity.LogMessages.Username);
            commonDBEntity.Event_Content = conTent;

            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateUnLockSuccess").ToString();
            //detailMessageContent.InnerHtml = GetLocalResourceObject("UpdateUnLockSuccess").ToString();
            dvErrorInfo.InnerHtml = GetLocalResourceObject("UpdateUnLockSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //ProgressBar1.Value = 50;
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtUserGroupNM.Value.ToString().Trim()) || String.IsNullOrEmpty(txtUserGroupNM.Value.ToString().Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString();
            //UpdatePanel2.Update();
            return;
        }

        if (!checkNum(txtSubmitOrderFrom.Value.ToString().Trim()) || !checkNum(txtSubmitOrderTo.Value.ToString().Trim()) || !checkNum(txtCompleteOrderFrom.Value.ToString().Trim()) || !checkNum(txtCompleteOrderTo.Value.ToString().Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error4").ToString();
            return;
        }

        if ((!String.IsNullOrEmpty(txtSubmitOrderFrom.Value.ToString().Trim()) && !String.IsNullOrEmpty(txtSubmitOrderTo.Value.ToString().Trim())) && (int.Parse(txtSubmitOrderFrom.Value.ToString().Trim()) > int.Parse(txtSubmitOrderTo.Value.ToString().Trim())))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error6").ToString();
            return;
        }

        if ((!String.IsNullOrEmpty(txtCompleteOrderFrom.Value.ToString().Trim()) && !String.IsNullOrEmpty(txtCompleteOrderTo.Value.ToString().Trim())) && (int.Parse(txtCompleteOrderFrom.Value.ToString().Trim()) > int.Parse(txtCompleteOrderTo.Value.ToString().Trim())))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error7").ToString();
            return;
        }

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

        _userGroupEntity.UserGroupDBEntity = new List<UserGroupDBEntity>();
        UserGroupDBEntity usergroupEntity = new UserGroupDBEntity();

        usergroupEntity.UserGroupNM = txtUserGroupNM.Value.ToString().Trim();

        usergroupEntity.RegChannelList = hidRegChannelList.Value.ToString().Trim();
        usergroupEntity.PlatformList = hidPlatformList.Value.ToString().Trim();

        usergroupEntity.RegistStart = dpRegistStart.Value;
        usergroupEntity.RegistEnd = dpRegistEnd.Value;

        usergroupEntity.LoginStart = dpLoginStart.Value;
        usergroupEntity.LoginEnd = dpLoginEnd.Value;

        usergroupEntity.SubmitOrderFrom = txtSubmitOrderFrom.Value.ToString().Trim();
        usergroupEntity.SubmitOrderTo = txtSubmitOrderTo.Value.ToString().Trim();

        usergroupEntity.CompleteOrderFrom = txtCompleteOrderFrom.Value.ToString().Trim();
        usergroupEntity.CompleteOrderTo = txtCompleteOrderTo.Value.ToString().Trim();

        usergroupEntity.LastOrderStart = dpLastOrderStart.Value;
        usergroupEntity.LastOrderEnd = dpLastOrderEnd.Value;

        usergroupEntity.ManualAdd = txtManualAdd.Text.ToString().Trim();

        _userGroupEntity.UserGroupDBEntity.Add(usergroupEntity);
        int iResult = UserGroupBP.Insert(_userGroupEntity);

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

        commonDBEntity.Event_Type = "新建用户组-添加";
        commonDBEntity.Event_ID = txtUserGroupNM.Value.ToString().Trim();
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
        conTent = string.Format(conTent, txtUserGroupNM.Value, "");
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error1").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString();
        }
        else if (iResult == 3)
        {
            string errTent = GetLocalResourceObject("Error5").ToString();
            errTent = string.Format(errTent, (_userGroupEntity.UserGroupDBEntity.Count > 0 ) ? _userGroupEntity.UserGroupDBEntity[0].ErrManualAdd : "");

            commonDBEntity.Event_Result = errTent;
            messageContent.InnerHtml = errTent;
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error2").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString();
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);

        int maxLength = String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLengthCount"]) ? 500 : int.Parse(ConfigurationManager.AppSettings["MaxLengthCount"].ToString());
        if (iResult == 1 || iResult == 3)
        {
            DataSet dsHistory = UserGroupBP.GetHistoryInsert(_userGroupEntity);

            if (dsHistory.Tables.Count > 0 && dsHistory.Tables[0].Rows.Count > 0)
            {
                int iCount = 0;
                string phoneString = "";
                foreach (DataRow drRow in dsHistory.Tables[0].Rows)
                {
                    phoneString = phoneString + drRow[0].ToString() + ",";
                    iCount = iCount + 1;
                    if (iCount == maxLength)
                    {
                        phoneString = phoneString.Substring(0, phoneString.Length - 1);
                        conTent = GetLocalResourceObject("EventInsertMessage").ToString();
                        conTent = string.Format(conTent, txtUserGroupNM.Value, phoneString);
                        _commonEntity.CommonDBEntity[0].Event_Content = conTent;
                        CommonBP.InsertEventHistory(_commonEntity);
                        phoneString = "";
                        iCount = 0;
                    }

                }

                if (iCount > 0)
                {
                    phoneString = phoneString.Substring(0, phoneString.Length - 1);
                    conTent = GetLocalResourceObject("EventInsertMessage").ToString();
                    conTent = string.Format(conTent, txtUserGroupNM.Value, phoneString);
                    _commonEntity.CommonDBEntity[0].Event_Content = conTent;
                    CommonBP.InsertEventHistory(_commonEntity);
                }
            }
            else
            {
                conTent = GetLocalResourceObject("EventInsertMessage").ToString();
                conTent = string.Format(conTent, txtUserGroupNM.Value, "");
                _commonEntity.CommonDBEntity[0].Event_Content = conTent;
                CommonBP.InsertEventHistory(_commonEntity);
            }
        }
        else
        {
            //_commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }

        hidRegChannelList.Value = "";
        hidPlatformList.Value = "";
        BindUserGroupListGrid();
        //UpdatePanel1.Update();
        //ProgressBar1.Value = 100;
    }
    public bool btnAddData()
    {
        MessageContent.InnerHtml = "";
        bool bFlag = true;
        string msgString = "";

        if (String.IsNullOrEmpty(txtHotelNM.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError3").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelNM.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError2").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelNMEN.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError12").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtHotelPN.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError115").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelPN.Text.ToString().Trim()) > 1000)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError101").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtTotalRooms.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError102").ToString() + "<br/>";
            bFlag = false;
        }

        if (!ChkNumber(txtTotalRooms.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError103").ToString() + "<br/>";
            bFlag = false;
        }

        if (!ChkNumber(txtPriceLow.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError117").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtHotelJP.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError116").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelJP.Text.ToString().Trim()) > 1000)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError104").ToString() + "<br/>";
            bFlag = false;
        }

        string strCity = hidCityID.Value.Trim();

        if (String.IsNullOrEmpty(strCity.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError105").ToString() + "<br/>";
            bFlag = false;
        }

        if (!strCity.Contains("[") && !strCity.Contains("]"))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError118").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtAddress.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError106").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtAddress.Text.ToString().Trim()) > 150)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError4").ToString() + "<br/>";
            bFlag = false;
        }

        if ((String.IsNullOrEmpty(txtLatitude.Text.ToString().Trim())) || (String.IsNullOrEmpty(txtLongitude.Text.ToString().Trim())))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError21").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(hidBussList.Value.Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError107").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtContactNameZh.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError108").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtContactNameZh.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError109").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtHotelFax.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError71").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtHotelFax.Text.ToString().Trim()) && (StringUtility.Text_Length(txtHotelFax.Text.ToString().Trim()) > 100))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError7").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtContactPhone.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError110").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtContactPhone.Text.ToString().Trim()) && (StringUtility.Text_Length(txtContactPhone.Text.ToString().Trim()) > 30))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError111").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtHotelTel.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError61").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtHotelTel.Text.ToString().Trim()) && (StringUtility.Text_Length(txtHotelTel.Text.ToString().Trim()) > 40))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError6").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtContactEmail.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError113").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtContactEmail.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError11").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtSimpleDescZh.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError112").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtSimpleDescZh.Text.ToString().Trim()) && (StringUtility.Text_Length(txtSimpleDescZh.Text.ToString().Trim()) > 1000))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError8").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtDescZh.Text.ToString().Trim()) && (StringUtility.Text_Length(txtDescZh.Text.ToString().Trim()) > 2000))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError114").ToString() + "<br/>";
            bFlag = false;
        }

        //if (!RegexValidateData(txtLatitude.Text.ToString().Trim()) || !RegexValidateData(txtLongitude.Text.ToString().Trim()))
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError31").ToString() + "<br/>";
        //    bFlag = false;
        //}

        if (!bFlag)
        {
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString() + "<br/>" + msgString;
            return false;
        }

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

        _hotelinfoEntity.HotelInfoDBEntity = new List<HotelInfoDBEntity>();
        HotelInfoDBEntity hotelInfoDBEntity = new HotelInfoDBEntity();

        hotelInfoDBEntity.Name_CN = txtHotelNM.Text.Trim();
        hotelInfoDBEntity.Name_EN = txtHotelNMEN.Text.Trim();
        hotelInfoDBEntity.City = (strCity.IndexOf("]") >= 0) ? strCity.Substring((strCity.IndexOf('[') + 1), (strCity.IndexOf(']') - 1)) : "";
        //hotelInfoDBEntity.Administration = ddpAdministration.SelectedValue.Trim();
        hotelInfoDBEntity.StarRating = ddpStarRating.SelectedValue;
        hotelInfoDBEntity.AddRess = txtAddress.Text.Trim();
        hotelInfoDBEntity.Phone = txtHotelTel.Text.Trim();
        hotelInfoDBEntity.Fax = txtHotelFax.Text.Trim();
        hotelInfoDBEntity.Longitude = txtLongitude.Text.Trim();
        hotelInfoDBEntity.Latitude = txtLatitude.Text.Trim();
        //hotelInfoDBEntity.HotelGroup = ddpHotelGroup.SelectedValue;
        hotelInfoDBEntity.Bussiness = hidBussList.Value.Trim();

        hotelInfoDBEntity.OpenDate = dpOpenDate.Value;
        hotelInfoDBEntity.RepairDate = dpRepairDate.Value;
        hotelInfoDBEntity.SimpleDescZh = txtSimpleDescZh.Text.Trim();
        hotelInfoDBEntity.DescZh = txtDescZh.Text.Trim();
        //hotelInfoDBEntity.HServe = txtHServe.Text.Trim();
        //hotelInfoDBEntity.HFacility = txtHFacility.Text.Trim();

        hotelInfoDBEntity.Status = ddpOnline.SelectedValue.Trim();
        hotelInfoDBEntity.HotelPN = txtHotelPN.Text.Trim();

        hotelInfoDBEntity.TotalRooms = txtTotalRooms.Text.Trim();
        hotelInfoDBEntity.HotelJP = txtHotelJP.Text.Trim();
        hotelInfoDBEntity.Zip = txtZip.Text.Trim();
        hotelInfoDBEntity.PriceLow = txtPriceLow.Text.Trim();
        hotelInfoDBEntity.ContactPer = txtContactNameZh.Text.Trim();
        hotelInfoDBEntity.ContactPhone = txtContactPhone.Text.Trim();
        hotelInfoDBEntity.ContactEmail = txtContactEmail.Text.Trim();

        //hotelInfoDBEntity.ID = hidHotelNo.Value;
        //hotelInfoDBEntity.HotelID = hidHotelID.Value;
        //hotelInfoDBEntity.Status = ddpStatusList.SelectedValue;
        //hotelInfoDBEntity.WebSite = txtWebSite.Text.Trim();
        //hotelInfoDBEntity.Phone = txtPhone.Text.Trim();
        //hotelInfoDBEntity.DiamondRating = ddpDiamondRating.SelectedValue;
        //hotelInfoDBEntity.City = ddpCity.SelectedValue;
        //hotelInfoDBEntity.ContactPer = txtContactPer.Text.Trim();
        //hotelInfoDBEntity.ContactEmail = txtContactEmail.Text.Trim();
        //hotelInfoDBEntity.Evaluation = Evaluation;
        //hotelInfoDBEntity.AutoTrust = (chkAutoTrust.Checked) ? "1" : "0";
        //hotelInfoDBEntity.FogStatus = hidFogStatus.Value;

        _hotelinfoEntity.HotelInfoDBEntity.Add(hotelInfoDBEntity);
        _hotelinfoEntity = HotelInfoBP.SupHotelSave(_hotelinfoEntity);
        int iResult = _hotelinfoEntity.Result;
        string HotelID = _hotelinfoEntity.ErrorMSG;
        _commonEntity.LogMessages = _hotelinfoEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "SUP酒店基础信息-保存";
        commonDBEntity.Event_ID = HotelID;
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        conTent = string.Format(conTent,HotelID, hotelInfoDBEntity.Name_CN, hotelInfoDBEntity.Name_EN, hotelInfoDBEntity.City, hotelInfoDBEntity.StarRating, hotelInfoDBEntity.AddRess, hotelInfoDBEntity.Phone, hotelInfoDBEntity.Fax, hotelInfoDBEntity.Longitude, hotelInfoDBEntity.Latitude, hotelInfoDBEntity.Bussiness, hotelInfoDBEntity.OpenDate, hotelInfoDBEntity.RepairDate, hotelInfoDBEntity.SimpleDescZh, hotelInfoDBEntity.DescZh, hotelInfoDBEntity.Status, hotelInfoDBEntity.HotelPN, hotelInfoDBEntity.TotalRooms, hotelInfoDBEntity.HotelJP, hotelInfoDBEntity.Zip, hotelInfoDBEntity.PriceLow, hotelInfoDBEntity.ContactPer, hotelInfoDBEntity.ContactPhone, hotelInfoDBEntity.ContactEmail);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = string.Format(GetLocalResourceObject("UpdateSuccess").ToString(), HotelID);
            MessageContent.InnerHtml = string.Format(GetLocalResourceObject("UpdateSuccess").ToString(), HotelID);
        }
        else if (iResult == 3)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError33").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError33").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError22").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError22").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError1").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        if (iResult == 1)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    public bool btnAddData()
    {
        MessageContent.InnerHtml = "";
        bool bFlag = true;
        string msgString = "";
        if (String.IsNullOrEmpty(txtHotelNM.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError3").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelNM.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError2").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtHotelNMEN.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError12").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtAddress.Text.ToString().Trim()) > 150)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError4").ToString() + "<br/>";
            bFlag = false;
        }

        //if (StringUtility.Text_Length(txtWebSite.Text.ToString().Trim()) > 200)
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError5").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (String.IsNullOrEmpty(txtPhone.Text.ToString().Trim()))
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError61").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (String.IsNullOrEmpty(txtFax.Text.ToString().Trim()))
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError71").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (!String.IsNullOrEmpty(txtPhone.Text.ToString().Trim()) && (StringUtility.Text_Length(txtPhone.Text.ToString().Trim()) > 40 ))
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError6").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (!String.IsNullOrEmpty(txtFax.Text.ToString().Trim()) && (StringUtility.Text_Length(txtFax.Text.ToString().Trim()) > 20 ))
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError7").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (StringUtility.Text_Length(txtContactPer.Text.ToString().Trim()) > 100)
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError10").ToString() + "<br/>";
        //    bFlag = false;
        //}

        //if (StringUtility.Text_Length(txtContactEmail.Text.ToString().Trim()) > 100)
        //{
        //    msgString = msgString + GetLocalResourceObject("UpdateError11").ToString() + "<br/>";
        //    bFlag = false;
        //}

        if ((String.IsNullOrEmpty(txtLatitude.Text.ToString().Trim())) || (String.IsNullOrEmpty(txtLongitude.Text.ToString().Trim())))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError21").ToString() + "<br/>";
            bFlag = false;
        }

        if (!RegexValidateData(txtLatitude.Text.ToString().Trim()) || !RegexValidateData(txtLongitude.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError31").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtSimpleDescZh.Text.ToString().Trim()) && (StringUtility.Text_Length(txtSimpleDescZh.Text.ToString().Trim()) > 1000))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError8").ToString() + "<br/>";
            bFlag = false;
        }

        string Evaluation = string.Empty;

        for (int i = 0; i < this.gridViewEvaluationList.Rows.Count; i++)
        {
            TextBox txtBox = (TextBox)gridViewEvaluationList.Rows[i].FindControl("txtEvalist");
            if (!ChkEvaContent(txtBox.Text.Trim()))//if (txtBox.Text.Trim().Contains(",") || txtBox.Text.Trim().Contains(","))
            {
                msgString = msgString + GetLocalResourceObject("UpdateError32").ToString() + "<br/>";
                bFlag = false;
                break;
            }
            Evaluation = (!string.IsNullOrEmpty(txtBox.Text.Trim())) ? Evaluation + txtBox.Text.Trim() + "," : Evaluation;
        }

        Evaluation = (Evaluation.Length > 0) ? Evaluation.Substring(0, Evaluation.Length - 1) : Evaluation;

        if (!String.IsNullOrEmpty(Evaluation) && (StringUtility.Text_Length(Evaluation) > 1000))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError9").ToString() + "<br/>";
            bFlag = false;
        }

        if (!bFlag)
        {
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString() + "<br/>" + msgString;
            return false;
        }

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

        _hotelinfoEntity.HotelInfoDBEntity = new List<HotelInfoDBEntity>();
        HotelInfoDBEntity hotelInfoDBEntity = new HotelInfoDBEntity();

        hotelInfoDBEntity.ID = hidHotelNo.Value;
        hotelInfoDBEntity.HotelID = hidHotelID.Value;
        hotelInfoDBEntity.Name_CN = txtHotelNM.Text.Trim();
        hotelInfoDBEntity.Name_EN = txtHotelNMEN.Text.Trim();
        //hotelInfoDBEntity.Status = ddpStatusList.SelectedValue;
        hotelInfoDBEntity.HotelGroup = ddpHotelGroup.SelectedValue;
        hotelInfoDBEntity.StarRating = ddpStarRating.SelectedValue;
        //hotelInfoDBEntity.DiamondRating = ddpDiamondRating.SelectedValue;
        hotelInfoDBEntity.City = ddpCity.SelectedValue;
        hotelInfoDBEntity.OpenDate = dpOpenDate.Value;
        hotelInfoDBEntity.RepairDate = dpRepairDate.Value;
        hotelInfoDBEntity.AddRess = txtAddress.Text.Trim();
        //hotelInfoDBEntity.WebSite = txtWebSite.Text.Trim();
        //hotelInfoDBEntity.Phone = txtPhone.Text.Trim();
        //hotelInfoDBEntity.Fax = txtFax.Text.Trim();
        //hotelInfoDBEntity.ContactPer = txtContactPer.Text.Trim();
        //hotelInfoDBEntity.ContactEmail = txtContactEmail.Text.Trim();

        hotelInfoDBEntity.Longitude = txtLongitude.Text.Trim();
        hotelInfoDBEntity.Latitude = txtLatitude.Text.Trim();

        hotelInfoDBEntity.SimpleDescZh = txtSimpleDescZh.Text.Trim();
        hotelInfoDBEntity.DescZh = txtDescZh.Text.Trim();
        hotelInfoDBEntity.Evaluation = Evaluation;
        //hotelInfoDBEntity.AutoTrust = (chkAutoTrust.Checked) ? "1" : "0";
        //hotelInfoDBEntity.FogStatus = hidFogStatus.Value;
        _hotelinfoEntity.HotelInfoDBEntity.Add(hotelInfoDBEntity);
        int iResult = HotelInfoBP.HotelSave(_hotelinfoEntity);

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

        commonDBEntity.Event_Type = "酒店基础信息-保存";
        commonDBEntity.Event_ID = hidHotelID.Value;
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        conTent = string.Format(conTent, hotelInfoDBEntity.HotelID, hotelInfoDBEntity.Name_CN, hotelInfoDBEntity.Status, hotelInfoDBEntity.HotelGroup, hotelInfoDBEntity.StarRating, hotelInfoDBEntity.DiamondRating, hotelInfoDBEntity.City, hotelInfoDBEntity.OpenDate.ToString(), hotelInfoDBEntity.RepairDate.ToString(), hotelInfoDBEntity.AddRess, hotelInfoDBEntity.WebSite, hotelInfoDBEntity.SimpleDescZh, hotelInfoDBEntity.DescZh, hotelInfoDBEntity.Evaluation);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError1").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError1").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        if (iResult == 1)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    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 bool btnUpdatePlatform(string platformNo, string platformID, string nameCN, string onlineStatus)
    {
        messageContent.InnerHtml = "";

        _platformEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _platformEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _platformEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _platformEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _platformEntity.PlatformDBEntity = new List<PlatformDBEntity>();
        PlatformDBEntity platformDBEntity = new PlatformDBEntity();
        platformDBEntity.PlatformNo = platformNo;
        platformDBEntity.PlatformID = platformID;
        platformDBEntity.Name_CN = nameCN;
        platformDBEntity.OnlineStatus = onlineStatus;
        _platformEntity.PlatformDBEntity.Add(platformDBEntity);
        int iResult = PlatformBP.Update(_platformEntity);

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

        commonDBEntity.Event_Type = "应用平台管理-修改";
        commonDBEntity.Event_ID = platformID;

        string conTent = GetLocalResourceObject("EventUpdateMessage").ToString();
        conTent = string.Format(conTent, platformDBEntity.PlatformID, platformDBEntity.Name_CN, platformDBEntity.OnlineStatus);
        commonDBEntity.Event_Content = conTent;
        bool returnValue = true;
        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateSuccess").ToString();
        }
        else if(iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError2").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateError2").ToString();
            returnValue = false;
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("UpdateError").ToString();
            returnValue = false;
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        return returnValue;
    }
    protected void btnBalAdd_Click(object sender, EventArgs e)
    {
        RestControlEnable(true, 2);
        //dvEvlGrid.Style.Add("display", "");
        //dvLink.Style.Add("display", "");
        SetEvalGridBtnStyle(true);
        divBtnList.Style.Add("display", "");
        dvSales.Style.Add("display", "");
        dvBalSearch.Style.Add("display", "");
        dvBalAdd.Style.Add("display", "");
        hidSelectedID.Value = "2";

        MessageContent.InnerHtml = "";
        bool bFlag = true;
        string msgString = "";

        if (String.IsNullOrEmpty(dpInDTStart.Value) || String.IsNullOrEmpty(dpInDTEnd.Value))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError17").ToString() + "<br/>";
            bFlag = false;
        }

        if (!ChkBalVal(txtBalVal.Text.Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError19").ToString() + "<br/>";
            bFlag = false;
        }

        string strHRoomList = "";
        foreach (ListItem lt in chkHotelRoomList.Items)
        {
            if (lt.Selected)
            {
                strHRoomList = strHRoomList + lt.Value + ",";
            }
        }
        strHRoomList = strHRoomList.Trim(',');
        if (String.IsNullOrEmpty(strHRoomList))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError18").ToString() + "<br/>";
            bFlag = false;
        }

        if (!bFlag)
        {
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError16").ToString() + "<br/>" + msgString;
            RestBalGridData();
            return;
        }

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

        _hotelinfoEntity.HotelInfoDBEntity = new List<HotelInfoDBEntity>();
        HotelInfoDBEntity hotelInfoDBEntity = new HotelInfoDBEntity();
        hotelInfoDBEntity.HotelID = hidHotelID.Value;

        hotelInfoDBEntity.PriceCode = ddpPriceCode.SelectedValue.Trim();
        hotelInfoDBEntity.HRoomList = strHRoomList;
        hotelInfoDBEntity.InDateFrom = dpInDTStart.Value.Trim();
        hotelInfoDBEntity.InDateTo = dpInDTEnd.Value.Trim();
        hotelInfoDBEntity.BalType = ddpBalType.SelectedValue.Trim();
        hotelInfoDBEntity.BalValue = txtBalVal.Text.Trim();

        _hotelinfoEntity.HotelInfoDBEntity.Add(hotelInfoDBEntity);
        _hotelinfoEntity = HotelInfoBP.SetBalanceRoomList(_hotelinfoEntity);
        int iResult = _hotelinfoEntity.Result;
        _commonEntity.LogMessages = _hotelinfoEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "酒店结算信息-保存";
        commonDBEntity.Event_ID = hidHotelID.Value;
        string conTent = GetLocalResourceObject("EventInsertBalMessage").ToString();

        conTent = string.Format(conTent, hotelInfoDBEntity.HotelID, hotelInfoDBEntity.Name_CN, hotelInfoDBEntity.PriceCode, hotelInfoDBEntity.HRoomList, hotelInfoDBEntity.InDateFrom, hotelInfoDBEntity.InDateTo, hotelInfoDBEntity.BalType, hotelInfoDBEntity.BalValue);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateBalSuccess").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateBalSuccess").ToString();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = _hotelinfoEntity.ErrorMSG;// GetLocalResourceObject("UpdateBalError2").ToString();
            MessageContent.InnerHtml = _hotelinfoEntity.ErrorMSG;//GetLocalResourceObject("UpdateBalError2").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError16").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError16").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        BindBalManagerListGrid();
        //this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "SetSalesControlVal()", true);
    }
    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);
    }
    protected void btnSaveSales_Click(object sender, EventArgs e)
    {
        hidSelectedID.Value = "1";
        MessageContent.InnerHtml = "";
        bool bFlag = true;
        string msgString = "";

        if (String.IsNullOrEmpty(wctSales.AutoResult) || !wctSales.AutoResult.Trim().Equals(hidSalesID.Value.Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError14").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(dpSalesStart.Value) || String.IsNullOrEmpty(dpSalesEnd.Value))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError15").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtPhone.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError61").ToString() + "<br/>";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(txtFax.Text.ToString().Trim()))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError71").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtPhone.Text.ToString().Trim()) && (StringUtility.Text_Length(txtPhone.Text.ToString().Trim()) > 40))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError6").ToString() + "<br/>";
            bFlag = false;
        }

        if (!String.IsNullOrEmpty(txtFax.Text.ToString().Trim()) && (StringUtility.Text_Length(txtFax.Text.ToString().Trim()) > 20))
        {
            msgString = msgString + GetLocalResourceObject("UpdateError7").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtContactPer.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError10").ToString() + "<br/>";
            bFlag = false;
        }

        if (StringUtility.Text_Length(txtContactEmail.Text.ToString().Trim()) > 100)
        {
            msgString = msgString + GetLocalResourceObject("UpdateError11").ToString() + "<br/>";
            bFlag = false;
        }

        if (!bFlag)
        {
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError13").ToString() + "<br/>" + msgString;
            RestBalGridData();
            return;
        }

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

        _hotelinfoEntity.HotelInfoDBEntity = new List<HotelInfoDBEntity>();
        HotelInfoDBEntity hotelInfoDBEntity = new HotelInfoDBEntity();

        hotelInfoDBEntity.HotelID = hidHotelID.Value;
        hotelInfoDBEntity.Name_CN = txtHotelNM.Text.Trim();
        hotelInfoDBEntity.SalesID = hidSalesID.Value.Substring((hidSalesID.Value.IndexOf('[') + 1), (hidSalesID.Value.IndexOf(']') - 1));
        hotelInfoDBEntity.Phone = txtPhone.Text.Trim();
        hotelInfoDBEntity.Fax = txtFax.Text.Trim();
        hotelInfoDBEntity.ContactPer = txtContactPer.Text.Trim();
        hotelInfoDBEntity.ContactEmail = txtContactEmail.Text.Trim();
        hotelInfoDBEntity.SalesStartDT = dpSalesStart.Value;
        hotelInfoDBEntity.SalesEndDT = dpSalesEnd.Value;

        _hotelinfoEntity.HotelInfoDBEntity.Add(hotelInfoDBEntity);
        int iResult = HotelInfoBP.UpdateHotelSalesList(_hotelinfoEntity);

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

        commonDBEntity.Event_Type = "酒店签约信息-保存";
        commonDBEntity.Event_ID = hidHotelID.Value;
        string conTent = GetLocalResourceObject("EventInsertSalesMessage").ToString();

        conTent = string.Format(conTent, hotelInfoDBEntity.HotelID, hotelInfoDBEntity.Name_CN, hotelInfoDBEntity.Fax, hotelInfoDBEntity.Phone, hotelInfoDBEntity.ContactPer, hotelInfoDBEntity.ContactEmail, hotelInfoDBEntity.SalesID, hotelInfoDBEntity.SalesStartDT, hotelInfoDBEntity.SalesEndDT);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSalesSuccess").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateSalesSuccess").ToString();
            BindSalesManagerListGrid();
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateSalesError2").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateSalesError2").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("UpdateError13").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("UpdateError13").ToString();
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
        RestBalGridData();
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "SetSalesControlVal()", true);
    }