Пример #1
0
        /// <summary>
        /// 初始值绑定
        /// </summary>
        private void InitData()
        {
            DataTable     dtHotel = new DataTable();
            StringBuilder sbHotel = new StringBuilder();

            sbHotel.Append("select id,name from Hotel where AdminHotelid= @AdminHotelid order by sort asc");
            SqlParam[] paramHotel = new SqlParam[] { new SqlParam("AdminHotelid", HotelAdmin.Value) };
            dtHotel = DataFactory.SqlDataBase().GetDataTableBySQL(sbHotel, paramHotel);
            rptHotelList.DataSource = dtHotel;
            rptHotelList.DataBind();

            CommonMethod.BindCredentials(Credentials_Type);

            #region ****** 菜单 权限 ******
            string sql = "SELECT * FROM Base_MenuGroup";
            menugroup_dt = DataFactory.SqlDataBase().GetDataTableBySQL(new StringBuilder(sql));

            DataTable mg_data = menugroup_dt.Clone();//拷贝框架
            DataRow[] dr      = menugroup_dt.Select("ParentId = '0'");
            for (int i = 0; i < dr.Count(); i++)
            {
                mg_data.ImportRow((DataRow)dr[i]);
            }
            rptMenuGroup.DataSource = mg_data;
            rptMenuGroup.DataBind();
            #endregion
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Hdhoteladmin.Value = RequestSession.GetSessionUser().AdminHotelid.ToString();
         CommonMethod.BindCredentials(Credentials_Type);
     }
 }
Пример #3
0
        /// <summary>
        /// 初始值绑定
        /// </summary>
        private void InitData()
        {
            #region ** 部门下拉框 **

            RM_UserInfo_IDAO user_idao = new RM_UserInfo_Dal();
            DataTable        dtOrg     = user_idao.GetOrganizeList(AdminHotelid.Value, HotelId.Value, "0");
            if (dtOrg != null && dtOrg.Rows.Count > 0)
            {
                dOrg.Visible          = true;
                ddlOrg.DataSource     = dtOrg;
                ddlOrg.DataTextField  = "Organization_Name";
                ddlOrg.DataValueField = "Organization_ID";
                ddlOrg.DataBind();
                ddlOrg.Items.Insert(0, new ListItem("==请选择==", ""));
            }
            else
            {
                dOrg.Visible = false;
            }
            #endregion

            CommonMethod.BindCredentials(Credentials_Type);
            #region  ****** 角色下拉框 ******

            DataTable  dt       = new DataTable();
            string     sql_role = "SELECT Roles_ID,Roles_Name FROM Base_Roles WHERE Hotel_Id = @Hotel_Id";
            SqlParam[] param    = new SqlParam[] { new SqlParam("Hotel_Id", HotelId.Value) };

            dt = DataFactory.SqlDataBase().GetDataTableBySQL(new StringBuilder(sql_role), param);
            ddlUser_Role.DataTextField  = "Roles_Name";
            ddlUser_Role.DataValueField = "Roles_ID";
            ddlUser_Role.DataSource     = dt;
            ddlUser_Role.DataBind();


            #endregion
            return;
            //#region ****** 菜单 权限 ******
            //string sql = "SELECT * FROM Base_MenuGroup ORDER BY SortCode";
            //menugroup_dt = DataFactory.SqlDataBase().GetDataTableBySQL(new StringBuilder(sql));

            //DataTable mg_data = menugroup_dt.Clone();//拷贝框架
            //DataRow[] dr = menugroup_dt.Select("ParentId = '0'");
            //for (int i = 0; i < dr.Count(); i++)
            //{
            //    mg_data.ImportRow((DataRow)dr[i]);
            //}
            //rptMenuGroup.DataSource = mg_data;
            //rptMenuGroup.DataBind();
            //#endregion
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Hdhoteladmin.Value = RequestSession.GetSessionUser().AdminHotelid.ToString();
                bool   blHotelTree = false; //是否有多分店权限 多店显示酒店树
                string HotelId     = "";    //如果只有一家店 默认的酒店ID

                if (RequestSession.GetSessionUser().Hotelid.ToString() == "0")
                {
                    hotelTreeHtml = HotelTreeHelper.HotelTree(Hdhoteladmin.Value, 1, out blHotelTree, out HotelId);
                }
                else
                {
                    blHotelTree = false;
                    HotelId     = RequestSession.GetSessionUser().Hotelid.ToString();
                }
                HotelTree.Visible = blHotelTree;
                htHotelTree.Value = blHotelTree.ToString();
                hdHotelId.Value   = HotelId;

                CommonMethod.BindCredentials(Credentials_Type);
            }
        }