Esempio n. 1
0
 private void BindGrid2()
 {
     try
     {
         if (roleId > 0)
         {
             using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "M_ID,M_NAME,M_CODE,M_LEVEL", "[S_MENU]", "WHERE M_DISABLED=0", "ORDER BY M_ORDERPATH ASC"))
             {
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     purviewCodeData  = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "MPC_NAME,MPC_CODE,M_ID", "S_MENU_PURVIEWCODE", "WHERE MPC_DISABLED=0", "ORDER BY MPC_ID ASC");
                     Grid2.DataSource = dt;
                     Grid2.DataBind();
                     InitPermission();
                 }
             }
         }
         else
         {
             Alert.ShowInParent("参数错误!", String.Empty, ActiveWindow.GetHideReference());
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.R.MManage.BindGrid2():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 2
0
 //页面数据加载
 private void BindData()
 {
     try
     {
         StringBuilder condition = new StringBuilder();
         if (string.IsNullOrEmpty(this.ttbSearchUser.Text))
         {
             condition.Append("");
         }
         else
         {
             condition.Append(" where CName like'%" + this.ttbSearchUser.Text + "%' ");
         }
         int recordCount = 0;
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "*", "[view_person]", condition.ToString(), "ORDER BY ID asc", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
         {
             Grid1.RecordCount = recordCount;
             Grid1.DataSource  = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("X.MessageList.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 3
0
 private void BindData()
 {
     try
     {
         StringBuilder condition = new StringBuilder("WHERE 1=1");  //去除用户为系统管理员
         string        name      = StringHelper.ClearSqlStringExSpace(ttbSearchUser.Text.Trim());
         if (name.Length > 0)
         {
             condition.AppendFormat(" AND (U_NAME like'%{0}%' OR U_REALNAME like'%{0}%')", name);
         }
         string orderExp    = "ORDER BY " + Grid1.SortField + " " + Grid1.SortDirection;
         int    recordCount = 0;
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "U_ID,U_NAME,U_REALNAME,U_DISABLED,U_EMAIL,U_MOBILE,U_TEL,U_PREVLOGINTIME,U_PREVLOGINIP", "[S_USER]", condition.ToString(), orderExp, Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
         {
             Grid1.RecordCount = recordCount;
             Grid1.DataSource  = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.U.Manage.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 4
0
 private void BindData()
 {
     try
     {
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "M_ID,M_NAME,M_LEVEL,M_CODE,M_DISABLED", "[S_MENU]", String.Empty, "ORDER BY M_ORDERPATH ASC"))
         {
             Grid1.DataSource = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.M.Manage.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "M_ID,M_NAME,M_LEVEL", "[S_MENU]", "WHERE M_DISABLED=0", "ORDER BY M_ORDERPATH ASC"))
         {
             if (dt != null && dt.Rows.Count > 0)
             {
                 ddlParentId.DataSource                 = dt;
                 ddlParentId.DataTextField              = "M_NAME";
                 ddlParentId.DataValueField             = "M_ID";
                 ddlParentId.DataSimulateTreeLevelField = "M_LEVEL";
                 ddlParentId.DataBind();
             }
         }
         ddlParentId.Items.Insert(0, new FineUI.ListItem("≡ 作为一级菜单 ≡", "0", true));
     }
 }
Esempio n. 6
0
 private void BindRole()
 {
     try
     {
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "R_ID,R_NAME", "[S_ROLE]", String.Empty, "ORDER BY R_ORDERID ASC")) //去除系统管理员
         {
             cblRole.DataTextField  = "R_NAME";
             cblRole.DataValueField = "R_ID";
             cblRole.DataSource     = dt;
             cblRole.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.U.SelectRole.BindRole():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 7
0
        private void LoadInfo()
        {
            int id = RequestHelper.GetRequestInt("id", 0);

            if (id > 0)
            {
                UserModel model = new UserBLL().GetModelById(id);
                if (model != null)
                {
                    labName.Text       = HttpUtility.HtmlDecode(model.Name);
                    labRealName.Text   = HttpUtility.HtmlDecode(model.RealName);
                    labEmail.Text      = HttpUtility.HtmlDecode(model.Email);
                    labMobile.Text     = HttpUtility.HtmlDecode(model.Mobile);
                    labPhone.Text      = HttpUtility.HtmlDecode(model.Tel);
                    imgShowStatus.Icon = model.Disabled ? Icon.Tick : Icon.BulletCross;
                    StringBuilder sbText = new StringBuilder();
                    using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "R_NAME", "[S_ROLE_USER] a JOIN [S_ROLE] b ON b.R_ID=a.R_ID", "WHERE a.U_ID=" + id, "ORDER BY a.R_ID ASC"))
                    {
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            foreach (DataRow role in dt.Rows)
                            {
                                sbText.AppendFormat("{0},", role["R_NAME"]);
                            }
                            labRole.Text = sbText.ToString().TrimEnd(',');
                        }
                    }
                    labPT.Text  = model.PrevLoginTime.HasValue ? model.PrevLoginTime.Value.ToString() : "";
                    labPIP.Text = HttpUtility.HtmlDecode(model.PrevLoginIP);
                    labLT.Text  = model.LastLoginTime.HasValue ? model.LastLoginTime.Value.ToString() : "";
                    labLIP.Text = HttpUtility.HtmlDecode(model.LastLoginIP);
                    labLTS.Text = model.LoginTimes.ToString();
                    labCT.Text  = model.CreateTime.Value.ToString();
                }
                else
                {
                    Alert.ShowInParent("读取数据失败!", String.Empty, ActiveWindow.GetHideReference());
                }
            }
            else
            {
                Alert.ShowInParent("参数错误!", String.Empty, ActiveWindow.GetHideReference());
            }
        }
Esempio n. 8
0
 /// <summary>
 /// 绑定数据
 /// </summary>
 public void BindData()
 {
     try
     {
         StringBuilder condition = new StringBuilder(" where Type='BD' ");
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, " HelpInfo ", "[MS_HelpPage]", condition.ToString(), ""))
         {
             if (dt.Rows.Count > 0)
             {
                 this.txtHelpInfo.Text = dt.Rows[0]["HelpInfo"].ToString();
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error("X.MessageList.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 9
0
        //页面数据加载
        private void BindData()
        {
            try
            {
                StringBuilder condition = new StringBuilder("");

                int recordCount = 0;
                using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "*", "[view_statistics]", condition.ToString(), "ORDER BY ID asc", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
                {
                    Grid1.RecordCount = recordCount;
                    Grid1.DataSource  = dt;
                    Grid1.DataBind();
                }
            }
            catch (Exception ex)
            {
                logger.Error("X.MessageList.BindData():Exception", ex);
                Alert.ShowInParent("系统错误。");
            }
        }
Esempio n. 10
0
 /// <summary>
 /// 绑定最后一条数据
 /// </summary>
 public void BindData()
 {
     try
     {
         StringBuilder condition = new StringBuilder("");
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "top 1 *", "[MS_Edition]", condition.ToString(), "ORDER BY createdtime desc"))
         {
             if (dt.Rows.Count > 0)
             {
                 this.txtNumber.Text  = dt.Rows[0]["version"].ToString();
                 this.txtEdition.Text = dt.Rows[0]["edition"].ToString();
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error("X.MessageList.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 11
0
 //页面数据加载
 private void BindData()
 {
     try
     {
         StringBuilder condition   = new StringBuilder("");
         string        id          = RequestHelper.GetRequestString("id", "");
         int           recordCount = 0;
         condition.AppendFormat("where Title_ID='{0}'", id);
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "*", "[TB_Comment]", condition.ToString(), "ORDER BY createdtime desc", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
         {
             Grid1.RecordCount = recordCount;
             Grid1.DataSource  = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("X.MessageList.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 12
0
 private void BindData()
 {
     txtID.Text          = "0";
     txtCode.Text        = String.Empty;
     txtName.Text        = String.Empty;
     chkDisabled.Checked = false;
     try
     {
         int recordCount = 0;
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "MPC_ID,MPC_NAME,MPC_CODE,MPC_DISABLED,M_NAME,M_CODE", "[S_MENU_PURVIEWCODE] mpc JOIN [S_MENU] m ON m.M_ID=mpc.M_ID", "WHERE mpc.M_ID=" + mid, "ORDER BY MPC_ID ASC", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
         {
             Grid1.RecordCount = recordCount;
             Grid1.DataSource  = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.M.PCManage.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 13
0
        //页面数据加载
        private void BindData()
        {
            try
            {
                id = RequestHelper.GetRequestString("id", "");
                StringBuilder condition = new StringBuilder("where 1=1");
                condition.AppendFormat(" and pageid='{0}' ", id);
                int recordCount = 0;

                using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "*", "[view_statistics_info]", condition.ToString(), " ORDER BY ID asc", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
                {
                    Grid1.RecordCount = recordCount;
                    Grid1.DataSource  = dt;
                    Grid1.DataBind();
                }
            }
            catch (Exception ex)
            {
                logger.Error("X.MessageList.BindData():Exception", ex);
                Alert.ShowInParent("系统错误。");
            }
        }
Esempio n. 14
0
 private void BindData()
 {
     try
     {
         StringBuilder condition = new StringBuilder("WHERE 1=1");
         string        key       = StringHelper.ClearSqlStringExSpace(ttbSearchKey.Text.Trim());
         if (key.Length > 0)
         {
             condition.AppendFormat(" AND [R_NAME] like '%{0}%'", key);
         }
         int recordCount = 0;
         using (DataTable dt = SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, "*", "[S_ROLE]", condition.ToString(), "ORDER BY R_ORDERID ASC", Grid1.PageIndex + 1, Grid1.PageSize, out recordCount))
         {
             Grid1.RecordCount = recordCount;
             Grid1.DataSource  = dt;
             Grid1.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error("S.R.Manage.BindData():Exception", ex);
         Alert.ShowInParent("系统错误。");
     }
 }
Esempio n. 15
0
        /// <summary>
        /// 根据报名id查询数据
        /// </summary>
        /// <param name="mid">报名id</param>
        /// <param name="id">0参加1取消2全部</param>
        /// <param name="type">类型(-1所有取消的活动(赛事/培训),0、赛事1、培训2、约吧)</param>
        /// <returns></returns>
        public DataTable GetTableCancel(int mid, int id, int type, int page, int row, out int recordCount)
        {
            recordCount = 0;

            try
            {
                StringBuilder where = new StringBuilder();
                //  where.AppendFormat(" m_id ={0}  and isactivaty={1}", mids, type);

                StringBuilder order = new StringBuilder();
                order.AppendFormat(" order by App_Application.createtime desc");

                StringBuilder cmdText  = new StringBuilder();
                StringBuilder cmdtable = new StringBuilder();
                if (type == 2)
                {
                    cmdtable.Append("App_Application left join View_About on App_Application.a_id=View_About.ab_id");
                    cmdText.Append("ap_id,ab_id,pic,AnOrangepic,IosOrangepic,title,View_About.address,number,View_About.sex,numberlimit,movement,begintime,specifictime");
                    where.Append("App_Application.m_id=" + mid + " and App_Application.state not in('-1') and App_Application.type=" + type + "  ");
                }
                else
                {
                    cmdtable.Append(" App_Application left join View_Activaty on App_Application.a_id=View_Activaty.a_id");
                    cmdText.Append("ap_id,View_Activaty.a_id,pic,App_Application.state,AnOrangepic,IosOrangepic,title,View_Activaty.address,movement,praise,eventname,isactivaty,App_Application.modifytime");
                    if (type == -1)
                    {
                        where.Append("App_Application.m_id=" + mid + " and App_Application.state  in('2','3','4','5')   and App_Application.type in('0','1') ");
                    }
                    else
                    {
                        if (id == 0)
                        {
                            where.Append("App_Application.m_id=" + mid + " and App_Application.state=1  and App_Application.type=" + type + "  ");
                        }
                        else if (id == 1)
                        {
                            where.Append("App_Application.m_id=" + mid + " and App_Application.state in('2','3','4','5') and App_Application.type=" + type + " ");
                        }
                        else
                        {
                            where.Append("App_Application.m_id=" + mid + " and App_Application.state not in('-1','0') and App_Application.type=" + type + "  ");
                        }
                    }
                }


                return(SqlPagerHelper.GetTableByCondition(DefaultConnection.ConnectionStringByDefaultDB, cmdText.ToString(), cmdtable.ToString(), where.ToString(), order.ToString(), page, row, out recordCount));
            }
            catch (ArgumentNullException ex)
            {
                logger.Error("调用方法GetTableCancel发生ArgumentNullException", ex);
            }
            catch (SqlException ex)
            {
                logger.Error("调用方法GetTableCancel发生SqlException", ex);
            }
            catch (Exception ex)
            {
                logger.Error("调用方法GetTableCancel发生Exception", ex);
            }
            return(null);
        }