コード例 #1
0
ファイル: ModuleList.aspx.cs プロジェクト: mind0n/hive
        protected void Page_Load(object sender, EventArgs e)
        {

            OrderByListItems_UniqueID = OrderByListItems.UniqueID.Replace("$","_");
            Button1.OnClientClick = string.Format("selectAll({0})", OrderByListItems_UniqueID);
            if (!Page.IsPostBack)
            {
                
                //AppName_Txt.Text = AppName;
                AppName = "应用列表->" + AppName;
                TabOptionItem1.Tab_Name = AppName;
                
                BindMenu();

                HeadMenuButtonItem m1 = new HeadMenuButtonItem();
                m1.ButtonName = "模块分类";
                m1.ButtonPopedom = PopedomType.New;
                m1.ButtonUrl = string.Format("moduleManager.aspx?CMD=New&S_ID={0}&ModuleId={1}",S_ID,0);
                HeadMenuWebControls1.ButtonList.Add(m1);

                //判断是否有排序权限
                if (!FrameWorkPermission.CheckButtonPermission(PopedomType.Orderby))
                    TabOptionItem2.Visible = false;
            }
            

            
        }
コード例 #2
0
ファイル: GroupList.aspx.cs プロジェクト: mind0n/hive
        private void ButtonBind()
        {
            HeadMenuButtonItem bi0 = new HeadMenuButtonItem();
            bi0.ButtonPopedom = PopedomType.New;
            bi0.ButtonName = "部门";
            bi0.ButtonUrl = string.Format("New.aspx?GroupID={0}", GroupID);
            HeadMenuWebControls1.ButtonList.Add(bi0);

            HeadMenuButtonItem bi1 = new HeadMenuButtonItem();
            bi1.ButtonPopedom = PopedomType.Orderby;
            bi1.ButtonName = "子部门";
            bi1.ButtonUrl = string.Format("Orderby.aspx?GroupID={0}",GroupID);
            HeadMenuWebControls1.ButtonList.Add(bi1);
            if (GroupID != 0)
            {
                HeadMenuButtonItem bi2 = new HeadMenuButtonItem();
                bi2.ButtonPopedom = PopedomType.Edit;
                bi2.ButtonName = "部门";
                bi2.ButtonUrl = string.Format("Edit.aspx?GroupID={0}", GroupID);
                HeadMenuWebControls1.ButtonList.Add(bi2);

                HeadMenuButtonItem bi3 = new HeadMenuButtonItem();
                bi3.ButtonIcon = "move.gif";
                bi3.ButtonName = "移动部门";
                bi3.ButtonPopedom = PopedomType.Edit;
                bi3.ButtonUrlType = UrlType.JavaScript;
                bi3.ButtonUrl = string.Format("sMove('{0}&datetime={1}')",GroupID,DateTime.Now);
                HeadMenuWebControls1.ButtonList.Add(bi3);
            }
        }
コード例 #3
0
 private void BindButton()
 {
     HeadMenuButtonItem item0 = new HeadMenuButtonItem();
     item0.ButtonName = "角色资料";
     item0.ButtonIcon = "look.gif";
     item0.ButtonPopedom = PopedomType.List;
     item0.ButtonUrl = string.Format("RoleManager.aspx?RoleID={0}&CMD=Look",RoleID);
     HeadMenuWebControls1.ButtonList.Add(item0);
     if (CMD == "Look")
     {
         HeadMenuButtonItem item1 = new HeadMenuButtonItem();
         item1.ButtonName = "角色权限";
         item1.ButtonPopedom = PopedomType.Edit;
         item1.ButtonUrl = string.Format("?RoleID={0}&ApplicationID={1}&CMD=Edit",RoleID,ApplicationID);
         HeadMenuWebControls1.ButtonList.Add(item1);
     }
     if (CMD == "Edit")
     {
         ButtonTr_End.Visible = true;
         HeadMenuButtonItem item2 = new HeadMenuButtonItem();
         item2.ButtonName = "返回";
         item2.ButtonIcon = "back.gif";
         item2.ButtonPopedom = PopedomType.List;
         item2.ButtonUrl = "history.back(-1);";
         item2.ButtonUrlType = UrlType.JavaScript;
         HeadMenuWebControls1.ButtonList.Add(item2);
     }
 }
コード例 #4
0
ファイル: AppManager.aspx.cs プロジェクト: mind0n/hive
        private void OnStart()
        {

            InputData();
            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    HiddenDisp();
                    TopTr.Visible = false;
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    HiddenDisp();
                    HeadMenuButtonItem Bm0 = new HeadMenuButtonItem();
                    Bm0.ButtonPopedom = PopedomType.List;
                    Bm0.ButtonUrl = string.Format("?CMD=Look&S_ID={0}", S_ID);
                    Bm0.ButtonIcon = "back.gif";
                    Bm0.ButtonName = "返回";
                    HeadMenuWebControls1.ButtonList.Add(Bm0);
                    HeadMenuButtonItem Bm1 = new HeadMenuButtonItem();
                    Bm1.ButtonPopedom = PopedomType.Delete;
                    Bm1.ButtonUrlType = UrlType.JavaScript;
                    Bm1.ButtonUrl = string.Format("DelData('?CMD=Delete&S_ID={0}')", S_ID);
                    HeadMenuWebControls1.ButtonList.Add(Bm1);
                    break;
                case "Look":
                    HiddenInput();
                    HeadMenuButtonItem Bm2 = new HeadMenuButtonItem();
                    Bm2.ButtonPopedom = PopedomType.Edit;
                    Bm2.ButtonUrl = string.Format("?CMD=Edit&S_ID={0}", S_ID);
                    HeadMenuWebControls1.ButtonList.Add(Bm2);
                    break;
                case "Delete":
                    CMD_Txt = "删除";
                    sys_ApplicationsTable sat = new sys_ApplicationsTable();
                    sat.ApplicationID = S_ID;
                    sat.DB_Option_Action_ = CMD;
                    if (sat.ApplicationID != 1)
                    {
                        //删除应用表
                        BusinessFacade.sys_ApplicationsInsertUpdate(sat);
                        //删除模块表
                        BusinessFacade.sys_Module_DeleteFormAppID(S_ID);
                        //删除角色应用权限表
                        BusinessFacade.sys_RolePermission_DeleteFromAppid(S_ID);
                        //删除角色应用表
                        BusinessFacade.sys_RoleApplication_DeleteFormAppid(S_ID);
                        
                    }
                    EventMessage.MessageBox(1, "操作成功", "删除记录ID:(" + S_ID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl("list.aspx"));
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            HeadMenuWebControls1.HeadOPTxt = TabOptionItem1.Tab_Name = All_Title_Txt;
            //Button1.Attributes.Add("Onclick", "javascript:return checkForm(aspnetForm);");
            
        }
コード例 #5
0
ファイル: Orderby.aspx.cs プロジェクト: mind0n/hive
 private void OnBindButton()
 {
     HeadMenuButtonItem bi0 = new HeadMenuButtonItem();
     bi0.ButtonIcon = "back.gif";
     bi0.ButtonName = "返回";
     bi0.ButtonPopedom = PopedomType.List;
     bi0.ButtonUrl = string.Format("GroupList.aspx?GroupID={0}", GroupID);
     HeadMenuWebControls1.ButtonList.Add(bi0);
 }
コード例 #6
0
ファイル: moduleManager.aspx.cs プロジェクト: mind0n/hive
        private void SetMenu()
        {
            PermissionModuleName.Text =  Title_Txt.Text = string.Format("{0}><a href='ModuleList.aspx?S_ID={3}&AppName={1}'>{1}</a>{2}", "<a href='List.aspx'>应用列表</a>", S_ID_Name, BusinessFacade.GetModuleTitle(ModuleID), S_ID);
            TabOptionItem1.Tab_Name = "应用模块管理-" + S_ID_Name +"->分类管理";
            HeadMenuWebControls1.HeadOPTxt = S_ID_Name;

            HeadMenuButtonItem m1 = new HeadMenuButtonItem();
            m1.ButtonPopedom = PopedomType.List;
            m1.ButtonName = S_ID_Name + "模块分类列表";
            m1.ButtonIcon = "list.gif";
            m1.ButtonUrl = string.Format("ModuleList.aspx?S_ID={0}&AppName={1}", S_ID, S_ID_Name);
            HeadMenuWebControls1.ButtonList.Add(m1);
        }
コード例 #7
0
ファイル: Edit.aspx.cs プロジェクト: mind0n/hive
        private void BindButton()
        {
            HeadMenuButtonItem bi1 = new HeadMenuButtonItem();
            bi1.ButtonPopedom = PopedomType.Delete;
            bi1.ButtonUrl = string.Format("DelData('?CMD=Delete&GroupID={0}')", GroupID);
            bi1.ButtonUrlType = UrlType.JavaScript;
            HeadMenuWebControls1.ButtonList.Add(bi1);

            HeadMenuButtonItem bi0 = new HeadMenuButtonItem();
            bi0.ButtonIcon = "back.gif";
            bi0.ButtonName = "返回";
            bi0.ButtonPopedom = PopedomType.List;
            bi0.ButtonUrl = string.Format("GroupList.aspx?GroupID={0}", GroupID);
            HeadMenuWebControls1.ButtonList.Add(bi0);
        }
コード例 #8
0
ファイル: ProjectManager.aspx.cs プロジェクト: mind0n/hive
        private void OnStart()
        {
            InputData();
            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    HiddenDisp();
                    TopTr.Visible = false;
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    HiddenDisp();
                    HeadMenuButtonItem Bm0 = new HeadMenuButtonItem();
                    Bm0.ButtonPopedom = PopedomType.List;
                    Bm0.ButtonUrl = string.Format("?CMD=Look&S_ID={0}", S_ID);
                    Bm0.ButtonIcon = "back.gif";
                    Bm0.ButtonName = "返回";
                    HeadMenuWebControls1.ButtonList.Add(Bm0);
                    HeadMenuButtonItem Bm1 = new HeadMenuButtonItem();
                    Bm1.ButtonPopedom = PopedomType.Delete;
                    Bm1.ButtonUrlType = UrlType.JavaScript;
                    Bm1.ButtonUrl = string.Format("DelData('?CMD=Delete&S_ID={0}')", S_ID);
                    HeadMenuWebControls1.ButtonList.Add(Bm1);
                    break;
                case "Look":
                    HiddenInput();
                    HeadMenuButtonItem Bm2 = new HeadMenuButtonItem();
                    Bm2.ButtonPopedom = PopedomType.Edit;
                    Bm2.ButtonUrl = string.Format("?CMD=Edit&S_ID={0}", S_ID);
                    HeadMenuWebControls1.ButtonList.Add(Bm2);
                    break;
                case "Delete":
                    CMD_Txt = "删除";
                    PM_ProjectsTable sat = new PM_ProjectsTable();
                    sat.ProjectId = S_ID.ToString();
                    sat.DB_Option_Action_ = CMD;
                    BusinessFacade.PM_ProjectsTableInsertUpdate(sat);

                    EventMessage.MessageBox(1, "操作成功", "删除记录ID:(" + S_ID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl("ProjectList.aspx"));
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            HeadMenuWebControls1.HeadOPTxt = TabOptionItem1.Tab_Name = All_Title_Txt;
        }
コード例 #9
0
ファイル: default.aspx.cs プロジェクト: mind0n/hive
        protected void Page_Load(object sender, EventArgs e)
        {
            FrameWorkPermission.CheckPagePermission(CMD);   
            if (!Page.IsPostBack)
            {
                FileLogList.DataSource = FileTxtLogs.GetFileList();
                FileLogList.DataTextField = "Value";
                FileLogList.DataValueField = "Value";
                FileLogList.DataBind();
                BindDate();

            }
            if (FileLogList.Items.Count != 0)
            {
                HeadMenuButtonItem item0 = new HeadMenuButtonItem();
                item0.ButtonName = "当前日志文件";
                item0.ButtonPopedom = PopedomType.Delete;
                item0.ButtonUrlType = UrlType.JavaScript;
                item0.ButtonUrl = "DelData('?CMD=Delete');";
                HeadMenuWebControls1.ButtonList.Add(item0);
            }
            if (CMD == "Delete")
                DeleteFile();
        }
コード例 #10
0
ファイル: FieldValueManager.aspx.cs プロジェクト: mind0n/hive
        private void OnStart()
        {

            sys_FieldTable Ft = BusinessFacade.sys_FieldDisp(FieldID);
            F_Key_Txt.Text = Ft.F_Key;
            F_CName_Txt.Text = Ft.F_CName;
            F_Remark_Txt.Text = Ft.F_Remark;

            QueryParam qp = new QueryParam();
            qp.Where = string.Format("where V_F_Key = '{0}'", Common.inSQL(Ft.F_Key));
            qp.Orderfld = " V_ShowOrder ";
            qp.OrderType = 0;
            int RecordCount = 0;
            ArrayList lst = BusinessFacade.sys_FieldValueList(qp, out RecordCount);
            Main_Value.DataSource = lst;
            Main_Value.DataBind();

            if (CMD == "List")
            {
                HeadMenuButtonItem bi1 = new HeadMenuButtonItem();
                bi1.ButtonPopedom = PopedomType.Edit;
                bi1.ButtonName = "应用字段";
                bi1.ButtonUrl = string.Format("?CMD=Edit&FieldID={0}", FieldID);
                HeadMenuWebControls1.ButtonList.Add(bi1);

                HeadMenuButtonItem bi3 = new HeadMenuButtonItem();
                bi3.ButtonPopedom = PopedomType.New;
                bi3.ButtonName = "应用字段值";
                bi3.ButtonUrl = string.Format("showPopWin('应用字段值增加','FieldValueBox.aspx?FieldID={0}&CMD=New&{1}', 300, 160, AlertMessageBox,true);", FieldID, Common.RndNum(7));
                bi3.ButtonUrlType = UrlType.JavaScript;
                HeadMenuWebControls1.ButtonList.Add(bi3);

                HeadMenuButtonItem bi4 = new HeadMenuButtonItem();
                bi4.ButtonPopedom = PopedomType.Edit;
                bi4.ButtonName = "排序应用字段值";
                bi4.ButtonIcon = "Orderby.gif";
                bi4.ButtonUrl = string.Format("showPopWin('应用字段值排序','FieldValueBox.aspx?F_Key={0}&CMD=OrderBy&{1}', 180, 210, AlertMessageBox,true);", Ft.F_Key, Common.RndNum(7));
                bi4.ButtonUrlType = UrlType.JavaScript;
                HeadMenuWebControls1.ButtonList.Add(bi4);
                Disp_Input.Visible = false;



                F_Key_Txt.Visible = true;
                F_CName_Txt.Visible = true;
                F_Remark_Txt.Visible = true;
                F_Key.Visible = false;
                F_CName.Visible = false;
                F_Remark.Visible = false;
            }
            else if (CMD == "Edit")
            {
                F_Key.Text = Ft.F_Key;
                F_CName.Text = Ft.F_CName;
                F_Remark.Text = Ft.F_Remark;

                F_Key.Visible = false;
                F_Key_Txt.Visible = true;

                HeadMenuButtonItem bi5 = new HeadMenuButtonItem();
                bi5.ButtonIcon = "back.gif";
                bi5.ButtonPopedom = PopedomType.List;
                bi5.ButtonName = "返回";
                bi5.ButtonUrl = string.Format("?CMD=List&FieldID={0}", FieldID);
                HeadMenuWebControls1.ButtonList.Add(bi5);

                HeadMenuButtonItem bi2 = new HeadMenuButtonItem();
                bi2.ButtonPopedom = PopedomType.Delete;
                bi2.ButtonName = "应用字段";
                bi2.ButtonUrlType = UrlType.JavaScript;
                bi2.ButtonUrl = string.Format("DelData('?CMD=Delete&FieldID={0}')", FieldID);
                HeadMenuWebControls1.ButtonList.Add(bi2);



                Disp_Sub.Visible = false;
            }
            else if (CMD == "New")
            {
                Disp_Sub.Visible = false;
            }
            else if (CMD == "Delete")
            {

                Ft.DB_Option_Action_ = "Delete";
                BusinessFacade.sys_FieldInsertUpdate(Ft);

                foreach (sys_FieldValueTable var in lst)
                {
                    var.DB_Option_Action_ = "Delete";
                    BusinessFacade.sys_FieldValueInsertUpdate(var);
                }
                EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", FieldID, "删除应用字段"), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));

            }



        }
コード例 #11
0
ファイル: RoleManager.aspx.cs プロジェクト: mind0n/hive
        /// <summary>
        /// 绑定按钮
        /// </summary>
        private void BindButton()
        {
            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    HiddenDisp();
                    TopTr.Visible = false;
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    HiddenDisp();
                    HeadMenuButtonItem Bm0 = new HeadMenuButtonItem();
                    Bm0.ButtonPopedom = PopedomType.List;
                    Bm0.ButtonUrl = string.Format("?CMD=Look&RoleID={0}", RoleID);
                    Bm0.ButtonIcon = "back.gif";
                    Bm0.ButtonName = "返回";
                    HeadMenuWebControls1.ButtonList.Add(Bm0);
                    HeadMenuButtonItem Bm1 = new HeadMenuButtonItem();
                    Bm1.ButtonPopedom = PopedomType.Delete;
                    Bm1.ButtonUrlType = UrlType.JavaScript;
                    Bm1.ButtonUrl = string.Format("DelData('?CMD=Delete&RoleID={0}')", RoleID);
                    HeadMenuWebControls1.ButtonList.Add(Bm1);
                    break;
                case "Look":
                    HiddenInput();
                    HeadMenuButtonItem Bm2 = new HeadMenuButtonItem();
                    Bm2.ButtonPopedom = PopedomType.Edit;
                    Bm2.ButtonUrl = string.Format("?CMD=Edit&RoleID={0}", RoleID);
                    HeadMenuWebControls1.ButtonList.Add(Bm2);
                    break;
                case "Delete":
                    CMD_Txt = "删除";
                    sys_RolesTable sat = new sys_RolesTable();
                    sat.RoleID = RoleID;
                    sat.DB_Option_Action_ = CMD;
                    BusinessFacade.sys_RolesInsertUpdate(sat);
                    BusinessFacade.sys_RoleApplication_Move(RoleID);
                    BusinessFacade.sys_RolePermission_Move(RoleID);
                    UserData.Move_RoleUserPermissionCache(RoleID);                  

                    EventMessage.MessageBox(1, "操作成功", "删除记录ID:(" + RoleID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl("RoleList.aspx"));
                    break;
                case "Move":
                    sys_RoleApplicationTable rt = new sys_RoleApplicationTable();
                    rt.A_ApplicationID = (int)Common.sink("ApplicationID", MethodType.Get, 255, 1, DataType.Int);
                    rt.A_RoleID = RoleID;
                    rt.DB_Option_Action_ = "Delete";
                    BusinessFacade.sys_RoleApplicationInsertUpdate(rt);

                    BusinessFacade.sys_RolePermission_Move(rt.A_RoleID, rt.A_ApplicationID);
                    UserData.Move_RoleUserPermissionCache(RoleID);
                    EventMessage.MessageBox(1, "操作成功", "移除应用ID:(" + rt.A_ApplicationID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("RoleManager.aspx?RoleID={0}&CMD=Look", RoleID)));
                    break;
                case "MoveUser":
                    //检测删除权限
                    FrameWorkPermission.CheckPermissionVoid(PopedomType.Delete);
                    int UserID = (int)Common.sink("UserID", MethodType.Get, 255, 1, DataType.Int);
                    UserData.Move_UserPermissionCache(UserID);
                    sys_UserRolesTable su = new sys_UserRolesTable();
                    su.DB_Option_Action_ = "Delete";
                    su.R_RoleID = RoleID;
                    su.R_UserID = UserID;
                    BusinessFacade.sys_UserRolesInsertUpdate(su);
                    EventMessage.MessageBox(1, "操作成功", string.Format("从角色ID:{0}中移除用户ID:{1}成功!",RoleID,UserID), Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("RoleManager.aspx?RoleID={0}&CMD=Look", RoleID)));
                    break;
                    
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            HeadMenuWebControls1.HeadOPTxt = TabOptionItem1.Tab_Name = All_Title_Txt;
        }
コード例 #12
0
ファイル: moduleManager.aspx.cs プロジェクト: mind0n/hive
        private void OnStart()
        {

            if (CMD == string.Empty)
            {
                TabOptionWebControls1.SelectIndex = 1;
            }

            //填充数据
            sys_ModuleTable SMT = new sys_ModuleTable();
            SMT = BusinessFacade.sys_ModuleDisp(ModuleID);
            this.M_ApplicationID_Txt.Text = S_ID_Name;
            if (ModuleID==0)
                this.M_PageCode.Text = SMT.M_PageCode;
            if (CMD == "New" && ModuleID != 0)
            {
                this.M_ParentID_Txt.Text = SMT.M_CName;
            }
            else
            {
                this.M_ParentID_Txt.Text = SMT.M_ParentID == 0 ? "无" : BusinessFacade.sys_ModuleDisp(SMT.M_ParentID).M_CName;
            }
            this.M_PageCode_Txt.Text = SMT.M_PageCode;
            this.M_CName_Txt.Text = SMT.M_CName;
            this.M_Directory_Txt.Text = SMT.M_Directory;
            this.M_IsSystem_Txt.Text = SMT.M_IsSystem == 0 ? "否" : "是";
            this.M_Close_Txt.Text = SMT.M_Close == 0 ? "否" : "是";
            this.M_Icon_Txt.Text = SMT.M_Icon;

            if (CMD == "Edit")
            {
                this.M_PageCode.Text = SMT.M_PageCode;
                this.M_CName.Text = SMT.M_CName;
                this.M_Directory.Text = SMT.M_Directory;
                this.M_Icon.Text = SMT.M_Icon;
                ListItem ditem1 = this.M_IsSystem.Items.FindByValue(SMT.M_IsSystem.ToString());
                if (ditem1 != null)
                    ditem1.Selected = true;
                ListItem ditem2 = this.M_Close.Items.FindByValue(SMT.M_Close.ToString());
                if (ditem2 != null)
                    ditem2.Selected = true;
            }

            //绑定子模块
            QueryParam qp = new QueryParam();
            qp.Orderfld = " M_Applicationid,M_OrderLevel ";
            qp.OrderType = 0;
            qp.Where = string.Format("Where M_ParentID={0} and M_Applicationid={1}", ModuleID,S_ID);
            int RecordCount = 0;
            ArrayList lst = BusinessFacade.sys_ModuleList(qp, out RecordCount);
            GridView1.DataSource = lst;
            GridView1.DataBind();

            //绑定排序
            OrderByListItems.DataSource = lst;
            OrderByListItems.DataTextField = "M_CName";
            OrderByListItems.DataValueField = "ModuleID";
            OrderByListItems.DataBind();
            if (lst.Count > 0)
                OrderByListItems.Rows = lst.Count;
            
            //判断是否隐藏数据
            if (CMD == "New" || CMD == "Edit")
                HiddenDisp();
            else
            {
                HiddenInput();
                SubmitTr.Visible = false;
            }

            //判断是否生成增加子模块按钮
            if (CMD!="New" && ModuleID !=0 && SMT.M_OrderLevel.Substring(2, 2) == "00")
            {

                HeadMenuButtonItem m2 = new HeadMenuButtonItem();
                m2.ButtonName = "模块";
                m2.ButtonPopedom = PopedomType.New;
                m2.ButtonUrl = string.Format("?CMD=New&ModuleID={0}&S_ID={1}", ModuleID, S_ID);
                HeadMenuWebControls1.ButtonList.Add(m2);
            }
            if (ModuleID !=0 && SMT.M_OrderLevel.Substring(2, 2) != "00")
            {
                TabOptionWebControls1.SelectIndex = 0;
                TabOptionItem2.Visible = false;
                TabOptionItem3.Visible = false;
                TabOptionItem4.Visible = true;
                BindPermissionList();
                if (CMD == "Edit")
                {
                    HeadMenuButtonItem m5 = new HeadMenuButtonItem();
                    m5.ButtonIcon = "back.gif";
                    m5.ButtonName = "返回";
                    m5.ButtonPopedom = PopedomType.List;
                    m5.ButtonUrl = string.Format("?ModuleID={0}&S_ID={1}", ModuleID, S_ID);
                    HeadMenuWebControls1.ButtonList.Add(m5);
                }
            }




            //生成修改按钮
            if (ModuleID != 0 && CMD=="")
            {
                HeadMenuButtonItem m3 = new HeadMenuButtonItem();
                m3.ButtonName = "";
                m3.ButtonPopedom = PopedomType.Edit;
                m3.ButtonUrl = string.Format("?CMD=Edit&ModuleID={0}&S_ID={1}",ModuleID,S_ID);
                HeadMenuWebControls1.ButtonList.Add(m3);
            }

            //生成删除按钮
            if (CMD == "Edit")
            {
                HeadMenuButtonItem m4 = new HeadMenuButtonItem();
                m4.ButtonPopedom = PopedomType.Delete;
                m4.ButtonUrl = string.Format("DelData('?CMD=Delete&S_ID={0}&ModuleID={1}')", S_ID,ModuleID);
                m4.ButtonUrlType = UrlType.JavaScript;
                HeadMenuWebControls1.ButtonList.Add(m4);
            }

            //判断是否执行删除
            if (CMD == "Delete")
            {
                SMT.DB_Option_Action_ = "Delete";
                if (SMT.M_IsSystem != 1)
                {
                    BusinessFacade.sys_ModuleInsertUpdate(SMT);
                    //删除角色权限表
                    BusinessFacade.sys_RolePermission_DeleteForm(SMT.M_ApplicationID, SMT.M_PageCode);
                    if (lst.Count > 0)
                    {
                        foreach (sys_ModuleTable var in lst)
                        {
                            SMT.ModuleID = var.ModuleID;
                            BusinessFacade.sys_ModuleInsertUpdate(SMT);
                            //删除角色权限表
                            BusinessFacade.sys_RolePermission_DeleteForm(var.M_ApplicationID, var.M_PageCode);
                        }
                    }

                }
                EventMessage.MessageBox(1, "操作成功", "删除记录ID:(" + ModuleID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("ModuleList.aspx?S_ID={0}&AppName={1}",S_ID,S_ID_Name)));
            }

            //Button1.Attributes.Add("Onclick", "javascript:return checkForm(aspnetForm);");

        }
コード例 #13
0
ファイル: UserManager.aspx.cs プロジェクト: mind0n/hive
        /// <summary>
        /// 初始化
        /// </summary>
        private void OnStart()
        {
            sys_UserTable ut = BusinessFacade.sys_UserDisp(UserID);
            OnStartData(ut);
            if (CMD == "List")
            {
                DispTr.Visible = true;
                HeadMenuButtonItem bi1 = new HeadMenuButtonItem();
                bi1.ButtonPopedom = PopedomType.Edit;
                bi1.ButtonName = "用户";
                bi1.ButtonUrl = string.Format("?CMD=Edit&UserID={0}", UserID);
                HeadMenuWebControls1.ButtonList.Add(bi1);


                Hidden_Input();
                PostButton.Visible = false;

            }
            else if (CMD == "New")
            {
                Hidden_Disp();
            }
            else if (CMD == "Edit")
            {
                Hidden_Disp();
                HeadMenuButtonItem bi5 = new HeadMenuButtonItem();
                bi5.ButtonIcon = "back.gif";
                bi5.ButtonPopedom = PopedomType.List;
                bi5.ButtonName = "返回";
                bi5.ButtonUrl = string.Format("?CMD=List&UserID={0}", UserID);
                HeadMenuWebControls1.ButtonList.Add(bi5);

                HeadMenuButtonItem bi2 = new HeadMenuButtonItem();
                bi2.ButtonPopedom = PopedomType.Delete;
                bi2.ButtonName = "用户";
                bi2.ButtonUrlType = UrlType.JavaScript;
                bi2.ButtonUrl = string.Format("DelData('?CMD=Delete&UserID={0}')", UserID);
                HeadMenuWebControls1.ButtonList.Add(bi2);
                U_LoginName.Visible = false;
                U_LoginName_Value.Visible = true;


            }
            else if (CMD == "Delete")
            {
                //Admin帐号不能被删除
                if ((ut.UserID != 1))
                {
                    if (ut.U_Type == 0 && UserData.GetUserDate.U_Type == 1)
                    {
                        EventMessage.MessageBox(1, "操作无效", "普通用户无法删除超级用户资料!", Icon_Type.Error, Common.GetHomeBaseUrl("default.aspx"));
                    }
                    //ut.DB_Option_Action_ = "Delete";
                    //BusinessFacade.sys_UserInsertUpdate(ut);
                    //设置用户删除标识
                    BusinessFacade.Update_Table_Fileds("sys_User", "U_Status=2", string.Format("UserID={0}", UserID));
                    ArrayList lst = BusinessFacade.sys_UserRolesDisp(UserID);
                    foreach (sys_UserRolesTable var in lst)
                    {
                        var.DB_Option_Action_ = "Delete";
                        BusinessFacade.sys_UserRolesInsertUpdate(var);
                    }


                    if (ut.U_PhotoUrl != "")
                    {
                        FileUpLoadCommon.DeleteFile(string.Format("{0}{1}{2}", Common.UpLoadDir, "UserPhoto/", ut.U_PhotoUrl));
                        FileUpLoadCommon.DeleteFile(string.Format("{0}{1}s_{2}", Common.UpLoadDir, "UserPhoto/", ut.U_PhotoUrl));
                    }
                    //从缓存中移除用户
                    UserData.MoveUserCache(UserID);
                    //从在线列表中移除
                    FrameWorkOnline.Instance().OnlineRemove(ut.U_LoginName.ToLower());
                }
                EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", UserID, "删除用户"), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));

            }

        }