コード例 #1
0
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        UD_WebPageBLL bll;

        if (ViewState["ID"] == null)
        {
            bll = new UD_WebPageBLL();
        }
        else
        {
            bll = new UD_WebPageBLL((Guid)ViewState["ID"]);
        }

        UC_DetailView1.GetData(bll.Model);

        if (ViewState["ID"] == null)
        {
            bll.Add();
        }
        else
        {
            bll.Update();
        }
        Response.Redirect("WebPageDetail.aspx?ID=" + bll.Model.ID.ToString());
    }
コード例 #2
0
    private void BindGrid()
    {
        string condition = "";

        if (tbx_Find.Text != "")
        {
            condition = "Title like '%" + tbx_Find.Text + "%' OR Path like '%" + tbx_Find.Text + "%'";
        }

        IList <UD_WebPage> source = UD_WebPageBLL.GetModelList(condition);

        gv_List.PageIndex        = (int)ViewState["PageIndex"];
        gv_List.TotalRecordCount = source.Count;

        gv_List.BindGrid <UD_WebPage>(source);
    }
コード例 #3
0
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        UD_WebPageBLL bll;
        if (ViewState["ID"] == null)
            bll = new UD_WebPageBLL();
        else
            bll = new UD_WebPageBLL((Guid)ViewState["ID"]);

        UC_DetailView1.GetData(bll.Model);

        if (ViewState["ID"] == null)
        {
            bll.Add();
        }
        else
        {
            bll.Update();
        }
        Response.Redirect("WebPageDetail.aspx?ID=" + bll.Model.ID.ToString());
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 注册脚本
        Page.ClientScript.RegisterClientScriptInclude("Cookie", Page.ResolveClientUrl("~/App_Themes/basic/cookie.js"));
        Page.ClientScript.RegisterClientScriptInclude("meizzDate", Page.ResolveClientUrl("~/App_Themes/basic/meizzDate.js"));
        Page.ClientScript.RegisterClientScriptInclude("ShowLeftColMenu", Page.ResolveClientUrl("~/App_Themes/basic/ShowLeftColMenu.js"));
        Page.ClientScript.RegisterClientScriptInclude("MCSTabMenu", Page.ResolveClientUrl("~/App_Themes/basic/MCSTabMenu.js"));

        string script = "function searchkb() {";
        script += "window.open('" + Page.ResolveUrl("~/SubModule/OA/KB/Search.aspx") + "?Text=' + document.getElementById('tbx_KBSearch').value, '', 'Width=500,Height=600,status=yes,resizable=yes,scrollbars=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "searchkb", script, true);
        #endregion

        if (!IsPostBack)
        {
            if (ConfigHelper.GetConfigBool("CheckRequstUrlReferrer"))
            {
                if (Request.UrlReferrer == null || Request.UrlReferrer.Host != Request.Url.Host)
                {
                    MessageBox.ShowAndRedirect(this.Page, "页面参数传递错误!", this.ResolveUrl("~/SubModule/Desktop.aspx"));
                    return;
                }
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script1", "HideLeftCol('leftCol');", true);
            fr_onlineuser.Attributes["src"] = Page.ResolveUrl("~/SubModule/Login/onlineuser.aspx");
            fr_leftmenu.Attributes["src"] = Page.ResolveUrl("~/SubModule/LeftTreeMenu.aspx");
            if (Session["UserName"] == null)
            {
                MessageBox.ShowAndRedirect(this.Page, "对不起,会话超时,请重新登录!", "/Default.aspx");
                return;
            }

            lb_UserName.Text = Session["UserRealName"].ToString();
            string softphoneurl = ConfigHelper.GetConfigString("SoftPhoneURL");
            if (!string.IsNullOrEmpty(softphoneurl))
            {
                hy_OpenSoftPhone.NavigateUrl = softphoneurl;
                hy_OpenSoftPhone.Visible = true;
            }
            #region
            if (new WT_WorkTimeBLL().IsBeginWork(int.Parse(Session["UserID"].ToString())))
            {
                this.bt_On.Visible = false;
            }
            else
            {
                this.bt_Out.Visible = false;
            }
            #endregion

            if (Request.QueryString["ViewFramework"] != null)
            {
                tr_Head.Visible = false;
                tr_Bottom.Visible = false;
                tr_Menu.Visible = false;
                tr_Body.Height = "300px";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "script1", "HideLeftCol('leftCol');", true);
                HideHandle.Width = 0;
            }
            else
            {
                string title = ConfigHelper.GetConfigString("PageTitle");
                if (!string.IsNullOrEmpty(title)) Head1.Title = title;

                NewMailCount();
            }

            #region 通用权限判断
            ViewState["PageTitle"] = "";
            if (Request.FilePath.IndexOf("SubModule") >= 0)
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList<UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    if (!Right_Assign_BLL.GetAccessRight(Context.User.Identity.Name, webpagebll.Model.Module, "Browse"))
                    {
                        //无浏览权限
                        //Response.Redirect("~/SubModule/noaccessright.aspx");
                    }

                    IList<UD_WebPageControl> controls = webpagebll.GetWebControls();
                    ViewState["PageTitle"] = pages[0].Title;

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                    else
                    {
                        foreach (Control c in ContentPlaceHolder1.Controls)
                        {
                            if (!string.IsNullOrEmpty(c.ID))
                            {
                                if (c.ID == "lb_PageTitle")
                                {
                                    ((Label)c).Text = (string)ViewState["PageTitle"];
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else
        {
            #region 如果页面内含MCSTabControl控件,再次运行一下权限判断
            if (ViewState["AlwaysCheckRight"] != null && (bool)ViewState["AlwaysCheckRight"])
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList<UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    IList<UD_WebPageControl> controls = webpagebll.GetWebControls();

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                }
            }
            #endregion
        }

        #region 设置页面Title 不能放在PostBack内
        string pagetitle = ConfigHelper.GetConfigString("PageTitle");
        if (!string.IsNullOrEmpty(pagetitle))
        {
            Head1.Title = pagetitle + " " + (string)ViewState["PageTitle"];
        }
        #endregion
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 注册脚本
        Page.ClientScript.RegisterClientScriptInclude("Cookie", Page.ResolveClientUrl("~/App_Themes/basic/cookie.js"));
        Page.ClientScript.RegisterClientScriptInclude("MCSTabMenu", Page.ResolveClientUrl("~/App_Themes/basic/MCSTabMenu.js"));
        Page.ClientScript.RegisterClientScriptInclude("WdatePicker", Page.ResolveClientUrl("~/js/My97DatePicker/WdatePicker.js"));

        string script = "function searchkb() {";
        script += "window.open('" + Page.ResolveUrl("~/SubModule/OA/KB/Search.aspx") + "?Text=' + document.getElementById('tbx_KBSearch').value, '', 'Width=500,Height=600,status=yes,resizable=yes,scrollbars=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "searchkb", script, true);
        #endregion
        if (!IsPostBack)
        {
            if (ConfigHelper.GetConfigBool("CheckRequstUrlReferrer"))
            {
                if (Request.UrlReferrer == null || Request.UrlReferrer.Host != Request.Url.Host)
                {
                    MessageBox.ShowAndRedirect(this.Page, "页面参数传递错误!", this.ResolveUrl("~/SubModule/Desktop.aspx"));
                    return;
                }
            }

            if (Session["UserName"] == null)
            {
                MessageBox.ShowAndRedirect(this.Page, "对不起,会话超时,请重新登录!", "/Default.aspx");
                return;
            }

            #region 通用权限判断
            ViewState["PageTitle"] = "";
            if (Request.FilePath.IndexOf("SubModule") >= 0)
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList<UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    if (!Right_Assign_BLL.GetAccessRight(Context.User.Identity.Name, webpagebll.Model.Module, "Browse"))
                    {
                        //无浏览权限
                        //Response.Redirect("~/SubModule/noaccessright.aspx");
                    }

                    IList<UD_WebPageControl> controls = webpagebll.GetWebControls();
                    ViewState["PageTitle"] = pages[0].Title;

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                    else
                    {
                        foreach (Control c in ContentPlaceHolder1.Controls)
                        {
                            if (!string.IsNullOrEmpty(c.ID))
                            {
                                if (c.ID == "lb_PageTitle")
                                {
                                    ((Label)c).Text = (string)ViewState["PageTitle"];
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else
        {
            #region 如果页面内含MCSTabControl控件,再次运行一下权限判断
            if (ViewState["AlwaysCheckRight"] != null && (bool)ViewState["AlwaysCheckRight"])
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList<UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    IList<UD_WebPageControl> controls = webpagebll.GetWebControls();

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                }
            }
            #endregion
        }

        #region 设置页面Title 不能放在PostBack内
        string pagetitle = ConfigHelper.GetConfigString("PageTitle");
        if (!string.IsNullOrEmpty(pagetitle))
        {
            Head1.Title = pagetitle + " " + (string)ViewState["PageTitle"];
        }
        #endregion
    }
コード例 #6
0
    private void BindGrid()
    {
        IList <UD_WebPageControl> fields = new UD_WebPageBLL((Guid)ViewState["WebPageID"]).GetWebControls();

        gv_List.BindGrid <UD_WebPageControl>(fields);
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 注册脚本
        Page.ClientScript.RegisterClientScriptInclude("Cookie", Page.ResolveClientUrl("~/App_Themes/basic/cookie.js"));
        Page.ClientScript.RegisterClientScriptInclude("MCSTabMenu", Page.ResolveClientUrl("~/App_Themes/basic/MCSTabMenu.js"));
        Page.ClientScript.RegisterClientScriptInclude("WdatePicker", Page.ResolveClientUrl("~/js/My97DatePicker/WdatePicker.js"));

        string script = "function searchkb() {";
        script += "window.open('" + Page.ResolveUrl("~/SubModule/OA/KB/Search.aspx") + "?Text=' + document.getElementById('tbx_KBSearch').value, '', 'Width=500,Height=600,status=yes,resizable=yes,scrollbars=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "searchkb", script, true);
        #endregion
        if (!IsPostBack)
        {
            if (ConfigHelper.GetConfigBool("CheckRequstUrlReferrer"))
            {
                if (Request.UrlReferrer == null || Request.UrlReferrer.Host != Request.Url.Host)
                {
                    MessageBox.ShowAndRedirect(this.Page, "页面参数传递错误!", this.ResolveUrl("~/SubModule/Desktop.aspx"));
                    return;
                }
            }

            if (Session["UserName"] == null)
            {
                MessageBox.ShowAndRedirect(this.Page, "对不起,会话超时,请重新登录!", "/Default.aspx");
                return;
            }

            #region 通用权限判断
            ViewState["PageTitle"] = "";
            if (Request.FilePath.IndexOf("SubModule") >= 0)
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList <UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    if (!Right_Assign_BLL.GetAccessRight(Context.User.Identity.Name, webpagebll.Model.Module, "Browse"))
                    {
                        //无浏览权限
                        //Response.Redirect("~/SubModule/noaccessright.aspx");
                    }

                    IList <UD_WebPageControl> controls = webpagebll.GetWebControls();
                    ViewState["PageTitle"] = pages[0].Title;

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                    else
                    {
                        foreach (Control c in ContentPlaceHolder1.Controls)
                        {
                            if (!string.IsNullOrEmpty(c.ID))
                            {
                                if (c.ID == "lb_PageTitle")
                                {
                                    ((Label)c).Text = (string)ViewState["PageTitle"];
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else
        {
            #region 如果页面内含MCSTabControl控件,再次运行一下权限判断
            if (ViewState["AlwaysCheckRight"] != null && (bool)ViewState["AlwaysCheckRight"])
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList <UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    IList <UD_WebPageControl> controls = webpagebll.GetWebControls();

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                }
            }
            #endregion
        }

        #region 设置页面Title 不能放在PostBack内
        string pagetitle = ConfigHelper.GetConfigString("PageTitle");
        if (!string.IsNullOrEmpty(pagetitle))
        {
            Head1.Title = pagetitle + " " + (string)ViewState["PageTitle"];
        }
        #endregion
    }
コード例 #8
0
 private void BindGrid()
 {
     IList<UD_WebPageControl> fields = new UD_WebPageBLL((Guid)ViewState["WebPageID"]).GetWebControls();
     gv_List.BindGrid<UD_WebPageControl>(fields);
 }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 注册脚本
        Page.ClientScript.RegisterClientScriptInclude("Cookie", Page.ResolveClientUrl("~/App_Themes/basic/cookie.js"));
        Page.ClientScript.RegisterClientScriptInclude("meizzDate", Page.ResolveClientUrl("~/App_Themes/basic/meizzDate.js"));
        Page.ClientScript.RegisterClientScriptInclude("ShowLeftColMenu", Page.ResolveClientUrl("~/App_Themes/basic/ShowLeftColMenu.js"));
        Page.ClientScript.RegisterClientScriptInclude("MCSTabMenu", Page.ResolveClientUrl("~/App_Themes/basic/MCSTabMenu.js"));

        string script = "function searchkb() {";
        script += "window.open('" + Page.ResolveUrl("~/SubModule/OA/KB/Search.aspx") + "?Text=' + document.getElementById('tbx_KBSearch').value, '', 'Width=500,Height=600,status=yes,resizable=yes,scrollbars=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "searchkb", script, true);
        #endregion

        if (!IsPostBack)
        {
            if (ConfigHelper.GetConfigBool("CheckRequstUrlReferrer"))
            {
                if (Request.UrlReferrer == null || Request.UrlReferrer.Host != Request.Url.Host)
                {
                    MessageBox.ShowAndRedirect(this.Page, "页面参数传递错误!", this.ResolveUrl("~/SubModule/Desktop.aspx"));
                    return;
                }
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script1", "HideLeftCol('leftCol');", true);
            fr_onlineuser.Attributes["src"] = Page.ResolveUrl("~/SubModule/Login/onlineuser.aspx");
            fr_leftmenu.Attributes["src"]   = Page.ResolveUrl("~/SubModule/LeftTreeMenu.aspx");
            if (Session["UserName"] == null)
            {
                MessageBox.ShowAndRedirect(this.Page, "对不起,会话超时,请重新登录!", "/Default.aspx");
                return;
            }

            lb_UserName.Text = Session["UserRealName"].ToString();
            string softphoneurl = ConfigHelper.GetConfigString("SoftPhoneURL");
            if (!string.IsNullOrEmpty(softphoneurl))
            {
                hy_OpenSoftPhone.NavigateUrl = softphoneurl;
                hy_OpenSoftPhone.Visible     = true;
            }
            #region
            if (new WT_WorkTimeBLL().IsBeginWork(int.Parse(Session["UserID"].ToString())))
            {
                this.bt_On.Visible = false;
            }
            else
            {
                this.bt_Out.Visible = false;
            }
            #endregion

            if (Request.QueryString["ViewFramework"] != null)
            {
                tr_Head.Visible   = false;
                tr_Bottom.Visible = false;
                tr_Menu.Visible   = false;
                tr_Body.Height    = "300px";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "script1", "HideLeftCol('leftCol');", true);
                HideHandle.Width = 0;
            }
            else
            {
                string title = ConfigHelper.GetConfigString("PageTitle");
                if (!string.IsNullOrEmpty(title))
                {
                    Head1.Title = title;
                }

                NewMailCount();
            }

            #region 通用权限判断
            ViewState["PageTitle"] = "";
            if (Request.FilePath.IndexOf("SubModule") >= 0)
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList <UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    if (!Right_Assign_BLL.GetAccessRight(Context.User.Identity.Name, webpagebll.Model.Module, "Browse"))
                    {
                        //无浏览权限
                        //Response.Redirect("~/SubModule/noaccessright.aspx");
                    }

                    IList <UD_WebPageControl> controls = webpagebll.GetWebControls();
                    ViewState["PageTitle"] = pages[0].Title;

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                    else
                    {
                        foreach (Control c in ContentPlaceHolder1.Controls)
                        {
                            if (!string.IsNullOrEmpty(c.ID))
                            {
                                if (c.ID == "lb_PageTitle")
                                {
                                    ((Label)c).Text = (string)ViewState["PageTitle"];
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else
        {
            #region 如果页面内含MCSTabControl控件,再次运行一下权限判断
            if (ViewState["AlwaysCheckRight"] != null && (bool)ViewState["AlwaysCheckRight"])
            {
                string Path = Request.FilePath.Substring(Request.FilePath.IndexOf("SubModule"));

                IList <UD_WebPage> pages = UD_WebPageBLL.GetModelList("Path='" + Path + "' AND SubCode='" + Head1.Attributes["WebPageSubCode"] + "'");
                if (pages.Count > 0)
                {
                    UD_WebPageBLL webpagebll = new UD_WebPageBLL(pages[0].ID, true);

                    IList <UD_WebPageControl> controls = webpagebll.GetWebControls();

                    if (controls.Count > 0)
                    {
                        CheckWebControl(ContentPlaceHolder1.Controls, webpagebll.Model.Module, controls);
                    }
                }
            }
            #endregion
        }

        #region 设置页面Title 不能放在PostBack内
        string pagetitle = ConfigHelper.GetConfigString("PageTitle");
        if (!string.IsNullOrEmpty(pagetitle))
        {
            Head1.Title = pagetitle + " " + (string)ViewState["PageTitle"];
        }
        #endregion
    }