Example #1
0
        protected virtual void InitToolBarList()
        {
            if (B_ToolBar1 != null && B_Grid1 != null)
            {
                FineUI.Button btn;
                FineUI.ToolbarSeparator Sep;
                DataTable dt = App_Com.Sys_User.GetSys_Function();
                string FunctionID;
                foreach (DataRow dr in dt.Select("ModuleID='" + B_ModuleID + "'", "Seq"))
                {
                    FunctionID = dr["FunctionID"].ToString();
                    if (App_Com.Sys_User.CheckAuthorize(B_ModuleID, FunctionID))
                    {
                        if (FunctionID.ToLower() == "add" || FunctionID.ToLower() == "edit" || FunctionID.ToLower() == "delete")
                        {
                            if (B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].ID.ToLower() == "view")
                            {
                                Sep = new ToolbarSeparator();
                                B_ToolBar1.Items.Add(Sep);
                            }
                        }
                        if (FunctionID.ToLower() == "print" || FunctionID.ToLower() == "export")
                        {
                            if (B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].ID.ToLower() == "view" ||
                                B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].ID.ToLower() == "add" ||
                                B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].ID.ToLower() == "edit" ||
                                B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].ID.ToLower() == "delete")
                            {
                                Sep = new ToolbarSeparator();
                                B_ToolBar1.Items.Add(Sep);
                            }
                        }

                        btn = new FineUI.Button(); btn.ID = FunctionID;
                        btn.Text = dr["FunctionName"].ToString();
                        btn.IconAlign = IconAlign.Top;
                        btn.Icon = (Icon)Enum.Parse(typeof(Icon), dr["Icon"].ToString());
                        if (FunctionID.ToLower() == "view")
                        {
                            btn.Click += new EventHandler(btn_Click);
                            btn.OnClientClick = B_Grid1.GetNoSelectionAlertReference("请首先选择一行记录。");
                        }
                        if (FunctionID.ToLower() == "add")
                        {
                            btn.Click += new EventHandler(btn_Click);
                        }
                        if (FunctionID.ToLower() == "edit")
                        {
                            btn.Click += new EventHandler(btn_Click);
                            btn.OnClientClick = B_Grid1.GetNoSelectionAlertReference("请首先选择一行记录。");
                        }
                        if (FunctionID.ToLower() == "delete")
                        {
                            btn.Click += new EventHandler(btn_Click);
                            btn.OnClientClick = B_Grid1.GetNoSelectionAlertReference("请首先选择一行记录。");
                            btn.ConfirmText = String.Format("你确定要删除选中的项吗?", "");
                        }
                        if (FunctionID.ToLower() == "print")
                        {
                            btn.OnClientClick = "btnPrint_onclick()";
                        }
                        if (FunctionID.ToLower() == "export")
                        {
                            btn.Click += new EventHandler(btn_Click);
                            btn.DisableControlBeforePostBack = false;
                            btn.EnableAjax = false;
                            btn.EnablePostBack = true;
                        }
                        B_ToolBar1.Items.Add(btn);
                    }
                }
                if (B_ToolBar1.Items[B_ToolBar1.Items.Count - 1].GetType() != typeof(ToolbarSeparator))
                {
                    Sep = new ToolbarSeparator();
                    B_ToolBar1.Items.Add(Sep);
                }
                btn = new FineUI.Button(); btn.ID = "Zoom"; btn.Click += new EventHandler(btn_Click);
                btn.Text = "查询"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = true;
                btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Zoom"); B_ToolBar1.Items.Add(btn);

                btn = new FineUI.Button(); btn.ID = "Erase"; btn.Click += new EventHandler(btn_Click);
                btn.Text = "清除"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = true; btn.ToolTip = "清除查询条件.";
                btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Erase"); B_ToolBar1.Items.Add(btn);
            }
        }
Example #2
0
        protected override void InitToolBar()
        {
            base.InitToolBar();
            if (B_ToolBar2 != null)
            {
                FineUI.Button btn;
                FineUI.ToolbarSeparator Sep;

                /**以下子表工具栏**/
                btn = new FineUI.Button(); btn.ID = "ViewDetail";
                btn.Text = "查看"; btn.IconAlign = IconAlign.Top;
                btn.Click += new EventHandler(btn_Click);
                btn.OnClientClick = B_Grid1.GetNoSelectionAlertInTopReference("请首先选择一行记录。");
                btn.Icon = (Icon)Enum.Parse(typeof(Icon), "PageWhiteText"); B_ToolBar2.Items.Add(btn);

                if (B_Action.ToLower() == "add" || B_Action.ToLower() == "edit")
                {
                    Sep = new ToolbarSeparator();B_ToolBar2.Items.Add(Sep);

                    btn = new FineUI.Button(); btn.ID = "AddDetail";
                    btn.Text = "新增"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Add"); B_ToolBar2.Items.Add(btn);

                    btn = new FineUI.Button(); btn.ID = "EditDetail";
                    btn.Text = "修改"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.OnClientClick = B_Grid1.GetNoSelectionAlertInTopReference("请首先选择一行记录。");
                    btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Pencil"); B_ToolBar2.Items.Add(btn);

                    btn = new FineUI.Button(); btn.ID = "DeleteDetail";
                    btn.Text = "删除"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.OnClientClick = B_Grid1.GetNoSelectionAlertInTopReference("请首先选择一行记录。");
                    btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Delete"); B_ToolBar2.Items.Add(btn);
                }
                B_ToolBar2.Hidden = B_ToolBar2.Items.Count == 0;
            }
        }
Example #3
0
        protected virtual void InitToolBar()
        {
            if (B_ToolBar1 != null)
            {
                FineUI.Button btn;
                FineUI.ToolbarSeparator Sep;
                if (B_Action.ToLower() == "add" || B_Action.ToLower() == "edit")
                {
                    btn = new FineUI.Button(); btn.ID = "SaveAndExit";
                    btn.Click += new EventHandler(btn_Click);
                    btn.Text = "保存"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = true;
                    btn.ValidateForms = new string[] { "Form2" };
                    btn.Icon = (Icon)Enum.Parse(typeof(Icon), "SystemSave"); B_ToolBar1.Items.Add(btn);

                    if (B_Action.ToLower() == "add")
                    {
                        btn = new FineUI.Button(); btn.ID = "SaveAndNew";
                        btn.Click += new EventHandler(btn_Click);
                        btn.Text = "保存并新增"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = true;
                        btn.ValidateForms = new string[] { "Form2" };
                        btn.Icon = (Icon)Enum.Parse(typeof(Icon), "SystemSaveNew"); B_ToolBar1.Items.Add(btn);
                    }

                    Sep = new ToolbarSeparator();
                    B_ToolBar1.Items.Add(Sep);
                }

                if (B_Action.ToLower() == "view" && B_PrintDetail && App_Com.Sys_User.CheckAuthorize(B_ModuleID, "Print"))
                {
                    btn = new FineUI.Button(); btn.ID = "Print";
                    btn.Click += new EventHandler(btn_Click);
                    btn.Text = "打印"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = true;
                    btn.Icon = (Icon)Enum.Parse(typeof(Icon), "Printer"); B_ToolBar1.Items.Add(btn);

                    Sep = new ToolbarSeparator();
                    B_ToolBar1.Items.Add(Sep);
                }

                btn = new FineUI.Button(); btn.ID = "Exit";
                btn.OnClientClick = ActiveWindow.GetHideReference();
                btn.Text = "关闭"; btn.IconAlign = IconAlign.Top; btn.EnablePostBack = false;
                btn.Icon = (Icon)Enum.Parse(typeof(Icon), "SystemClose"); B_ToolBar1.Items.Add(btn);
            }
        }
Example #4
0
        protected override void InitToolBar()
        {
            base.InitToolBar();
            if (B_ToolBar1!=null)
            {
                FineUI.Button btn;
                FineUI.ToolbarSeparator Sep;

                if (B_Action.ToLower() == "edit" || B_Action.ToLower() == "view")
                {
                    Int16 iBtnLoc = 1;
                    if (B_Action.ToLower() == "view")
                        iBtnLoc = 0;

                    btn = new FineUI.Button(); btn.ID = "Trend";
                    btn.Text = "查看进度"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.Icon = FineUI.Icon.ChartLine; B_ToolBar1.Items.Insert(iBtnLoc, btn);

                    btn = new FineUI.Button(); btn.ID = "Return";
                    btn.Text = "退回"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.Icon = FineUI.Icon.ArrowTurnLeft; B_ToolBar1.Items.Insert(iBtnLoc, btn);

                    btn = new FineUI.Button(); btn.ID = "Submit";
                    btn.Text = "提交"; btn.IconAlign = IconAlign.Top;
                    btn.Click += new EventHandler(btn_Click);
                    btn.Icon = FineUI.Icon.Accept; B_ToolBar1.Items.Insert(iBtnLoc, btn);

                    if (B_Action.ToLower() == "view")
                        iBtnLoc = 3;
                    Sep = new ToolbarSeparator(); B_ToolBar1.Items.Insert(iBtnLoc, Sep);
                }
            }
        }