public void BindReviewLmSystemLogListGrid()
    {
        HotelBlackEntity _hotelblackEntity = new HotelBlackEntity();
        _hotelblackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _hotelblackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _hotelblackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _hotelblackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _hotelblackEntity.HotelBlackDBEntity = new List<HotelBlackDBEntity>();
        HotelBlackDBEntity hotelblackdbEntity = new HotelBlackDBEntity();

        if (ViewState["strHotel"].ToString() != "") { hotelblackdbEntity.HotelId = ViewState["strHotel"].ToString(); }
        hotelblackdbEntity.Source = this.DropChannel.SelectedValue;

        _hotelblackEntity.HotelBlackDBEntity.Add(hotelblackdbEntity);
        _hotelblackEntity.PageCurrent = AspNetPager1.CurrentPageIndex;
        _hotelblackEntity.PageSize = gridHotelList.PageSize;

        DataSet dsResult = HotelBlackBP.GetHotelBlackList(_hotelblackEntity).QueryResult;

        this.gridHotelList.DataSource = dsResult.Tables[0].DefaultView;
        this.gridHotelList.DataBind();

        AspNetPager1.PageSize = gridHotelList.PageSize;
        AspNetPager1.RecordCount = CountLmSystemLog();
    }
        public static int DeleteHotelBlackList(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                        new OracleParameter("ID",OracleType.Number)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

            if (String.IsNullOrEmpty(dbParm.ID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.ID;
            }
            DbManager.ExecuteSql("HotelBlackList", "t_lm_hotel_blacklist_delete", parm);
            return 1;
        }
        public static int InsertHotelBlackList(HotelBlackEntity hotelblackEntity)
        {
            hotelblackEntity.LogMessages.MsgType = MessageType.INFO;
            hotelblackEntity.LogMessages.Content = _nameSpaceClass + "InsertHotelBlackList";
            LoggerHelper.LogWriter(hotelblackEntity.LogMessages);

            try
            {
                return HotelBlackDA.InsertHotelBlackList(hotelblackEntity);
            }
            catch (Exception ex)
            {
                hotelblackEntity.LogMessages.MsgType = MessageType.ERROR;
                hotelblackEntity.LogMessages.Content = _nameSpaceClass + "InsertHotelBlackList  Error: " + ex.Message;
                LoggerHelper.LogWriter(hotelblackEntity.LogMessages);
                throw ex;
            }
        }
    public int CountLmSystemLog()
    {
        HotelBlackEntity _hotelblackEntity = new HotelBlackEntity();
        _hotelblackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _hotelblackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _hotelblackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _hotelblackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _hotelblackEntity.HotelBlackDBEntity = new List<HotelBlackDBEntity>();
        HotelBlackDBEntity hotelblackdbEntity = new HotelBlackDBEntity();

        if (ViewState["strHotel"].ToString() != "") { hotelblackdbEntity.HotelId = ViewState["strHotel"].ToString(); }
        hotelblackdbEntity.Source = this.DropChannel.SelectedValue;
        DataSet dsResult = HotelBlackBP.GetHotelBlackListByCount(_hotelblackEntity).QueryResult;
        if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0 && !String.IsNullOrEmpty(dsResult.Tables[0].Rows[0][0].ToString()))
        {
            return int.Parse(dsResult.Tables[0].Rows[0][0].ToString());
        }

        return 0;
    }
        public static HotelBlackEntity GetHotelBlackList(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("SOURCE",OracleType.VarChar),
                                    new OracleParameter("ISBLACK",OracleType.VarChar)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

            if (String.IsNullOrEmpty(dbParm.HotelId))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.HotelId; ;
            }
            if (String.IsNullOrEmpty(dbParm.Source))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.Source; ;
            }
            if (String.IsNullOrEmpty(dbParm.IsBlack))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.IsBlack; ;
            }
            string SqlString = XmlSqlAnalyze.GotSqlTextFromXml("HotelBlackList", "t_lm_hotel_blacklist_search");
            //hotelblackEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("HotelBlackList", "t_lm_hotel_blacklist_search", true, parm);
            hotelblackEntity.QueryResult = DbManager.Query(SqlString, parm, (hotelblackEntity.PageCurrent - 1) * hotelblackEntity.PageSize, hotelblackEntity.PageSize, true);

            return hotelblackEntity;
        }
        public static HotelBlackEntity GetHotelBlackListByCount(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("SOURCE",OracleType.VarChar),
                                    new OracleParameter("ISBLACK",OracleType.VarChar)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

            if (String.IsNullOrEmpty(dbParm.HotelId))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.HotelId; ;
            }
            if (String.IsNullOrEmpty(dbParm.Source))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.Source; ;
            }
            if (String.IsNullOrEmpty(dbParm.IsBlack))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.IsBlack; ;
            }
            hotelblackEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("HotelBlackList", "t_lm_hotel_blacklist_search_bycount", true, parm);

            return hotelblackEntity;
        }
    protected void gridHotelList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        MessageContent.InnerHtml = "";
        HotelBlackEntity _hotelblackEntity = new HotelBlackEntity();
        _hotelblackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _hotelblackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _hotelblackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _hotelblackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _hotelblackEntity.HotelBlackDBEntity = new List<HotelBlackDBEntity>();
        HotelBlackDBEntity hotelblackdbEntity = new HotelBlackDBEntity();

        string isBlack = gridHotelList.DataKeys[e.RowIndex].Values[1].ToString();
        hotelblackdbEntity.ID = gridHotelList.DataKeys[e.RowIndex].Values[0].ToString();
        hotelblackdbEntity.IsBlack = isBlack == "黑名单" ? "0" : "1";
        _hotelblackEntity.HotelBlackDBEntity.Add(hotelblackdbEntity);
        //删除
        //int i = HotelBlackBP.DeleteHotelBlackList(_hotelblackEntity);
        //MessageContent.InnerHtml = i == 1 ? "黑名单酒店删除成功!" : "黑名单酒店删除失败!";
        //修改
        int i = HotelBlackBP.UpdateHotelBlackList(_hotelblackEntity);
        MessageContent.InnerHtml = i == 1 ? "黑名单酒店处理成功!" : "黑名单酒店处理失败!";
        //btnSearch_Click(null, null);
        ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnDeleteE", "BtnCompleteStyle();", true);

        ScriptManager.RegisterStartupScript(this.UpdatePanel2, this.GetType(), "keyDeleteClickEvent1", "btnSeachClick()", true);
    }
    protected void btnUpdateHotelBlack_Click(object sender, EventArgs e)
    {
        string strHotel = wctHotelDiv.AutoResult;
        this.HidHotelValue.Value = strHotel;
        strHotel = strHotel.Substring((strHotel.IndexOf('[') + 1), (strHotel.IndexOf(']') - 1));

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

        _hotelblackEntity.HotelBlackDBEntity = new List<HotelBlackDBEntity>();
        HotelBlackDBEntity hotelblackdbEntity = new HotelBlackDBEntity();
        hotelblackdbEntity.HotelId = strHotel;
        hotelblackdbEntity.Source = this.DropChannelDiv.SelectedValue;
        hotelblackdbEntity.IsBlack = "1";//0和空为白名单 ; 1=黑名单
        hotelblackdbEntity.UpdateUser = UserSession.Current.UserDspName;
        _hotelblackEntity.HotelBlackDBEntity.Add(hotelblackdbEntity);
        int i = HotelBlackBP.UpdateHotelBlackListByExist(_hotelblackEntity);
        MessageContent.InnerHtml = i == 1 ? "黑名单酒店添加成功!" : "黑名单酒店添加失败!";
        ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnAdd", "BtnCompleteStyle();", true);
        ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "keyClickEvent2", "btnSeachClick()", true);
    }
    /// <summary>
    /// 添加黑名单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAddHotelBlack_Click(object sender, EventArgs e)
    {
        MessageContent.InnerHtml = "";
        string strHotel = wctHotelDiv.AutoResult;
        this.HidHotelValue.Value = strHotel;
        strHotel = strHotel.Substring((strHotel.IndexOf('[') + 1), (strHotel.IndexOf(']') - 1));

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

        _hotelblackEntity.HotelBlackDBEntity = new List<HotelBlackDBEntity>();
        HotelBlackDBEntity hotelblackdbEntity = new HotelBlackDBEntity();

        hotelblackdbEntity.HotelId = strHotel;
        hotelblackdbEntity.Source = this.DropChannelDiv.SelectedValue;
        _hotelblackEntity.HotelBlackDBEntity.Add(hotelblackdbEntity);
        DataTable dtResult = HotelBlackBP.RepeatHotelBlackList(_hotelblackEntity).QueryResult.Tables[0];
        _hotelblackEntity.HotelBlackDBEntity.Clear();
        if (dtResult != null && dtResult.Rows.Count > 0)
        {
            //MessageContentDiv.InnerHtml = "该酒店已存在!";
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnAdd2", "invokeOpen3();", true);
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnAdd3", "btnConfirm('" + dtResult.Rows[0]["is_black"].ToString().Replace("1", "黑名单").Replace("0", "白名单") + "');", true);
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnSet", "SetControlValue2();", true);
            return;
        }
        this.HidHotelValue.Value = "";
        hotelblackdbEntity.HotelId = strHotel;
        hotelblackdbEntity.Source = this.DropChannelDiv.SelectedValue;
        hotelblackdbEntity.IsBlack = "1";//0和空为白名单 ; 1=黑名单
        hotelblackdbEntity.CreateUser = UserSession.Current.UserDspName;
        _hotelblackEntity.HotelBlackDBEntity.Add(hotelblackdbEntity);
        int i = HotelBlackBP.InsertHotelBlackList(_hotelblackEntity);
        MessageContent.InnerHtml = i == 1 ? "黑名单酒店添加成功!" : "黑名单酒店添加失败!";
        ScriptManager.RegisterStartupScript(Page, this.GetType(), "btnAdd", "BtnCompleteStyle();", true);
        //btnSearch_Click(null, null);
        ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "keyClickEvent2", "btnSeachClick()", true);
    }
Esempio n. 10
0
        public static int UpdateHotelBlackListByExist(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                        new OracleParameter("ISBLACK",OracleType.VarChar),
                                        new OracleParameter("HOTELID",OracleType.VarChar),
                                        new OracleParameter("SOURCE",OracleType.VarChar),
                                        new OracleParameter("UPDATEUSER",OracleType.VarChar)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

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

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

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

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

            DbManager.ExecuteSql("HotelBlackList", "t_lm_hotel_blacklist_update_exist", parm);
            return 1;
        }
Esempio n. 11
0
        public static HotelBlackEntity RepeatHotelBlackList(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                        new OracleParameter("HOTELID",OracleType.VarChar),
                                        new OracleParameter("SOURCE",OracleType.VarChar)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

            parm[0].Value = dbParm.HotelId;
            parm[1].Value = dbParm.Source;

            hotelblackEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("HotelBlackList", "t_lm_hotel_blacklist_repeat", true, parm);

            return hotelblackEntity;
        }
Esempio n. 12
0
        public static int InsertHotelBlackList(HotelBlackEntity hotelblackEntity)
        {
            OracleParameter[] parm ={
                                        new OracleParameter("ID",OracleType.Number),
                                        new OracleParameter("HOTELID",OracleType.VarChar),
                                        new OracleParameter("ISBLACK",OracleType.VarChar),
                                        new OracleParameter("SOURCE",OracleType.VarChar),
                                        new OracleParameter("CREATEUSER",OracleType.VarChar)
                                };
            HotelBlackDBEntity dbParm = (hotelblackEntity.HotelBlackDBEntity.Count > 0) ? hotelblackEntity.HotelBlackDBEntity[0] : new HotelBlackDBEntity();

            parm[0].Value = getMaxIDfromSeq("t_lm_hotel_blacklist_SEQ");

            //:ID,:HOTELID,:ISBLACK,:SOURCE,sysdate,:CREATEUSER
            if (String.IsNullOrEmpty(dbParm.HotelId))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.HotelId;
            }
            if (String.IsNullOrEmpty(dbParm.IsBlack))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.IsBlack;
            }
            if (String.IsNullOrEmpty(dbParm.Source))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.Source;
            }
            if (String.IsNullOrEmpty(dbParm.CreateUser))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.CreateUser;
            }

            DbManager.ExecuteSql("HotelBlackList", "t_lm_hotel_blacklist_insert", parm);
            return 1;
        }