Пример #1
0
        //行点击事件
        protected void Grid_Files_RowCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                string Person   = Grid_Files.Rows[e.RowIndex].Values[2].ToString();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

                if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                    CBoxSelect.SetCheckedState(e.RowIndex, false);
                    Alert.ShowInTop(str);
                }
                if (pm.GridCount(Grid_Files, CBoxSelect).Count == 0)
                {
                    btnDelete.Enabled = false;
                    return;
                }
                if (pm.GridCount(Grid_Files, CBoxSelect).Count != 0)
                {
                    btnDelete.Enabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Пример #2
0
 protected void People_Info_RowCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         List <int> selections = publicmethod.GridCount(People_Info, CBoxSelect);
         if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
         {
             string str = "您无对此行操作的权限,请与管理员联系!";
             CBoxSelect.SetCheckedState(e.RowIndex, false);
             Alert.ShowInTop(str);
         }
         if (selections.Count() == 0)
         {
             btnResetPWD.Enabled = false;
             return;
         }
         if (selections.Count() != 0)
         {
             btnResetPWD.Enabled = true;
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Пример #3
0
        //GridProjectAndPeople行命令
        protected void GridProjectAndPeople_RowCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                List <int> selections = publicmethod.GridCount(GridProjectAndPeople, CBoxSelect);
                string     Person     = GridProjectAndPeople.Rows[e.RowIndex].Values[2].ToString();
                string     strs       = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;

                if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                    CBoxSelect.SetCheckedState(e.RowIndex, false);
                    Alert.ShowInTop(str);
                }
                if (selections.Count == 0)
                {
                    btnDelete.Enabled = false;
                    return;
                }
                if (selections.Count != 0)
                {
                    btnDelete.Enabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Пример #4
0
 //GridProjectStudent行命令
 protected void GridBasicCode_RowCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
         {
             string str = "您无对此行操作的权限,请与管理员联系!";
             CBoxSelect.SetCheckedState(e.RowIndex, false);
             Alert.ShowInTop(str);
         }
         if (publicmethod.GridCount(GridBasicCode, CBoxSelect).Count == 0)
         {
             btnDelete.Enabled = false;
             return;
         }
         if (publicmethod.GridCount(GridBasicCode, CBoxSelect).Count != 0)
         {
             btnDelete.Enabled = true;
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Пример #5
0
 protected void Grid_Platform_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     try
     {
         string strs   = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
         string Person = Grid_Platform.Rows[e.RowIndex].Values[2].ToString();
         if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
         {
             string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
             CBoxSelect.SetCheckedState(e.RowIndex, false);
             Alert.ShowInTop(str);
         }
         if (publicmethod.GridCount(Grid_Platform, CBoxSelect).Count == 0)
         {
             //Alert.ShowInTop("请选中需删除的数据!");
             btnDelete.Enabled = false;
             return;
         }
         if (publicmethod.GridCount(Grid_Platform, CBoxSelect).Count != 0)
         {
             btnDelete.Enabled = true;
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Пример #6
0
        //GridProjectStudent行命令
        protected void GridProjectStudent_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            try
            {
                if (Session["LoginName"].ToString() == "")
                {
                    Response.Redirect("login.aspx");
                    Alert.Show("登录超时!");
                }
                string Person = GridProjectStudent.Rows[e.RowIndex].Values[2].ToString();
                string strs   = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;

                if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                    CBoxSelect.SetCheckedState(e.RowIndex, false);
                    Alert.ShowInTop(str);
                }
                if (publicmethod.GridCount(GridProjectStudent, CBoxSelect).Count == 0)
                {
                    btnDelete.Enabled = false;
                    return;
                }
                if (publicmethod.GridCount(GridProjectStudent, CBoxSelect).Count != 0)
                {
                    btnDelete.Enabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Пример #7
0
        protected void gd_UnitAPeople_RowClick(object sender, GridRowClickEventArgs e)
        {
            string person = gd_UnitAPeople.Rows[e.RowIndex].Values[0].ToString();

            BLHelper.BLLUser user     = new BLLUser();
            string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

            if (Convert.ToInt32(Session["SecrecyLevel"]) != 5 && person != username)
            {
                string str = "您没有对此行操作的权限!此行为" + person + "录入,请与管理员联系!";
                Alert.ShowInTop(str);
                CBoxSelect.SetCheckedState(e.RowIndex, false);
            }

            if (pm.GridCount(gd_UnitAPeople, CBoxSelect).Count == 0)
            {
                btn_Delete.Enabled = false;
                return;
            }
            else
            {
                btn_Delete.Enabled = true;
                return;
            }
        }
Пример #8
0
        //行点击事件
        protected void Grid_Award_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            try
            {
                string Person   = Grid_Award.Rows[e.RowIndex].Values[2].ToString();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

                if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                    CBoxSelect.SetCheckedState(e.RowIndex, false);
                    Alert.ShowInTop(str);
                    return;
                }
                int m;
                //取整数(不是四舍五入,全舍)
                int Pages = (int)Math.Floor(Convert.ToDouble(Grid_Award.RecordCount / this.Grid_Award.PageSize));

                if (Grid_Award.PageIndex == Pages)
                {
                    m = (Grid_Award.RecordCount - this.Grid_Award.PageSize * Grid_Award.PageIndex);
                }
                else
                {
                    m = this.Grid_Award.PageSize;
                }
                List <int> selections = new List <int>();
                for (int i = 0; i < m; i++)
                {
                    if (CBoxSelect.GetCheckedState(i))
                    {
                        selections.Add(i);
                    }
                }
                if (selections.Count == 0)
                {
                    btnDelete.Enabled = false;
                    //Alert.ShowInTop("请至少选择一项!");
                    return;
                }
                else
                {
                    btnDelete.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Пример #9
0
        protected void Grid_NAReporting_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            //int LecturesID = Convert.ToInt32(Grid_NAReporting.DataKeys[e.RowIndex][0].ToString());
            string strs = Session["LoginName"].ToString();

            strs = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
            //Common.Entities.UnitLectures unitLectures = BLLNAR.FindByUnitLecturesID(LecturesID);
            string Person = Grid_NAReporting.Rows[e.RowIndex].Values[2].ToString();

            if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
            {
                string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                CBoxSelect.SetCheckedState(e.RowIndex, false);
                Alert.ShowInTop(str);
            }
            int m;
            //取整数(不是四舍五入,全舍)
            int Pages = (int)Math.Floor(Convert.ToDouble(Grid_NAReporting.RecordCount / this.Grid_NAReporting.PageSize));

            if (Grid_NAReporting.PageIndex == Pages)
            {
                m = (Grid_NAReporting.RecordCount - this.Grid_NAReporting.PageSize * Grid_NAReporting.PageIndex);
            }
            else
            {
                m = this.Grid_NAReporting.PageSize;
            }
            List <int> selections = new List <int>();

            for (int i = 0; i < m; i++)
            {
                if (CBoxSelect.GetCheckedState(i))
                {
                    selections.Add(i);
                }
            }
            if (selections.Count == 0)
            {
                btnDelete.Enabled = false;
                //Alert.ShowInTop("请至少选择一项!");
                return;
            }
            else
            {
                btnDelete.Enabled = true;
            }
        }
Пример #10
0
        //全选按钮
        protected void btnSelect_All_Click(object sender, EventArgs e)
        {
            Grid_Files.SelectAllRows();
            int[] select = Grid_Files.SelectedRowIndexArray;
            int   m;
            //取整数(不是四舍五入,全舍)
            int Pages = (int)Math.Floor(Convert.ToDouble(Grid_Files.RecordCount / this.Grid_Files.PageSize));

            if (Grid_Files.PageIndex == Pages)
            {
                m = (Grid_Files.RecordCount - this.Grid_Files.PageSize * Grid_Files.PageIndex);
            }
            else
            {
                m = this.Grid_Files.PageSize;
            }
            bool isCheck = false;

            for (int i = 0; i < m; i++)
            {
                if (CBoxSelect.GetCheckedState(i) == false)
                {
                    isCheck = true;
                }
            }
            if (isCheck)
            {
                foreach (int item in select)
                {
                    CBoxSelect.SetCheckedState(item, true);
                }
                btnDelete.Enabled  = true;
                btnSelect_All.Text = "取消全选";
            }
            else
            {
                foreach (int item in select)
                {
                    CBoxSelect.SetCheckedState(item, false);
                }
                btnDelete.Enabled  = false;
                btnSelect_All.Text = "全选";
            }
        }
Пример #11
0
        //行点击事件
        protected void Grid_FurtherStudy_RowCommand(object sender, GridCommandEventArgs e)
        {
            string Person = Grid_FurtherStudy.Rows[e.RowIndex].Values[0].ToString();

            BLHelper.BLLUser user     = new BLHelper.BLLUser();
            string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

            if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
            {
                string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                CBoxSelect.SetCheckedState(e.RowIndex, false);
                Alert.ShowInTop(str);
            }
            if (pm.GridCount(Grid_FurtherStudy, CBoxSelect).Count == 0)
            {
                btnDelete.Enabled = false;
            }
            else
            {
                btnDelete.Enabled = true;
            }
        }