Beispiel #1
0
 public static DataSet CheckCity(CityEntity cityEntity)
 {
     OracleParameter[] parm ={
                             new OracleParameter("CITYID",OracleType.VarChar)
                         };
     CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();
     parm[0].Value = dbParm.CityID;
     return  HotelVp.Common.DBUtility.DbManager.Query("City", "t_fc_city_sigle",false, parm);
 }
Beispiel #2
0
 public static CityEntity FOGMainSelect(CityEntity cityEntity)
 {
     OracleParameter[] parm ={
                             new OracleParameter("CITYID",OracleType.VarChar)
                         };
     CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();
     parm[0].Value = dbParm.CityID;
     cityEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("City", "t_lm_b_city_main_fog", false, parm);
     return cityEntity;
 }
Beispiel #3
0
        public static int CheckInsert(CityEntity cityEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("CITYID",OracleType.VarChar)
                                };
            CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();
            parm[0].Value = dbParm.CityID;
            cityEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("City", "t_lm_b_city_sigle", false, parm);

            if (cityEntity.QueryResult.Tables.Count > 0 && cityEntity.QueryResult.Tables[0].Rows.Count > 0)
            {
                return 1;
            }
            return 0;
        }
Beispiel #4
0
        public static int Insert(CityEntity cityEntity)
        {
            cityEntity.LogMessages.MsgType = MessageType.INFO;
            cityEntity.LogMessages.Content = _nameSpaceClass + "Insert";
            LoggerHelper.LogWriter(cityEntity.LogMessages);

            try
            {
                return CityDA.Insert(cityEntity);
            }
            catch (Exception ex)
            {
                cityEntity.LogMessages.MsgType = MessageType.ERROR;
                cityEntity.LogMessages.Content = _nameSpaceClass + "Insert  Error: " + ex.Message;
                LoggerHelper.LogWriter(cityEntity.LogMessages);
                throw ex;
            }
        }
Beispiel #5
0
        public static CityEntity CommonSelectFogToCity(CityEntity cityEntity)
        {
            cityEntity.LogMessages.MsgType = MessageType.INFO;
            cityEntity.LogMessages.Content = _nameSpaceClass + "CommonSelectFogToCity";
            LoggerHelper.LogWriter(cityEntity.LogMessages);

            try
            {
                return CityDA.SelectFogToCity(cityEntity);
            }
            catch (Exception ex)
            {
                cityEntity.LogMessages.MsgType = MessageType.ERROR;
                cityEntity.LogMessages.Content = _nameSpaceClass + "CommonSelectFogToCity  Error: " + ex.Message;
                LoggerHelper.LogWriter(cityEntity.LogMessages);
                throw ex;
            }
        }
Beispiel #6
0
        public static int Insert(CityEntity cityEntity)
        {
            if (cityEntity.CityDBEntity.Count == 0)
            {
                return 0;
            }

            if (cityEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckInsert(cityEntity) > 0)
            {
                return 2;
            }

            DataSet dsCity = CheckCity(cityEntity);
            if (dsCity.Tables.Count == 0 || dsCity.Tables[0].Rows.Count == 0)
            {
                return 3;
            }

            CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();

            //List<CommandInfo> sqlList = new List<CommandInfo>();
            //CommandInfo InsertLmCityInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("CITYID",OracleType.VarChar)
                                    //,
                                    //new OracleParameter("Name_CN",OracleType.VarChar),
                                    //new OracleParameter("Name_EN",OracleType.VarChar),
                                    //new OracleParameter("Area_ID",OracleType.VarChar)
                                };

            lmParm[0].Value = getMaxIDfromSeq("T_LM_B_CITY_SEQ");
            lmParm[1].Value = dbParm.CityID;
            //lmParm[2].Value = dsCity.Tables[0].Rows[0]["name_zh"].ToString();
            //lmParm[3].Value = dsCity.Tables[0].Rows[0]["name_en"].ToString();
            //lmParm[4].Value = dsCity.Tables[0].Rows[0]["areaid"].ToString();
            //InsertLmCityInfo.SqlName = "City";
            //InsertLmCityInfo.SqlId = "t_lm_b_city_insert";
            //InsertLmCityInfo.Parameters = lmParm;

            DbManager.ExecuteSql("City", "t_lm_b_city_insert", lmParm);

            //CommandInfo InsertCsCityInfo = new CommandInfo();

            //OracleParameter[] csParm ={
            //                        new OracleParameter("ID",OracleType.Number),
            //                        new OracleParameter("CITYID",OracleType.VarChar),
            //                        new OracleParameter("ONLINESTATUS",OracleType.VarChar)
            //                    };

            //csParm[0].Value = getMaxIDfromSeq("T_CS_CITY_SEQ");
            //csParm[1].Value = lmParm[0].Value;
            //csParm[2].Value = "0";
            //InsertCsCityInfo.SqlName = "City";
            //InsertCsCityInfo.SqlId = "t_cs_city_insert";
            //InsertCsCityInfo.Parameters = csParm;

            //sqlList.Add(InsertLmCityInfo);
            //sqlList.Add(InsertCsCityInfo);
            //DbManager.ExecuteSqlTran(sqlList);

            //DataCommand cmd = DataCommandManager.GetDataCommand("InsertCityList");
            //foreach (CityDBEntity dbParm in cityEntity.CityDBEntity)
            //{
            //    cmd.SetParameterValue("@ChannelID", dbParm.ChannelID);
            //    cmd.SetParameterValue("@NameCN", dbParm.Name_CN);
            //    cmd.SetParameterValue("@NameEN", PinyinHelper.GetPinyin(dbParm.Name_CN));
            //    cmd.SetParameterValue("@OnlineStatus", dbParm.OnlineStatus);
            //    cmd.SetParameterValue("@Remark", dbParm.Remark);
            //    cmd.SetParameterValue("@CreateUser", (cityEntity.LogMessages != null) ? cityEntity.LogMessages.Userid : "");
            //    cmd.SetParameterValue("@UpdateUser", (cityEntity.LogMessages != null) ? cityEntity.LogMessages.Userid : "");
            //    cmd.ExecuteNonQuery();
            //}

            return 1;
        }
Beispiel #7
0
 public static CityEntity CommonSelect(CityEntity cityEntity)
 {
     cityEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("City", "t_fc_city", false);
     return cityEntity;
 }
Beispiel #8
0
        public static int Update(CityEntity cityEntity)
        {
            if (cityEntity.CityDBEntity.Count == 0)
            {
                return 0;
            }

            if (cityEntity.LogMessages == null)
            {
                return 0;
            }

            OracleParameter[] parm ={
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("ELCITYID",OracleType.VarChar),
                                    new OracleParameter("NAMECN",OracleType.VarChar),
                                    new OracleParameter("SEQ",OracleType.VarChar),
                                    new OracleParameter("PINYIN",OracleType.VarChar),
                                    new OracleParameter("PINYINSHORT",OracleType.VarChar),
                                    new OracleParameter("LONGITUDE",OracleType.VarChar),
                                    new OracleParameter("LATITUDE",OracleType.VarChar),
                                    new OracleParameter("ONLINESTATUS",OracleType.VarChar),
                                    new OracleParameter("TYPE",OracleType.VarChar),
                                    new OracleParameter("ISHOT",OracleType.VarChar),
                                    new OracleParameter("SALEHOUR",OracleType.VarChar)
                                };

            CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();

            parm[0].Value = dbParm.CityID;
            parm[1].Value = dbParm.ElCityID;
            parm[2].Value = dbParm.Name_CN;
            parm[3].Value = dbParm.SEQ;
            parm[4].Value = dbParm.Pinyin;
            parm[5].Value = dbParm.PinyinS;
            parm[6].Value = dbParm.Longitude;
            parm[7].Value = dbParm.Latitude;
            parm[8].Value = dbParm.OnlineStatus;
            parm[9].Value = dbParm.CityType;
            parm[10].Value = dbParm.IsHot;
            parm[11].Value = dbParm.SaleHour;
            DbManager.ExecuteSql("City", "t_lm_b_city_update", parm);
            //DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCityList");
            //foreach (CityDBEntity dbParm in cityEntity.CityDBEntity)
            //{
            //    cmd.SetParameterValue("@ChannelNo", dbParm.ChannelNo);
            //    cmd.SetParameterValue("@ChannelID", dbParm.ChannelID);
            //    cmd.SetParameterValue("@NameCN", dbParm.Name_CN);
            //    cmd.SetParameterValue("@NameEN", PinyinHelper.GetPinyin(dbParm.Name_CN));
            //    cmd.SetParameterValue("@OnlineStatus", dbParm.OnlineStatus);
            //    cmd.SetParameterValue("@Remark", dbParm.Remark);
            //    cmd.SetParameterValue("@UpdateUser", (cityEntity.LogMessages != null) ? cityEntity.LogMessages.Userid : "");
            //    cmd.ExecuteNonQuery();
            //}
            return 1;
        }
Beispiel #9
0
        public static CityEntity SelectFogToCity(CityEntity cityEntity)
        {
            //改参数
            OracleParameter[] parm ={
                                    new OracleParameter("name_zh",OracleType.VarChar),
                                    new OracleParameter("name_en",OracleType.VarChar),
                                    new OracleParameter("pinyin_short",OracleType.VarChar)
                                };
            CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();

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

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

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

            cityEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("City", "fog_t_city", false, parm);
            return cityEntity;
        }
Beispiel #10
0
        public static CityEntity Select(CityEntity cityEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("CITYNAME",OracleType.VarChar),
                                    new OracleParameter("ONLINESTATUS",OracleType.VarChar),
                                    new OracleParameter("StartDTime",OracleType.VarChar),
                                    new OracleParameter("EndDTime",OracleType.VarChar)
                                };
            CityDBEntity dbParm = (cityEntity.CityDBEntity.Count > 0) ? cityEntity.CityDBEntity[0] : new CityDBEntity();

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

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

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

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

            cityEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("City", "t_lm_b_city", false, parm);
            return cityEntity;
        }
    //protected void gridViewCSReviewUserList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    //{
    //    string strID = gridViewCSReviewUserList.DataKeys[e.RowIndex].Value.ToString();
    //    _userEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
    //    _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
    //    _userEntity.LogMessages.Userid = UserSession.Current.UserAccount;
    //    _userEntity.LogMessages.Username = UserSession.Current.UserDspName;
    //    _userEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
    //    _userEntity.UserDBEntity = new List<UserDBEntity>();
    //    UserDBEntity usergroupEntity = new UserDBEntity();
    //    usergroupEntity.UserNo = strID;
    //    _userEntity.UserDBEntity.Add(usergroupEntity);
    //    int iResult = UserGroupBP.DeleteConsultRoomUser(_userEntity);
    //    _commonEntity.LogMessages = _userEntity.LogMessages;
    //    _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
    //    CommonDBEntity commonDBEntity = new CommonDBEntity();
    //    commonDBEntity.Event_Type = "巡房条件-删除";
    //    commonDBEntity.Event_ID = hidUserID.Value.ToString().Trim();
    //    string conTent = GetLocalResourceObject("EventDeleteMessage").ToString();
    //    conTent = string.Format(conTent, usergroupEntity.UserNo);
    //    commonDBEntity.Event_Content = conTent;
    //    if (iResult == 1)
    //    {
    //        commonDBEntity.Event_Result = GetLocalResourceObject("DelSuccess").ToString();
    //        messageContent.InnerHtml = GetLocalResourceObject("DelSuccess").ToString();
    //        BindReviewUserListGrid();
    //        //ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "BtnDelCompleteStyle();", true);
    //    }
    //    else
    //    {
    //        commonDBEntity.Event_Result = GetLocalResourceObject("Error5").ToString();
    //        messageContent.InnerHtml = GetLocalResourceObject("Error5").ToString();
    //    }
    //    _commonEntity.CommonDBEntity.Add(commonDBEntity);
    //    CommonBP.InsertEventHistory(_commonEntity);
    //}
    /// <summary>
    /// 分配所有  城市 下面  所有酒店  到 该用户名下
    /// 获取 该用户已绑定信息   获取所有城市    绑定到该用户名下
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAllotAllCitys_Click(object sender, EventArgs e)
    {
        #region  判断是否 有用户
        if (String.IsNullOrEmpty(hidSelecUserID.Value.Trim()))
        {
            messageContent.InnerHtml = "订单审核任务分配绑定城市失败,请选择用户!";
            ScriptManager.RegisterStartupScript(this.UpdatePanel2, this.GetType(), "updateScript", "BtnCompleteStyle();", true);
            return;
        }

        if (!hidSelecUserID.Value.Trim().Contains("[") || !hidSelecUserID.Value.Trim().Contains("]"))
        {
            messageContent.InnerHtml = "订单审核任务分配绑定城市失败,请选择用户!";
            ScriptManager.RegisterStartupScript(this.UpdatePanel2, this.GetType(), "updateScript", "BtnCompleteStyle();", true);
            return;
        }
        #endregion

        hidUserID.Value = hidSelecUserID.Value;

        #region   获取该用户 已绑定的 城市 酒店 商圈 信息
        _userEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _userEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _userEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _userEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _userEntity.UserDBEntity = new List<UserDBEntity>();
        UserDBEntity usergroupEntity = new UserDBEntity();
        usergroupEntity.UserID = hidUserID.Value.Trim().Substring((hidUserID.Value.Trim().IndexOf('[') + 1), (hidUserID.Value.Trim().IndexOf(']') - 1));
        _userEntity.UserDBEntity.Add(usergroupEntity);
        DataSet dsResult = UserSearchBP.ReviewConsultPOrderUserSelect(_userEntity).QueryResult;//用户绑定信息
        #endregion

        #region 获取所有城市
        CityEntity _cityEntity = new CityEntity();
        _cityEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cityEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cityEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cityEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _cityEntity.CityDBEntity = new List<CityDBEntity>();
        CityDBEntity cityDBEntity = new CityDBEntity();
        _cityEntity.CityDBEntity.Add(cityDBEntity);

        DataSet dsCityResult = CityBP.Select(_cityEntity).QueryResult;
        #endregion

        for (int i = 0; i < dsCityResult.Tables[0].Rows.Count; i++)
        {
            DataRow[] rows = dsResult.Tables[0].Select("CONSULTVAL='" + dsCityResult.Tables[0].Rows[i]["CONSULTVAL"].ToString() + "'");
            if (rows.Length == 0)//当前城市没有绑定   将该城市 绑定到该用户下面
            {
                string CityID = dsCityResult.Tables[0].Rows[i]["cityID"].ToString();

                #region  保存城市  记录日志
                _userEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
                _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
                _userEntity.LogMessages.Userid = UserSession.Current.UserAccount;
                _userEntity.LogMessages.Username = UserSession.Current.UserDspName;
                _userEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

                _userEntity.UserDBEntity = new List<UserDBEntity>();
                usergroupEntity = new UserDBEntity();
                usergroupEntity.UserID = hidUserID.Value.Trim().Substring((hidUserID.Value.Trim().IndexOf('[') + 1), (hidUserID.Value.Trim().IndexOf(']') - 1));
                usergroupEntity.CityID = CityID;
                usergroupEntity.RType = "0";//城市
                _userEntity.UserDBEntity.Add(usergroupEntity);

                int iResult = UserGroupBP.InsertConsultPOrderUser(_userEntity);

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

                commonDBEntity.Event_Type = "订单审核任务分配-All-批量城市-保存";
                commonDBEntity.Event_ID = hidUserID.Value.ToString().Trim();
                string conTent = GetLocalResourceObject("EventInsertMessage").ToString();
                string conval = usergroupEntity.CityID;

                conTent = string.Format(conTent, usergroupEntity.UserID, usergroupEntity.RType, conval);
                commonDBEntity.Event_Content = conTent;

                if (iResult == 1)
                {
                    commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
                }
                else if (iResult == 2)
                {
                    commonDBEntity.Event_Result = GetLocalResourceObject("Error2").ToString();
                }
                else if (iResult == 3)
                {
                    commonDBEntity.Event_Result = GetLocalResourceObject("Error3").ToString();
                }
                else
                {
                    commonDBEntity.Event_Result = GetLocalResourceObject("Error4").ToString();
                }
                _commonEntity.CommonDBEntity.Add(commonDBEntity);
                CommonBP.InsertEventHistory(_commonEntity);
                #endregion
            }
        }
        ScriptManager.RegisterStartupScript(this.UpdatePanel2, this.GetType(), "updateScriptAll", "BtnCompleteStyle();", true);
    }