Ejemplo n.º 1
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int powerID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CorePowerDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int roleCount = DB.Roles.Where(r => r.Powers.Any(p => p.ID == powerID)).Count();
                if (roleCount > 0)
                {
                    Alert.ShowInTop("删除失败!需要先清空使用此权限的角色!");
                    return;
                }

                // 执行数据库操作
                DB.Powers.Delete(r => r.ID == powerID);

                BindGrid();
            }
        }
Ejemplo n.º 2
0
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            string exception = "";

            if (e.CommandName == "Delete")
            {
                object[] keys = Grid1.DataKeys[e.RowIndex];
                if (SecondManagementCtrl.Delete((string)keys[0], ref exception))
                {
                    Alert.ShowInTop("删除成功!", MessageBoxIcon.Information);
                }
                else
                {
                    Alert.ShowInTop("删除失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
            if (e.CommandName == "Reset")
            {
                object[] keys = Grid1.DataKeys[e.RowIndex];
                if (SecondManagementCtrl.ResetPassword((string)keys[0], ref exception))
                {
                    Alert.ShowInTop("重置成功!", MessageBoxIcon.Information);
                }
                else
                {
                    Alert.ShowInTop("重置失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
            bindSecondToGrid();
        }
 /// <summary>
 /// 删除事件
 /// </summary>
 protected void roleGrid_RowCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         //if (e.CommandName == "delete")
         //{
         //    object[] keys = roleGrid.DataKeys[e.RowIndex];
         //    var id = keys[0].ToString();
         //    var model = roleDao.Entities.Where(m => m.Id == id).Select(m => new { UserCount = m.Users.Where(n => !n.IsDeleted).Count(), Name = m.Name }).SingleOrDefault();
         //    if (model == null)
         //    {
         //        Alert.ShowInParent("您要删除的角色不存在。");
         //        return;
         //    }
         //    if (model.UserCount > 0)
         //    {
         //        Alert.ShowInParent("存在关联的帐号,删除失败。");
         //        return;
         //    }
         //    var form = roleDao.Entities.Where(m => m.Id == id).SingleOrDefault();
         //    roleDao.AutoDetectChangesEnabled = true;
         //    form.IsDeleted = true;
         //    roleDao.SaveRole(form);
         //    GridBind();
         //}
     }
     catch (Exception ex)
     {
         Alert.ShowInParent(ex.Message);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 删除事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gridStudyLog_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     //if (e.CommandName == "ActionDeleteStudyLog")
     //{
     //    int id = int.Parse(gridStudyLog.Rows[e.RowIndex].DataKeys[0].ToString());
     //    SeatManage.ClassModel.StudyBookingLog StudyModel = SeatManage.Bll.StudyRoomOperation.GetStudyBookingLogByID(id);
     //    if (StudyModel.CheckState == CheckStatus.Adopt || StudyModel.CheckState == CheckStatus.Cancel)
     //    {
     //        FineUI.Alert.Show("操作失败,状态无效");
     //        GridBindDate();
     //    }
     //    StudyModel.CheckState = CheckStatus.Cancel;
     //    StudyModel.CheckTime = SeatManage.Bll.ServiceDateTime.Now;
     //    StudyModel.Remark = "读者取消此处审核";
     //    if (SeatManage.Bll.StudyRoomOperation.UpdateStudyBookingLog(StudyModel))
     //    {
     //        FineUI.Alert.Show("取消成功");
     //        GridBindDate();
     //    }
     //    else
     //    {
     //        FineUI.Alert.Show("操作失败");
     //        GridBindDate();
     //    }
     //}
 }
Ejemplo n.º 5
0
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         bool rs = manage.Delete(Grid1.DataKeys[e.RowIndex][0].ToString());
         if (rs != false)
         {
             Alert.ShowInParent("提交成功");
             Bind();
         }
         else
         {
             Alert.ShowInParent("提交失败");
         }
     }
     if (e.CommandName == "Approval")
     {
         bool rs = manage.UpdateStatus(Grid1.DataKeys[e.RowIndex][0].ToString(), Grid1.DataKeys[e.RowIndex][1].ToString());
         if (rs != false)
         {
             Alert.ShowInParent("提交成功");
             Bind();
         }
         else
         {
             Alert.ShowInParent("提交失败");
         }
     }
 }
Ejemplo n.º 6
0
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "UDISABLED")
     {
         //编辑权限
         if (!VerifyPurview(",SM-SET,"))
         {
             Alert.ShowInParent(CHECK_POWER_FAIL_ACTION_MESSAGE);
             return;
         }
         CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn(e.ColumnIndex);
         bool          checkState = checkField.GetCheckedState(e.RowIndex);
         int           result     = new PCBLL().SetDisabled(Convert.ToInt32(Grid1.DataKeys[e.RowIndex][0]), checkState);
         string        tipText    = (checkState ? "禁用" : "启用");
         if (result > 0)
         {
             Alert.ShowInParent(tipText + "成功!");
             BindData();
         }
         else
         {
             Alert.ShowInParent(tipText + "失败!");
         }
     }
     if (e.CommandName == "Edit")
     {
         txtID.Text          = Grid1.DataKeys[e.RowIndex][0].ToString();
         txtName.Text        = HttpUtility.HtmlDecode(Grid1.DataKeys[e.RowIndex][1].ToString());
         txtCode.Text        = HttpUtility.HtmlDecode(Grid1.DataKeys[e.RowIndex][2].ToString()).Split('-')[1];
         chkDisabled.Checked = Convert.ToBoolean(Grid1.DataKeys[e.RowIndex][3].ToString());
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            GridRow gr = Grid1.Rows[e.RowIndex];

            //获取当前点击列的主键ID
            object id = gr.DataKeys[0];

            switch (e.CommandName)
            {
            case "IsDisplay":
                //更新状态
                MenuInfoBll.GetInstence().UpdateIsDisplay(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument));
                //重新加载
                LoadData();

                break;

            case "IsMenu":
                //更新状态
                MenuInfoBll.GetInstence().UpdateIsMenu(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument));
                //重新加载
                LoadData();

                break;

            case "ButtonEdit":
                //打开编辑窗口
                Window1.IFrameUrl = "MenuInfoEdit.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window1.Hidden    = false;

                break;
            }
        }
 /// <summary>
 /// 删除事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void BlacklistGrid_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDelete")
     {
         SeatManage.ClassModel.BlackListInfo blacklist = SeatManage.Bll.T_SM_Blacklist.GetBlistList(BlacklistGrid.Rows[e.RowIndex].DataKeys[0].ToString());
         if (blacklist != null)
         {
             blacklist.BlacklistState = LogStatus.Fail;
             if (SeatManage.Bll.T_SM_Blacklist.UpdateBlackList(blacklist) == 0)
             {
                 FineUI.Alert.ShowInTop("删除失败!");
             }
             else
             {
                 //SeatManage.ClassModel.ReaderNoticeInfo rni = new SeatManage.ClassModel.ReaderNoticeInfo();
                 //rni.CardNo = blacklist.CardNo;
                 //rni.Type = NoticeType.DeleteBlacklistWarning;
                 //rni.Note = "被管理员手动移除黑名单";
                 //if (SeatManage.Bll.T_SM_ReaderNotice.AddReaderNotice(rni) > 0)
                 //{
                 FineUI.Alert.ShowInTop("删除完成!");
                 //}
                 //else
                 //{
                 //    FineUI.Alert.ShowInTop("添加消息失败!");
                 //}
             }
         }
         else
         {
             FineUI.Alert.ShowInTop("删除失败!");
         }
         BindGrid();
     }
 }
Ejemplo n.º 9
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int roleID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreRoleDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int userCountUnderThisRole = DB.Users.Where(u => u.Roles.Any(r => r.ID == roleID)).Count();

                if (userCountUnderThisRole > 0)
                {
                    Alert.ShowInTop("删除失败!需要先清空属于此角色的用户!");
                    return;
                }

                // 执行数据库操作
                DB.Roles.Delete(r => r.ID == roleID);

                BindGrid();
            }
        }
        protected void grdDepartment_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            DepartmentService departmentService = new DepartmentService();
            int id = Convert.ToInt32(grdDepartment.DataKeys[e.RowIndex][0]);

            if (e.CommandName == "Up")
            {
                departmentService.UpSort(id);
            }
            if (e.CommandName == "Down")
            {
                departmentService.DownSort(id);
            }
            if (e.CommandName == "Delete")
            {
                if (departmentService.HasSubDepartment(id))
                {
                    Alert.ShowInTop("该部门包含其他子部门,无法删除。请先删除其子部门。");
                }
                else
                {
                    departmentService.Delete(id);
                }
            }
            grdDepartmentDataBind();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            GridRow gr = Grid1.Rows[e.RowIndex];
            //获取当前点击列的主键ID
            object id = gr.DataKeys[0];

            switch (e.CommandName)
            {
            case "LoginLog":
                Window2.IFrameUrl = "../Systems/Security/LoginLogList.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window2.Hidden    = false;
                break;

            case "UserLog":
                Window2.IFrameUrl = "../Systems/Security/UseLogList.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window2.Hidden    = false;
                break;

            case "ButtonEdit":
                //打开编辑窗口
                Window1.IFrameUrl = "ManagerEdit.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window1.Hidden    = false;

                break;
            }
        }
Ejemplo n.º 12
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int DocConsultID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreDocConsultDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int userCount = DB.Users.Where(u => u.DocConsults.Any(doc => doc.ID == DocConsultID)).Count();
                if (userCount > 0)
                {
                    Alert.ShowInTop("删除失败!");
                    return;
                }

                DB.DocConsults.Delete(doc => doc.ID == DocConsultID);

                BindGrid();
            }
        }
Ejemplo n.º 13
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int articlecategoryID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreArticleCategoryDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int childCount = DB.ArticleCategorys.Where(a =>a.Parent.ID == articlecategoryID).Count();
                if (childCount > 0)
                {
                    Alert.ShowInTop("删除失败!请先删除子文档分类!");
                    return;
                }

                DB.ArticleCategorys.Delete<ArticleCategory>(a => a.ID == articlecategoryID);

                ArticleCategoryHelper.Reload();
                BindGrid();
            }
        }
Ejemplo n.º 14
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int formtypeID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreFormTypeDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int userCount = DB.Users.Where(u => u.FormType.ID == formtypeID).Count();
                if (userCount > 0)
                {
                   Alert.ShowInTop("删除失败!需要先清空属于此表单的用户!");
                    return;
                }

                int childCount = DB.FormTypes.Where(f => f.Parent.ID == formtypeID).Count();
                if (childCount > 0)
                {
                    Alert.ShowInTop("删除失败!请先删除子表单!");
                    return;
                }

                DB.FormTypes.Delete<FormType>(f => f.ID == formtypeID);

                FormTypeHelper.Reload();
                BindGrid();
            }
        }
Ejemplo n.º 15
0
 //GridEduExperience行命令
 protected void GridEduExperience_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     try
     {
         string Person = GridEduExperience.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(GridEduExperience, CBoxSelect).Count == 0)
         {
             //Alert.ShowInTop("请选中需删除的数据!");
             btnDelete.Enabled = false;
             return;
         }
         if (publicmethod.GridCount(GridEduExperience, CBoxSelect).Count != 0)
         {
             btnDelete.Enabled = true;
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 16
0
        //行事件
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                int id   = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0]);
                int flag = operate.DeletePublishByID(id);
                if (flag >= 1)
                {
                    Alert.ShowInParent("删除成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("删除失败");
                }
            }
            else if (e.CommandName == "CheckBox1")
            {
                int id = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0]);
                FineUI.CheckBoxField checkField = (FineUI.CheckBoxField)Grid1.FindColumn(e.ColumnIndex);
                bool checkState = checkField.GetCheckedState(e.RowIndex);

                int a = operate.UpdatePublishByID(id, checkState);
                if (a > 0)
                {
                    Alert.ShowInParent("操作成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("操作失败");
                }
            }
        }
Ejemplo n.º 17
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int titleID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreTitleDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int userCount = DB.Users.Where(u => u.Titles.Any(t => t.ID == titleID)).Count();
                if (userCount > 0)
                {
                    Alert.ShowInTop("删除失败!需要先清空拥有此职务的用户!");
                    return;
                }

                DB.Titles.Delete(t => t.ID == titleID);

                BindGrid();
            }
        }
Ejemplo n.º 18
0
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "UDISABLED")
     {
         //上架操作权限
         if (!VerifyPurview(",SU-EDIT,"))
         {
             Alert.ShowInParent(CHECK_POWER_FAIL_ACTION_MESSAGE);
             return;
         }
         CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn(e.ColumnIndex);
         bool          checkState = checkField.GetCheckedState(e.RowIndex);
         int           result     = new UserBLL().SetDisabled(Convert.ToInt32(Grid1.DataKeys[e.RowIndex][0]), checkState);
         string        tipText    = checkState ? "禁用" : "启用";
         if (result > 0)
         {
             Alert.ShowInParent(tipText + "成功!");
             BindData();
         }
         else
         {
             Alert.ShowInParent(tipText + "失败!");
         }
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 删除事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gridBespeakLog_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDeleteBespeakLog")
     {
         int id = int.Parse(gridBespeakLog.Rows[e.RowIndex].DataKeys[0].ToString());
         SeatManage.ClassModel.BespeakLogInfo bespeakModel = SeatManage.Bll.T_SM_SeatBespeak.GetBespeaklogById(id);
         if (bespeakModel.BsepeakState != BookingStatus.Waiting)
         {
             FineUI.Alert.Show("操作失败,状态无效");
             GridBindDate();
         }
         bespeakModel.BsepeakState = BookingStatus.Cencaled;
         bespeakModel.CancelPerson = Operation.Admin;
         bespeakModel.CancelTime   = SeatManage.Bll.ServiceDateTime.Now;
         bespeakModel.Remark       = "被管理员" + this.LoginId + "取消预约";
         if (SeatManage.Bll.T_SM_SeatBespeak.UpdateBespeakList(bespeakModel) > 0)
         {
             FineUI.Alert.Show("取消成功");
             GridBindDate();
         }
         else
         {
             FineUI.Alert.Show("操作失败");
             GridBindDate();
         }
     }
 }
Ejemplo n.º 20
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int menuID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreMenuDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int childCount = DB.Menus.Where(m => m.Parent.ID == menuID).Count();
                if (childCount > 0)
                {
                    Alert.ShowInTop("删除失败!请先删除子菜单!");
                    return;
                }

                DB.Menus.Delete<Menu>(m => m.ID == menuID);

                MenuHelper.Reload();
                BindGrid();
            }
        }
Ejemplo n.º 21
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int deptID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreDeptDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int userCount = DB.Users.Where(u => u.Dept.ID == deptID).Count();
                if (userCount > 0)
                {
                    Alert.ShowInTop("删除失败!需要先清空属于此部门的用户!");
                    return;
                }

                int childCount = DB.Depts.Where(d => d.Parent.ID == deptID).Count();
                if (childCount > 0)
                {
                    Alert.ShowInTop("删除失败!请先删除子部门!");
                    return;
                }

                DB.Depts.Delete<Dept>(d => d.ID == deptID);

                DeptHelper.Reload();
                BindGrid();
            }
        }
Ejemplo n.º 22
0
 /// <summary>
 /// 删除事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void VRGrid_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDelete")
     {
         SeatManage.ClassModel.ViolationRecordsLogInfo vrinfo = SeatManage.Bll.T_SM_ViolateDiscipline.GetViolationRecords(VRGrid.Rows[e.RowIndex].DataKeys[0].ToString());
         if (vrinfo != null)
         {
             vrinfo.Flag = LogStatus.Fail;
             if (!SeatManage.Bll.T_SM_ViolateDiscipline.UpdateViolationRecords(vrinfo))
             {
                 FineUI.Alert.ShowInTop("删除失败!");
             }
             //SeatManage.ClassModel.ReaderNoticeInfo rni = new SeatManage.ClassModel.ReaderNoticeInfo();
             //rni.CardNo = vrinfo.CardNo;
             //rni.AddTime = SeatManage.Bll.ServiceDateTime.Now;
             //rni.Note = string.Format("{0}记录的违规,{1},过期", vrinfo.EnterOutTime, vrinfo.Remark);
             //SeatManage.Bll.T_SM_ReaderNotice.AddReaderNotice(rni);
         }
         else
         {
             FineUI.Alert.ShowInTop("删除失败!");
         }
         BindGrid();
     }
 }
Ejemplo n.º 23
0
 protected void grdData_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ClonAction")
     {
         ClonAction();
         BindGrid();
     }
 }
Ejemplo n.º 24
0
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            LinkButtonField deleteField = Grid1.FindColumn("Delete") as LinkButtonField;
            DataTable       curDt       = getDataTable();

            curDt.Rows.RemoveAt(e.RowIndex);
            Grid1.DataSource = curDt;
            Grid1.DataBind();
        }
 /// <summary>
 /// 查看风险详情
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void HAZA_RISKGrid_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     //查看详情
     if (e.CommandName == "ActionDetail")
     {
         var    keys    = this.HAZA_RISKGrid.Rows[e.RowIndex].DataKeys[0];
         var    risk_id = keys;
         string openUrl = String.Format("~/HAZA/RISKDETAIL.aspx?id={0}", risk_id, true);
         PageContext.RegisterStartupScript(this.RISK_DETAIL_Window.GetShowReference(openUrl, "查看风险详细信息", 800, 600));
     }
 }
Ejemplo n.º 26
0
 protected void gridMPS_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDel")
     {
         BLL.tb_JH_MPS bllMPS     = new BLL.tb_JH_MPS();
         string        ID         = gridMPS.DataKeys[gridMPS.SelectedRowIndex][0].ToString();
         string        materialNO = gridMPS.Rows[gridMPS.SelectedRowIndex].Values[4].ToString();
         bool          result     = bllMPS.DeleteMPS(ID, materialNO);
         if (result)
         {
             Alert.ShowInTop("删除成功", "信息", MessageBoxIcon.Information);
         }
         else
         {
             Alert.ShowInTop("删除失败", "错误", MessageBoxIcon.Error);
         }
     }
     if (e.CommandName == "ActionAssign")
     {
         #region 检查
         string PlanAmount = gridSource.Rows[e.RowIndex].Values[6].ToString();
         string DownAmount = gridSource.Rows[e.RowIndex].Values[7].ToString();
         if (PlanAmount == DownAmount)
         {
             Alert.ShowInTop("不能重复拆分", "警告", MessageBoxIcon.Warning);
             return;
         }
         #endregion
         #region 拆分
         BLL.tb_JH_MPS bllMPS = new BLL.tb_JH_MPS();
         int           result = bllMPS.DownMPS(gridSource.DataKeys[e.RowIndex][0].ToString());
         if (result == 0)
         {
             Alert.ShowInTop("拆分完毕", "信息", MessageBoxIcon.Information);
         }
         else if (result == 1)
         {
             Alert.ShowInTop("请先拆分日期在前的需求计划", "错误", MessageBoxIcon.Error);
         }
         else if (result == 3)
         {
             Alert.ShowInTop("能力不足", "错误", MessageBoxIcon.Error);
         }
         else
         {
             Alert.ShowInTop("拆分失败", "错误", MessageBoxIcon.Error);
         }
         #endregion
     }
     int selectedIndex = gridSource.SelectedRowIndex;
     BindGrid();
     gridSource.SelectedRowIndex = selectedIndex;
     BindGridMPS(gridSource.DataKeys[selectedIndex][0].ToString());
 }
Ejemplo n.º 27
0
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                int    rowID  = Convert.ToInt32(Grid1.DataKeys[e.RowIndex][0]);
                string sqlCmd = "update OA_Announcement set isDeleted='1' where id='" + rowID + "'";
                SqlSel.ExeSql(sqlCmd);
                bindGrid();

                Alert.ShowInTop("删除成功!");
            }
        }
Ejemplo n.º 28
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);
            }
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            GridRow gr = Grid1.Rows[e.RowIndex];
            //获取当前点击列的主键ID
            object id = gr.DataKeys[0];

            switch (e.CommandName)
            {
            case "ButtonEdit":
                //打开编辑窗口
                Window1.IFrameUrl = "SuppliersEdit.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window1.Hidden    = false;

                break;
            }
        }
Ejemplo n.º 30
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;
            }
        }
Ejemplo n.º 31
0
 protected void gridMPS_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDel")
     {
         //BLL.tb_JH_MPS bllMPS = new BLL.tb_JH_MPS();
         //string ID = gridMPS.DataKeys[gridMPS.SelectedRowIndex][0].ToString();
         //string materialNO = gridMPS.Rows[gridMPS.SelectedRowIndex].Values[4].ToString();
         //bool result = bllMPS.DeleteMPS(ID, materialNO);
         //if (result)
         //{
         //    Alert.ShowInTop("删除成功", "信息", MessageBoxIcon.Information);
         //}
         //else
         //{
         //    Alert.ShowInTop("删除失败", "错误", MessageBoxIcon.Error);
         //}
     }
     if (e.CommandName == "ActionAssign")
     {
         #region 检查
         string PlanAmount    = gridMPS.Rows[e.RowIndex].Values[6].ToString();
         string ResolveAmount = gridMPS.Rows[e.RowIndex].Values[7].ToString();
         if (PlanAmount == ResolveAmount)
         {
             Alert.ShowInTop("不能重复分解", "警告", MessageBoxIcon.Warning);
             return;
         }
         #endregion
         #region 分解
         BLL.tb_JH_MRP bllMRP = new BLL.tb_JH_MRP();
         int           result = bllMRP.ResolveMRP(gridMPS.DataKeys[e.RowIndex][0].ToString());
         if (result == 0)
         {
             Alert.ShowInTop("分解完毕", "信息", MessageBoxIcon.Information);
         }
         else
         {
             Alert.ShowInTop("分解失败", "错误", MessageBoxIcon.Error);
         }
         #endregion
     }
     int selectedIndex = gridMPS.SelectedRowIndex;
     BindGridMPS();
     gridMPS.SelectedRowIndex = selectedIndex;
     BindGridMRP(gridMPS.DataKeys[selectedIndex][0].ToString());
 }
Ejemplo n.º 32
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;
            }
        }
Ejemplo n.º 33
0
 /// <summary>
 /// 删除事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void UsersGrid_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "ActionDelete")
     {
         SeatManage.ClassModel.UserInfo user = new SeatManage.ClassModel.UserInfo();
         user.LoginId = UsersGrid.Rows[e.RowIndex].DataKeys[0].ToString();
         if (!SeatManage.Bll.Users_ALL.DeleteUser(user))
         {
             FineUI.Alert.ShowInTop("删除失败!");
         }
         else
         {
             FineUI.Alert.ShowInTop("删除完成!");
             BindGrid();
         }
     }
 }
Ejemplo n.º 34
0
        // 行事件
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                string keyname = Grid1.Rows[e.RowIndex].Values[1].ToString();
                int    flag    = operate.DeleteRecommendByTypeName(keyname);
                if (flag >= 1)
                {
                    Alert.ShowInParent("删除成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("删除失败");
                }
            }
            else if (e.CommandName == "CheckBox1")
            {
                string keyname = Grid1.Rows[e.RowIndex].Values[1].ToString();
                FineUI.CheckBoxField checkField = (FineUI.CheckBoxField)Grid1.FindColumn(e.ColumnIndex);
                bool checkState = checkField.GetCheckedState(e.RowIndex);

                int a = operate.UpdateRecommendByTypeName(keyname, checkState);
                if (a > 0)
                {
                    Alert.ShowInParent("操作成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("操作失败");
                }
            }
            else if (e.CommandName == "MoveUp")
            {
                int ID = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0].ToString());
                operate.GetRecommendByMove(ID, "上移");
                BindData();
            }
            else if (e.CommandName == "MoveDown")
            {
                int ID = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0].ToString());
                operate.GetRecommendByMove(ID, "下移");
                BindData();
            }
        }
 /// <summary>
 /// 行命令时间
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void LibraryGrid_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     //if (e.CommandName == "ActionDelete")
     //{
     //    SeatManage.ClassModel.LibraryInfo library = new SeatManage.ClassModel.LibraryInfo();
     //    library.No = LibraryGrid.Rows[e.RowIndex].DataKeys[0].ToString();
     //    if (!SeatManage.Bll.T_SM_Library.DeleteLibrary(library))
     //    {
     //        FineUI.Alert.ShowInTop("删除失败!");
     //    }
     //    else
     //    {
     //        FineUI.Alert.ShowInTop("删除完成!");
     //        BindGrid();
     //    }
     //}
 }
Ejemplo n.º 36
0
 //行事件
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         int id   = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0]);
         int flag = operate.DeleteMessageByID(id);
         if (flag >= 1)
         {
             Alert.ShowInParent("删除成功");
             BindData();
         }
         else
         {
             Alert.ShowInParent("删除失败");
         }
     }
 }
Ejemplo n.º 37
0
 //行事件
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         string id   = Grid1.Rows[e.RowIndex].Values[0].ToString();
         int    flag = operate.DeleteCommentByID(id);
         if (flag >= 1)
         {
             Alert.ShowInParent("删除成功");
             BindData();
         }
         else
         {
             Alert.ShowInParent("删除失败");
         }
     }
 }
Ejemplo n.º 38
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            GridRow gr = Grid1.Rows[e.RowIndex];
            //获取当前点击列的主键ID
            object id = gr.DataKeys[0];


            //因为要记录修改人,修改时间跟最后更新时间,所以将单字段更新换成多字段更新
            switch (e.CommandName)
            {
            case "ENABLE":
                try
                {
                    var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == OnlineUsersBll.GetInstence().GetUserHashKey());
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("ENABLE", ConvertHelper.StringToByte(e.CommandArgument));
                    dic.Add("MOD_DATETIME", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
                    dic.Add("MOD_USER_ID", OlUser.Manager_LoginName);
                    dic.Add("LAST_UPDATE", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
                    if (ConvertHelper.Cint0(id) > 0)
                    {
                        PROD_DEPBll.GetInstence().UpdateValue(this, ConvertHelper.Cint0(id), dic);
                    }
                    LoadData();
                    //PROD_KINDBll.GetInstence().Save(this, model);
                }
                catch (Exception err)
                {
                    //出现异常,保存出错日志信息
                    CommonBll.WriteLog("保存失败", err);
                }
                //更新状态
                //PROD_KINDBll.GetInstence().UpdateENABLE(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument));
                //重新加载
                //LoadData();

                break;

            case "ButtonEdit":
                //打开编辑窗口
                Window1.IFrameUrl = "ProdDepEdit.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window1.Hidden    = false;

                break;
            }
        }
Ejemplo n.º 39
0
 protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Reset")
     {
         model           = new E_Model.Account();
         model.ID        = Grid1.DataKeys[e.RowIndex][0].ToString();
         model.PASSWORDS = E_Common.DEncrypt.DESEncrypt.Encrypt("888888");
         bool rs = manage.ResetPwd(model);
         if (rs != false)
         {
             Alert.ShowInParent("提交成功");
             BindGrid();
         }
         else
         {
             Alert.ShowInParent("提交失败");
         }
     }
     if (e.CommandName == "Delete")
     {
         bool rs = manage.Delete(Grid1.DataKeys[e.RowIndex][0].ToString());
         if (rs != false)
         {
             Alert.ShowInParent("提交成功");
             BindGrid();
         }
         else
         {
             Alert.ShowInParent("提交失败");
         }
     }
     if (e.CommandName == "Approval")
     {
         bool rs = manage.UpdateStatus(Grid1.DataKeys[e.RowIndex][0].ToString(), decimal.Parse(Grid1.DataKeys[e.RowIndex][1].ToString()));
         if (rs != false)
         {
             Alert.ShowInParent("提交成功");
             BindGrid();
         }
         else
         {
             Alert.ShowInParent("提交失败");
         }
     }
 }
Ejemplo n.º 40
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int logID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreLogDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                DB.Logs.Delete(l => l.ID == logID);

                BindGrid();
            }
        }
 /// <summary>
 /// 删除事件
 /// </summary>
 protected void menuGrid_RowCommand(object sender, GridCommandEventArgs e)
 {
     //if (e.CommandName == "delete")
     //{
     //    try
     //    {
     //        object[] keys = menuGrid.DataKeys[e.RowIndex];
     //        var id = int.Parse(keys[0].ToString());
     //        var form = menuApp.Entities.Where(m => m.Id == id).SingleOrDefault();
     //        moduleApp.AutoDetectChangesEnabled = true;
     //        form.IsDeleted = true;
     //        menuApp.SaveMenu(form);
     //        GridBind();
     //    }
     //    catch (Exception ex)
     //    {
     //        Alert.Show(ex.Message);
     //    }
     //}
 }
Ejemplo n.º 42
0
        protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] values = Grid2.DataKeys[e.RowIndex];
            string user_uid = values[0].ToString().Trim();
            string RoleId = values[1].ToString().Trim();

            if (e.CommandName == "Delete")
            {
                string sqlstr = "delete RoleUser where UserId='" + user_uid + "' and RoleId='" + RoleId + "'";
                int state = DbHelperSQL.ExecuteSql(sqlstr);
                if (state != 0)
                {
                    Grid2_databind();
                    Alert.Show("删除成功!", "提示", Alert.DefaultMessageBoxIcon);
                }
                else
                {
                    Alert.Show("删除失败!", "提示", Alert.DefaultMessageBoxIcon);
                    return;
                }
            }
        }
Ejemplo n.º 43
0
        //protected void btnDeleteSelected_Click(object sender, EventArgs e)
        //{
        //    // 在操作之前进行权限检查
        //    if (!CheckPowerDelete())
        //    {
        //        CheckPowerFailWithAlert();
        //        return;
        //    }
        //    // 从每个选中的行中获取ID(在Grid1中定义的DataKeyNames)
        //    List<int> ids = GetSelectedDataKeyIDs(Grid1);
        //    // 执行数据库操作
        //    new Delete().From<XJobTitle>()
        //         .Where(XJobTitle.IdColumn).In(ids)
        //         .Execute();
        //    //// 清空当前选中的项
        //    //Grid1.SelectedRowIndexArray = null;
        //    // 重新绑定表格
        //    BindGrid();
        //}
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int id = Convert.ToInt32(Grid1.DataKeys[e.RowIndex][0]);

            if (e.CommandName == "Delete")
            {

                try
                {

                    m_bllCK_ProductType.Delete(id);
                    BindGrid();

                }
                catch (Exception ex)
                {
                    Alert.ShowInTop(ex.ToString());
                    return;
                }

            }
        }
 /// <summary>
 /// 删除事件
 /// </summary>
 protected void departmentGrid_RowCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "delete")
         {
             //object[] keys = departmentGrid.DataKeys[e.RowIndex];
             //var id = int.Parse(keys[0].ToString());
             //var model = departmentApp.Entities.Where(m => m.Id == id).Select(m => new { UserCount = m.Users.Count() }).SingleOrDefault();
             //if (model == null)
             //{
             //    Alert.ShowInParent("您要删除的部门不存在。");
             //    return;
             //}
             //if (model.UserCount > 0)
             //{
             //    Alert.ShowInParent("存在关联的员工,删除失败。");
             //    return;
             //}
             //if (departmentApp.Entities.Where(m => m.ParentId == id).Count() > 0)
             //{
             //    Alert.ShowInParent("存在关联的子部门,删除失败。");
             //    return;
             //}
             //var form = departmentApp.Entities.Where(m => m.Id == id).SingleOrDefault();
             //departmentApp.AutoDetectChangesEnabled = true;
             //form.IsDeleted = true;
             //departmentApp.SaveDepartment(form);
             //GridBind();
         }
     }
     catch (Exception ex)
     {
         Alert.ShowInParent(ex.Message);
     }
 }
Ejemplo n.º 45
0
        protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] values = Grid2.DataKeys[e.RowIndex];
            int userID = Convert.ToInt32(values[0]);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreDeptUserDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int deptID = GetSelectedDataKeyID(Grid1);

                User user = DB.Users.Include(u => u.Dept)
                    .Where(u => u.ID == userID)
                    .FirstOrDefault();

                if (user != null)
                {
                    user.Dept = null;

                    DB.SaveChanges();
                }

                BindGrid2();

            }
        }
Ejemplo n.º 46
0
        //============ GRID事件==========
        #region 删除

        /// <summary>
        /// 删除
        /// 修改:林以恒 2015-4-19
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            ////设置页面权限
            //Power.SetViewPower("mod_role");
            ////验证权限
            //if (Power.VerifyPower() == false)
            //{
            //    return;
            //}
            object[] keys = Grid1.DataKeys[e.RowIndex];
            int id = Int32.Parse(keys[0].ToString());
            if (e.CommandName != "Delete") return;
            var query = new DapperExQuery<T_ROLES>().AndWhere(n => n.ID, OperationMethod.Equal, id);
            Alert.ShowInTop(_rolesBll.Delete(query) ? "删除成功!" : "删除失败!");
            //页面刷新
            Bind();
        }
Ejemplo n.º 47
0
        protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] values = Grid2.DataKeys[e.RowIndex];
            int userID = Convert.ToInt32(values[0]);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreRoleUserDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int roleID = GetSelectedDataKeyID(Grid1);

                Role role = DB.Roles.Include(r => r.Users)
                    .Where(r => r.ID == roleID)
                    .FirstOrDefault();

                User tobeRemovedUser = role.Users.Where(u => u.ID == userID).FirstOrDefault();
                if (tobeRemovedUser != null)
                {
                    role.Users.Remove(tobeRemovedUser);
                    DB.SaveChanges();
                }

                BindGrid2();

            }
        }
Ejemplo n.º 48
0
 /// <summary>
 /// 单行删除 
 /// 创建  毛枫  2015-4-17
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
 {
     object[] values = Grid2.DataKeys[e.RowIndex];
     string  A_CODE =values[1].ToString();
     //T_ADMIN T_ADMIN = new T_ADMIN();
     //var queryuser = new DapperExQuery<T_ADMIN>().AndWhere(n => n.ID, OperationMethod.Equal, userID);
     //T_ADMIN = T_ADMIN_BLL.GetEntity(queryuser);
     //string a_code = T_ADMIN.A_CODE;
     //判断点击的是删除
     if (e.CommandName == "Delete")
     {
         //// 在操作之前进行权限检查
         //if (!CheckPower("CoreRoleUserDelete"))
         //{
         //    CheckPowerFailWithAlert();
         //    return;
         //}
         string R_CODE = FineUITable.GetSelectedDataKeyCode(Grid1);
         var query = new DapperExQuery<T_ADMIN_ROLES>().AndWhere(n => n.R_CODE, OperationMethod.Equal, R_CODE)
          .AndWhere(n => n.A_CODE, OperationMethod.Equal, A_CODE);
         var user_role = T_ADMIN_ROLES_BLL.GetEntity(query);
         if (user_role != null)
         {
             T_ADMIN_ROLES_BLL.Delete(query);
         }
         //绑定刷新
         BindGrid2();
     }
 }
Ejemplo n.º 49
0
 //============ GRID事件==========
 #region 删除
 /// <summary>
 /// 列表数据绑定
 /// 创建 林以恒   2015-4-13  
 /// 修改:林以恒  2015-4-18
 /// </summary>
 protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
 {
     object[] keys = Grid1.DataKeys[e.RowIndex];
     int id = Int32.Parse(keys[0].ToString());
     if (e.CommandName != "Delete") return;
     var query = new DapperExQuery<T_POWERS>().AndWhere(n => n.ID, OperationMethod.Equal, id);
     Alert.ShowInTop(_powersbll.Delete(query) ? "删除成功!" : "删除失败!");
     BindGrid();
 }
Ejemplo n.º 50
0
        //============ GRID事件==========
        #region Grid事件

        /// <summary>
        /// 删除
        /// 创建 林以恒 
        /// 2015年4月14日
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] keys = Grid1.DataKeys[e.RowIndex];
            int id = int.Parse(keys[0].ToString());
            if (e.CommandName == "Delete")
            {
                var query = new DapperExQuery<T_ADMIN_MENUS>().AndWhere(n => n.ID, OperationMethod.Equal, id);
                Alert.ShowInTop(_adminMenusBll.Delete(query) ? "删除成功!" : "删除失败!");
                Replace();
            }
            else
            {
                Alert.ShowInTop("点击成功!");
            }
        }
Ejemplo n.º 51
0
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int userID = GetSelectedDataKeyID(Grid1);
            string userName = GetSelectedDataKey(Grid1, 1);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreUserDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                if (userName == "admin")
                {
                    Alert.ShowInTop("不能删除默认的系统管理员(admin)!");
                }
                else
                {
                    DB.Users.Delete(u => u.ID == userID);

                    BindGrid();
                }
            }
        }
Ejemplo n.º 52
0
        protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] values = Grid2.DataKeys[e.RowIndex];
            int userID = Convert.ToInt32(values[0]);

            if (e.CommandName == "Delete")
            {
                // 在操作之前进行权限检查
                if (!CheckPower("CoreArticleDelete"))
                {
                    CheckPowerFailWithAlert();
                    return;
                }

                int articleID = GetSelectedDataKeyID(Grid1);

                Article article = DB.Articles.Include(a => a.ArticleCategory)
                    .Where(a => a.ID == articleID)
                    .FirstOrDefault();

                if (article != null)
                {
                    article.ArticleCategory = null;

                    DB.SaveChanges();
                }

                BindGrid2();

            }
        }
Ejemplo n.º 53
0
        //============操作方法===========

        #region 删除
        /// <summary>
        /// 删除后台用户
        /// 创建人: 林以恒  
        /// 2015年7月29日11:46:14
        /// </summary>
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            //设置页面权限
            power.SetViewPower("mod_admin");
            //验证权限
            if (power.VerifyPower() == false)
            {
                return;
            }
            object[] keys = Grid1.DataKeys[e.RowIndex];
            int id = int.Parse(keys[0].ToString());
            if (e.CommandName != "Delete") return;
            var query = new DapperExQuery<T_ADMIN>().AndWhere(n => n.ID, OperationMethod.Equal, id);
            Alert.ShowInTop(t_admin_bll.Delete(query) ? "删除成功!" : "删除失败!");
            BindGrid();
        }
Ejemplo n.º 54
0
 /// <summary>
 /// 触发行内事件
 /// </summary>
 /// <param name="e">事件参数</param>
 protected virtual void OnRowCommand(GridCommandEventArgs e)
 {
     EventHandler<GridCommandEventArgs> handler = Events[_rowCommandHandlerKey] as EventHandler<GridCommandEventArgs>;
     if (handler != null)
     {
         handler(this, e);
     }
 }