Example #1
0
        /// <summary>
        /// 排序事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {
            Int32 DataIDX = 0;

            if (e.Row.RowType == DataControlRowType.Header)
            {
                if (FrameWorkPermission.CheckButtonPermission(PopedomType.Delete))
                {
                    Button2.Visible = true;
                    //增加check列头全选
                    TableCell cell = new TableCell();
                    cell.Width = Unit.Pixel(5);
                    cell.Text  = " <input id='CheckboxAll' value='0' type='checkbox' onclick='SelectAll()'/>";
                    e.Row.Cells.AddAt(0, cell);
                }

                foreach (TableCell var in e.Row.Cells)
                {
                    if (var.Controls.Count > 0 && var.Controls[0] is LinkButton)
                    {
                        string Colume = ((LinkButton)var.Controls[0]).CommandArgument;
                        if (Colume == Orderfld)
                        {
                            LinkButton l = (LinkButton)var.Controls[0];
                            l.Text += string.Format("<img src='{0}' border='0'>", (OrderType == 0) ? Page.ResolveUrl("~/Manager/images/sort_asc.gif") : Page.ResolveUrl("~/Manager/images/sort_desc.gif"));
                            //Image Img = new Image();
                            //SortDirection a = GridView1.SortDirection;
                            //Img.ImageUrl = (a == SortDirection.Ascending) ? "i_p_sort_asc.gif" : "i_p_sort_desc.gif";
                            //var.Controls.Add(Img);
                        }
                    }
                }
            }
            else
            {
                if (FrameWorkPermission.CheckButtonPermission(PopedomType.Delete))
                {
                    //增加行选项
                    DataIDX = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "ID"));
                    TableCell cell = new TableCell();
                    cell.Width = Unit.Pixel(5);
                    cell.Text  = string.Format(" <input name='Checkbox' id='Checkbox' value='{0}' type='checkbox' />", DataIDX);
                    e.Row.Cells.AddAt(0, cell);
                }
            }
        }
Example #2
0
        private void OnStart()
        {
            sys_GroupTable gt = BusinessFacade.sys_GroupDisp(GroupID);

            this.G_CName.Text = gt.G_CName;
            if (gt.G_ParentID == 0)
            {
                G_ParentID_Txt.Text = "部门列表";
            }
            else
            {
                G_ParentID_Txt.Text = BusinessFacade.sys_GroupDisp(gt.G_ParentID).G_CName;
            }
            CatListTitle.Text = string.Format("<a href='GroupList.aspx'>部门列表</a>{0}", BusinessFacade.GetGroupTitle(GroupID));
            //判断是否删除
            if (CMD == "Delete")
            {
                FrameWorkPermission.CheckPermissionVoid(PopedomType.Delete);

                //删除子分类
                DeleteCat(GroupID);
                //删除当前分类
                BusinessFacade.Update_Table_Fileds("sys_Group", "G_Delete=1", string.Format("GroupID={0}", GroupID));

                if (gt.G_ParentID != 0)
                {
                    //更新父类子类数
                    BusinessFacade.Update_Table_Fileds("sys_Group", "G_ChildCount=G_ChildCount-1", string.Format("GroupID={0}", gt.G_ParentID));
                    //更新父类子类排序
                    int        RecordCount = 0;
                    QueryParam qp          = new QueryParam();
                    qp.Where     = string.Format("Where G_ParentID={0} and G_Delete=0", gt.G_ParentID);
                    qp.Orderfld  = "G_Level,G_ShowOrder";
                    qp.OrderType = 0;
                    ArrayList lst = BusinessFacade.sys_GroupList(qp, out RecordCount);
                    RecordCount = 1;
                    foreach (sys_GroupTable var in lst)
                    {
                        BusinessFacade.Update_Table_Fileds("sys_Group", string.Format("G_ShowOrder={0}", RecordCount), string.Format("GroupID={0}", var.GroupID));
                        RecordCount++;
                    }
                }
                EventMessage.MessageBox(1, "操作成功", string.Format("删除部门({0})成功!", gt.G_CName), Icon_Type.OK, Common.GetHomeBaseUrl("GroupList.aspx"), Common.BuildJs);
            }
        }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     FrameWorkPermission.CheckPagePermission(cmd);
     if (!Page.IsPostBack)
     {
         OnStart();
         if (cmd == "Edit")
         {
             HiddenDisp();
             HeadMenuWebControls1.ButtonList[0].ButtonVisible = false;
         }
         else
         {
             HiddenValue();
             HeadMenuWebControls1.ButtonList[1].ButtonVisible = false;
         }
     }
 }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                OnlineUser.Text    = FrameWorkOnline.Instance().GetOnlineUserNum.ToString();
                CacheNum.Text      = FrameWorkCache.Instance().Count.ToString();
                CacheMax.Text      = FrameWorkCache.Instance().Remains;
                SystemOsName.Text  = Common.GetServerOS;
                SystemRunTime.Text = GetSystemRunTime;
                AppRunTime.Text    = GetAppRunTime;
                OnlineUseType.Text = Common.GetOnlineCountType.ToString();

                CacheUseClass.Text       = Common.GetCacheclassName;
                OnlineTimeOutMinute.Text = Common.OnlineMinute.ToString();
                sys_FrameWorkInfoTable si = FrameSystemInfo.GetSystemInfoTable.S_FrameWorkInfo;
                SystemName.Text = FrameSystemInfo.FrameWorkVerName;
                SystemName.Text = SystemName.Text + CheckUpdate.GetNewVerInfo;
                if (si.S_Licensed == string.Empty)
                {
                    Licensed_RegionUrl.NavigateUrl = si.S_RegsionUrl;
                    LinkButton1.Visible            = false;
                }
                else
                {
                    Licensed_Txt.Text = string.Format("<a href='{1}?S_Licensed={0}' target=_blank>{0}</a>", si.S_Licensed, si.S_CheckLicensed);
                    NoRegsion.Visible = false;
                    if (!CheckUpdate.CheckLicensed)
                    {
                        Licensed_Txt.Text = Licensed_Txt.Text + "<font color=red>无效序列号</font>";
                    }
                }



                System.Diagnostics.Process ps = System.Diagnostics.Process.GetCurrentProcess();

                AppRunMemony.Text        = string.Format("{0}M", ps.WorkingSet64 / 1024 / 1024);
                AppRunVirtualMemony.Text = string.Format("{0}M", ps.VirtualMemorySize64 / 1024 / 1024);
            }
            if (!FrameWorkPermission.CheckButtonPermission(PopedomType.Delete))
            {
                TabOptionItem2.Visible = false;
            }
        }
Example #5
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            FrameWorkPermission.CheckPermissionVoid(PopedomType.Orderby);
            string ItemsList = (string)Common.sink(OrderByListItems.UniqueID, MethodType.Post, 100000, 1, DataType.Str);

            if (ItemsList.Length > 0)
            {
                string[] ItemsLists = ItemsList.Split(',');
                for (int i = 0; i < ItemsLists.Length; i++)
                {
                    BusinessFacade.Update_Table_Fileds("sys_Applications", string.Format("A_Order={0}", i + 1), string.Format("ApplicationID={0}", ItemsLists[i]));
                }
            }

            //重启加载树型菜单缓存
            sys_Module_Cache.ReLoadCache();

            EventMessage.MessageBox(1, "操作成功", string.Format("排序应用成功!"), Icon_Type.OK, Common.GetHomeBaseUrl("List.aspx"), Common.BuildJs);
        }
Example #6
0
        private void ReJudgComment(string SerialNo)
        {
            QueryParam qp = new QueryParam();

            qp.Where = " Where 1=1 AND ODSerialNo = '" + SerialNo + "'";
            DataSet ds = BusinessFacadeDLT.LevelOrderJudgList(1, 1, qp.Where);

            tbReJudgComment.Text = ds.Tables[0].Rows[0]["Remark"].ToString();

            if (FrameWorkPermission.CheckButtonPermission(PopedomType.Delete))
            {
                tbReJudgComment.Enabled  = true;
                btnReJudgComment.Visible = true;
            }
            else
            {
                tbReJudgComment.Enabled  = false;
                btnReJudgComment.Visible = false;
            }
        }
Example #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            FrameWorkPermission.CheckPermissionVoid(PopedomType.Edit);
            sys_GroupTable gt = BusinessFacade.sys_GroupDisp(GroupID);

            gt.G_CName = (string)Common.sink(G_CName.UniqueID, MethodType.Post, 50, 1, DataType.Str);
            bool g_type = G_Type.Checked;

            if (g_type)
            {
                gt.G_Type = 1;
            }
            else
            {
                gt.G_Type = 0;
            }
            gt.G_Code            = (string)Common.sink(G_Code.UniqueID, MethodType.Post, 20, 1, DataType.Str);
            gt.DB_Option_Action_ = "Update";
            BusinessFacade.sys_GroupInsertUpdate(gt);
            EventMessage.MessageBox(1, "操作成功", string.Format("修改部门ID({0})成功!", gt.GroupID), Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("GroupList.aspx?GroupID={0}", GroupID)), Common.BuildJs);
        }
Example #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int RecordCount = 0;

            FrameWorkPermission.CheckPermissionVoid(PopedomType.New);
            sys_GroupTable gt = BusinessFacade.sys_GroupDisp(GroupID);

            gt.G_CName = (string)Common.sink(G_CName.UniqueID, MethodType.Post, 50, 1, DataType.Str);
            bool g_type = G_Type.Checked;

            if (g_type)
            {
                gt.G_Type = 1;
            }
            else
            {
                gt.G_Type = 0;
            }
            gt.G_Code = (string)Common.sink(G_Code.UniqueID, MethodType.Post, 20, 1, DataType.Str);
            if (gt.GroupID == 0)
            {
                gt.G_Level = 1;
                BusinessFacade.sys_GroupList(new QueryParam(), out RecordCount);
                gt.G_ShowOrder = RecordCount + 1;
            }
            else
            {
                gt.G_Level++;
                gt.G_ShowOrder  = gt.G_ChildCount + 1;
                gt.G_ChildCount = 0;
                gt.G_ParentID   = GroupID;
            }

            gt.DB_Option_Action_ = "Insert";
            BusinessFacade.sys_GroupInsertUpdate(gt);
            //更新子部门数
            BusinessFacade.Update_Table_Fileds("sys_Group", "G_ChildCount=G_ChildCount+1", string.Format("GroupID={0}", GroupID));
            EventMessage.MessageBox(1, "操作成功", string.Format("增加部门({0})成功!", gt.G_CName), Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("GroupList.aspx?GroupID={0}", GroupID)), Common.BuildJs);
        }
Example #9
0
        protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Panel       panel2  = e.Item.FindControl("Panel2") as Panel;
                CheckBox    cbColor = e.Item.FindControl("cbColor") as CheckBox;
                HiddenField hfColor = (HiddenField)e.Item.FindControl("hfColor");

                if (FrameWorkPermission.CheckButtonPermission(PopedomType.Delete))
                {
                    panel2.Visible  = true;
                    cbColor.Visible = true;
                }
                else
                {
                    panel2.Visible  = false;
                    cbColor.Visible = false;
                }

                if (hfColor.Value == "1")
                {
                    cbColor.Checked = true;
                    if ((e.Item.ItemIndex + 1) != AspNetPager10.RecordCount)
                    {
                        ((HtmlControl)e.Item.FindControl("row")).Style["Color"] = "#FF0000";
                    }
                    else
                    {
                        cbColor.Visible = false;
                        panel2.Visible  = false;
                    }
                }
                else
                {
                    cbColor.Checked = false;
                }
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoleID = (int)Common.sink("RoleID", MethodType.Get, 255, 0, DataType.Int);
            CMD    = (string)Common.sink("CMD", MethodType.Get, 50, 0, DataType.Str);

            //判断是否增加用户到角色
            if (string.Compare(CMD, "AddUser", true) == 0)
            {
                AddUserToRole();
            }

            FrameWorkPermission.CheckPagePermission(CMD);
            BusinessFacade.sys_UserCheckManagerVoid();
            if (RoleID != 0)
            {
                BusinessFacade.sys_Roles_CheckUserVoid(RoleID);
            }
            BindButton();
            if (!Page.IsPostBack)
            {
                OnStart();
            }
        }
Example #11
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            FrameWorkPermission.CheckPermissionVoid(PopedomType.Orderby);
            string ItemsList = (string)Common.sink(OrderByListItems.UniqueID, MethodType.Post, 100000, 1, DataType.Str);

            if (ItemsList.Length > 0)
            {
                string[] ItemsLists = ItemsList.Split(',');
                for (int i = 0; i < ItemsLists.Length; i++)
                {
                    if (Common.GetDBType == "Oracle")
                    {
                        BusinessFacade.Update_Table_Fileds("sys_Module", string.Format("M_OrderLevel=substr(M_OrderLevel,1,2) || '{0}'", Common.FillZero((i + 1).ToString(), 2)), string.Format("ModuleID={0}", ItemsLists[i]));
                    }
                    else
                    {
                        BusinessFacade.Update_Table_Fileds("sys_Module", string.Format("M_OrderLevel=left(M_OrderLevel,2)+'{0}'", Common.FillZero((i + 1).ToString(), 2)), string.Format("ModuleID={0}", ItemsLists[i]));
                    }
                }
            }
            sys_Module_Cache.ReLoadCache(); //重新加载模块缓存
            EventMessage.MessageBox(1, "操作成功", string.Format("排序子模块成功!"), Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("ModuleManager.aspx?ModuleID={0}&S_ID={1}", ModuleID, S_ID)));
        }
Example #12
0
        /// <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;
        }
        private string CreateButtonHtml()
        {
            StringBuilder sb = new StringBuilder();

            if (_ButtonList != null && _ButtonList.Count > 0)
            {
                sb.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>");
                string OnUrlJs       = "";
                string ButtonIcon    = "";
                string ButtonTxt     = "";
                int    DispButtonNum = 0;
                for (int i = 0; i < _ButtonList.Count; i++)
                {
                    if (_ButtonList[i].ButtonVisible && FrameWorkPermission.CheckButtonPermission(_ButtonList[i].ButtonPopedom))
                    {
                        DispButtonNum++;
                        OnUrlJs    = "";
                        ButtonIcon = "";
                        ButtonTxt  = "";
                        switch (_ButtonList[i].ButtonUrlType)
                        {
                        case UrlType.Href:
                            OnUrlJs = string.Format("JavaScript:window.location.href='{0}';", _ButtonList[i].ButtonUrl);
                            break;

                        case UrlType.JavaScript:
                            OnUrlJs = string.Format("JavaScript:{0}", _ButtonList[i].ButtonUrl);
                            break;

                        case UrlType.VBScript:
                            OnUrlJs = string.Format("VBScript:{0}", _ButtonList[i].ButtonUrl);
                            break;
                        }
                        if (_ButtonList[i].ButtonIcon != string.Empty)
                        {
                            ButtonIcon = HeadIconPath + _ButtonList[i].ButtonIcon;
                        }
                        else
                        {
                            if (Convert.ToInt32(_ButtonList[i].ButtonPopedom) > 256)
                            {
                                ButtonIcon = HeadIconPath + "Custom.gif";
                            }
                            else
                            {
                                ButtonIcon = HeadIconPath + _ButtonList[i].ButtonPopedom.ToString() + ".gif";
                            }
                            switch (_ButtonList[i].ButtonPopedom)
                            {
                            case PopedomType.A:
                                ButtonTxt = "备用A";
                                break;

                            case PopedomType.B:
                                ButtonTxt = "备用B";
                                break;

                            case PopedomType.Delete:
                                ButtonTxt = "删除";
                                break;

                            case PopedomType.Edit:
                                ButtonTxt = "修改";
                                break;

                            case PopedomType.List:
                                ButtonTxt = "列表";
                                break;

                            case PopedomType.Orderby:
                                ButtonTxt = "排序";
                                break;

                            case PopedomType.New:
                                ButtonTxt = "新增";
                                break;

                            case PopedomType.Print:
                                ButtonTxt = "打印";
                                break;

                            default:
                                ButtonTxt = "自定义";
                                break;
                            }
                        }
                        sb.AppendFormat("<td class=\"menubar_button\" id=\"button_{1}\" OnClick=\"{0}\" OnMouseOut=\"javascript:MenuOnMouseOver(this);\" OnMouseOver=\"javascript:MenuOnMouseOut(this);\">", OnUrlJs, i);
                        sb.AppendFormat("<img border=\"0\" align=\"texttop\" src=\"{0}\">&nbsp;", ButtonIcon);
                        sb.AppendFormat("{0}{1}</td>", ButtonTxt, _ButtonList[i].ButtonName);
                    }
                }
                if (DispButtonNum == 0)
                {
                    sb.Append("<td>&nbsp;</td>");
                }
                sb.Append("</tr></table>");
            }
            if (sb.ToString() == string.Empty)
            {
                sb.Append("&nbsp");
            }
            return(sb.ToString());
        }