Exemplo n.º 1
0
        void RefreshItemsVisible()
        {
            foreach (ToolStripItem item in Items)
            {
                var v = true;

                //if (MiniMode && !PriorityItems.Contains(item))
                //    v = false;

                if (ReadOnly && EditButtons.Contains(item))
                {
                    v = false;
                }

                item.Visible = v;
            }
        }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ModuleKey  = "010101";
        ModuleName = "日常办公-通知通告";
        Response.Cache.SetExpires(DateTime.Now);
        Response.Cache.SetCacheability(HttpCacheability.Public);
        Response.Cache.SetValidUntilExpires(true);
        AddButtons.Add(btnadd);
        EditButtons.Add(btnedit);
        DeleteButtons.Add(btndelete);
        //FinishButtons.Add(btnfinish);
        //ApproveButtons.Add(btnapprove);
        //PublishButtons.Add(btnpublish);

        if (!IsPostBack)
        {
            DDL_Year.Items.FindByValue(DateTime.Today.Year.ToString("0000")).Selected = true;
            DDL_Month.Items.FindByValue("").Selected = true;

            if (GridView1.Attributes["SortExpression"] == null)
            {
                ViewState["SortExpression"] = "chgdate";
                ViewState["SortDirection"]  = "DESC";
            }
            currentPage = 1;
            GridBind();
            HF_CurUnitCode.Value = _user.UnitCode;
            GetLatestNews();
        }
        else//接收HF和session
        {
            try
            {
                total       = Int32.Parse(HF_total.Value);
                currentPage = Int32.Parse(HF_currentPage.Value);
                GridSource  = (DataTable)Session["GridSource"];
            }
            catch
            {
                currentPage = 1;
                GridBind();//根据情况修改
            }
        }
    }