Esempio n. 1
0
        protected void Grid_MeetingName_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            //checkbox选择 如果不是录入人或超级管理员操作,则没有操作权限;若录入人不是超级管理员 在进行操作后会向管理员发送相应信息,管理员同意后,才会真正进行
            string strs = Session["LoginName"].ToString();

            strs = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
            string Person = Grid_MeetingName.Rows[e.RowIndex].Values[2].ToString();

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

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

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

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

            for (int i = 0; i < m; i++)
            {
                if (CBoxSelect_MeetingName.GetCheckedState(i) == false)
                {
                    isCheck = true;
                }
            }
            if (isCheck)
            {
                foreach (int item in select)
                {
                    CBoxSelect_MeetingName.SetCheckedState(item, true);
                }
                btnDelete.Enabled  = true;
                btnSelect_All.Text = "取消全选";
            }
            else
            {
                foreach (int item in select)
                {
                    CBoxSelect_MeetingName.SetCheckedState(item, false);
                }
                btnDelete.Enabled  = false;
                btnSelect_All.Text = "全选";
            }
        }
Esempio n. 3
0
        //删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            //如果为超级管理员操作则直接删除,否则将IsPass置为false 向管理员发送删除信息
            try
            {
                int m;
                //取整数(不是四舍五入,全舍)
                int Pages = (int)Math.Floor(Convert.ToDouble(Grid_MeetingName.RecordCount / this.Grid_MeetingName.PageSize));

                if (Grid_MeetingName.PageIndex == Pages)
                {
                    m = (Grid_MeetingName.RecordCount - this.Grid_MeetingName.PageSize * Grid_MeetingName.PageIndex);
                }
                else
                {
                    m = this.Grid_MeetingName.PageSize;
                }
                List <int> selections = new List <int>();
                for (int i = 0; i < m; i++)
                {
                    if (CBoxSelect_MeetingName.GetCheckedState(i))
                    {
                        selections.Add(i);
                    }
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        int AcademicMeetingID = Convert.ToInt32(Grid_MeetingName.DataKeys[selections[i]][0].ToString());

                        //删除学术会议附件文件->删除附件表中的信息->删除会议参加人员信息->删除学术报告->删除学术会议信息
                        int    AttactID = BLLAcademic.FindAttachmentID(AcademicMeetingID);
                        string strPath;
                        if (AttactID != 0)
                        {
                            strPath = BLLAttachment.FindPath(AttactID);
                            if (strPath != "")
                            {
                                //删除附件文件
                                publicMethod.DeleteFile(AttactID, strPath);
                                //在附件表中删除附件数据
                                BLLAttachment.Delete(AttactID);
                            }
                        }
                        //删除会议参见人员表中的数据
                        BLLAttend.DeleteStaffByMeetingID(AcademicMeetingID);
                        //删除学术会议中的学术报告信息
                        BLLAcademic.DeleteReportByMeetingID(AcademicMeetingID);
                        //删除学术会议
                        BLLAcademic.Delete(Convert.ToInt32(Grid_MeetingName.DataKeys[selections[i]][0].ToString()));
                    }
                    btnSelect_All.Text = "全选";
                    Alert.ShowInTop("删除成功!");
                }
                else
                {
                    //录入人(非管理员)操作
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        BLLAcademic.UpdateIsPass(Convert.ToInt32(Grid_MeetingName.DataKeys[selections[i]][0]), false);
                        //BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName
                        operate.LoginName        = Session["LoginName"].ToString();
                        operate.OperationTime    = DateTime.Now;
                        operate.LoginIP          = " ";
                        operate.OperationContent = "AcademicMeeting";
                        operate.OperationType    = "删除";
                        operate.OperationDataID  = Convert.ToInt32(Grid_MeetingName.DataKeys[selections[i]][0]);
                        op.Insert(operate);
                        //BindData();
                        btnSelect_All.Text = "全选";
                        Alert.ShowInTop("操作已经提交,请等待管理员确认!");
                    }
                }
                Grid_MeetingName.PageIndex = 0;
                Grid_MeetingName.PageSize  = 20;
                btnDelete.Enabled          = false;
                BindData();
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
                return;
            }
        }