当前位置: 首页>>代码示例>>C#>>正文


C# BasePage类代码示例

本文整理汇总了C#中BasePage的典型用法代码示例。如果您正苦于以下问题:C# BasePage类的具体用法?C# BasePage怎么用?C# BasePage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BasePage类属于命名空间,在下文中一共展示了BasePage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BasePage objBase = new BasePage();

            DataSet ds = UserInfo.GetAllActiveLanguages();

            DataRow dr = ds.Tables[0].Select("LanguageId =" + objBase.LanguageId)[0];
            litLangauge.Text = Convert.ToString(dr["CountryName"]);
            img.Src = "/images/" + Convert.ToString(dr["Flag"]);

            DataView dv = ds.Tables[0].DefaultView;
            dv.RowFilter = "LanguageId <>" + objBase.LanguageId;

            rptLanguage.DataSource = dv;
            rptLanguage.DataBind();

            if (!string.IsNullOrEmpty(HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"]))
            {
                Utils.SetCulture(HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"].ToString(), HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"].ToString());
            }

        }
    }
开发者ID:AsmaBabarISL,项目名称:Epr_General,代码行数:25,代码来源:landingHeader.ascx.cs

示例2: ProcessRequest

        //private const string uploadPath = "../commup/upload/";
        public void ProcessRequest(HttpContext context)
        {
            string vlreturn = "", error = "", json = "";
            BasePage basepage = new BasePage();
            if (context.Request.Files.Count == 0)
            {
                vlreturn = "";
                error = CCommon.Get_Definephrase(Definephrase.Invalid_file);
            }
            else
            {
                string uploadPath = context.Request.QueryString["up"];
                uploadPath = CFunctions.IsNullOrEmpty(uploadPath) ? "commup/upload/" : CFunctions.MBDecrypt(uploadPath);
                DirectoryInfo pathInfo = new DirectoryInfo(context.Server.MapPath(uploadPath));

                for (int i = 0; i < context.Request.Files.Count; i++)
                {
                    HttpPostedFile fileUpload = context.Request.Files[i];
                    if (CFunctions.IsNullOrEmpty(fileUpload.FileName)) continue;

                    vlreturn = ""; error = "";
                    string fileExtension = Path.GetExtension(fileUpload.FileName).ToLower();
                    if (extension_img.IndexOf(fileExtension) == -1)
                    {
                        error = CCommon.Get_Definephrase(Definephrase.Invalid_filetype_image);
                    }
                    else
                    {
                        string fileName;
                        if (pathInfo.GetFiles(fileUpload.FileName).Length == 0)
                        {
                            fileName = Path.GetFileName(fileUpload.FileName);
                        }
                        else
                        {
                            fileName = this.Get_Filename() + fileExtension;
                            //error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_duplicate);
                        }
                        string uploadLocation = context.Server.MapPath(uploadPath) + "\\" + fileName;

                        if (fileUpload.ContentLength > CConstants.FILEUPLOAD_SIZE)
                        {
                            this.ResizeImage(fileUpload, uploadLocation, 800, 760, true);
                        }
                        else
                        {
                            fileUpload.SaveAs(uploadLocation);
                        }

                        vlreturn = uploadPath.Replace("../", "") + fileName;
                        error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_done);
                    }

                    json += (CFunctions.IsNullOrEmpty(json) ? "" : ",") + "{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}";
                }
            }
            context.Response.ContentType = "text/plain";
            //context.Response.Write("{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}");
            context.Response.Write("{\"bindings\": [" + json + "]}");
        }
开发者ID:thienchi,项目名称:my-bfinance,代码行数:61,代码来源:FPUploadHandler.ashx.cs

示例3: GoToPage

    public void GoToPage(PageType pageType)
    {
        if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything

        BasePage pageToCreate = null;

        if(pageType == PageType.TitlePage)
        {
            pageToCreate = new TitlePage();
        }
        if(pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }
        else if (pageType == PageType.ScorePage)
        {
            pageToCreate = new ScorePage();
        }

        if(pageToCreate != null) //destroy the old page and create a new one
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _currentPage.Destroy();
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
开发者ID:jrendel,项目名称:LD27,代码行数:34,代码来源:Main.cs

示例4: CargaMenuUsuario

        protected void CargaMenuUsuario()
        {
            BasePage oPagina = new BasePage();
            Usuarios objUsuario = (Usuarios)oPagina.LeerVariableSesion("oUsuario");
            string cUrl = "";
            string menuTitle = "";
            //string cDescription = "";
            int nNumCor = 1;
            string menuItemID = "";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(Server.MapPath("~/" + objUsuario.Roles.rolMenu.ToString()));

            XmlNode SiteMap = xmlDoc.LastChild;

            ///MENU PRINCIAL
            foreach (XmlNode menuNode in SiteMap)
            {
                cUrl = menuNode.Attributes["url"].Value;
                menuTitle = menuNode.Attributes["title"].Value;
                //cDescription = menuNode.Attributes["description"].Value;
                menuItemID = menuTitle + "_" + nNumCor.ToString();

                EasymenuMain.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(menuItemID, menuTitle, "", "", "", ""));
                EasymenuMain.AddSeparator("MenuSeparator" + nNumCor.ToString(), "|");

                if (cUrl == "#")
                    LeerSubmenu(menuNode, menuItemID, true);

                nNumCor++;
            }
        }
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:31,代码来源:Site.Master.cs

示例5: ReadPageJournal

        private BasePage ReadPageJournal(BinaryReader reader)
        {
            var stream = reader.BaseStream;
            var posStart = stream.Position * BasePage.PAGE_SIZE;
            var posEnd = posStart + BasePage.PAGE_SIZE;

            // Create page instance and read from disk (read page header + content page)
            var page = new BasePage();

            // read page header
            page.ReadHeader(reader);

            // Convert BasePage to correct Page Type
            if (page.PageType == PageType.Header) page = page.CopyTo<HeaderPage>();
            else if (page.PageType == PageType.Collection) page = page.CopyTo<CollectionPage>();
            else if (page.PageType == PageType.Index) page = page.CopyTo<IndexPage>();
            else if (page.PageType == PageType.Data) page = page.CopyTo<DataPage>();
            else if (page.PageType == PageType.Extend) page = page.CopyTo<ExtendPage>();

            // read page content if page is not empty
            if (page.PageType != PageType.Empty)
            {
                // read page content
                page.ReadContent(reader);
            }

            // read non-used bytes on page and position cursor to next page
            reader.ReadBytes((int)(posEnd - stream.Position));

            return page;
        }
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:31,代码来源:RecoveryService.cs

示例6: butCierre_Click

        protected void butCierre_Click(object sender, EventArgs e)
        {
            //elimina objeto sesión que contiene objeto USUARIO

            BasePage oPaginaBase = new BasePage();
            oPaginaBase.EliminarVariableSesion("oUsuario");

            Response.Redirect("~/index.html");
        }
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:9,代码来源:Site.Master.cs

示例7: EmptyPage

 public EmptyPage(BasePage page)
     : base(page.PageID)
 {
     if(page.DiskData.Length > 0)
     {
         this.DiskData = new byte[BasePage.PAGE_SIZE];
         Buffer.BlockCopy(page.DiskData, 0, this.DiskData, 0, BasePage.PAGE_SIZE);
     }
 }
开发者ID:apkd,项目名称:LiteDB,代码行数:9,代码来源:EmptyPage.cs

示例8: EmptyPage

 public EmptyPage(BasePage page)
     : this(page.PageID)
 {
     // if page is not dirty but it´s changing to empty, lets copy disk content to add in journal
     if (!page.IsDirty && page.DiskData.Length > 0)
     {
         this.DiskData = new byte[BasePage.PAGE_SIZE];
         Buffer.BlockCopy(page.DiskData, 0, this.DiskData, 0, BasePage.PAGE_SIZE);
     }
 }
开发者ID:AshishVishwakarma,项目名称:LiteDB,代码行数:10,代码来源:EmptyPage.cs

示例9: AddPage

 /// <summary>
 /// Add a page to cache. if this page is in cache, override
 /// </summary>
 public void AddPage(BasePage page)
 {
     // do not cache extend page - never will be reused
     if (page.PageType != PageType.Extend)
     {
         lock(_cache)
         {
             _cache[page.PageID] = page;
         }
     }
 }
开发者ID:AshishVishwakarma,项目名称:LiteDB,代码行数:14,代码来源:CacheService.cs

示例10: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            string vlreturn = "", error = "";
            BasePage basepage = new BasePage();
            if (context.Request.Files.Count == 0)
            {
                vlreturn = "";
                error = CCommon.Get_Definephrase(Definephrase.Invalid_file);
            }
            else
            {
                HttpPostedFile fileUpload = context.Request.Files[0];
                string fileExtension = Path.GetExtension(fileUpload.FileName).ToLower();
                if (extension_img.IndexOf(fileExtension) == -1)
                {
                    vlreturn = "";
                    error = CCommon.Get_Definephrase(Definephrase.Invalid_filetype_image);
                }
                else
                {
                    string uploadPath = context.Request.QueryString["up"];
                    uploadPath = CFunctions.IsNullOrEmpty(uploadPath) ? "../commup/upload/" : CFunctions.MBDecrypt(uploadPath);
                    string uploadPathDir = context.Server.MapPath(uploadPath);

                    DirectoryInfo pathInfo = new DirectoryInfo(uploadPathDir);
                    string fileName;
                    if (pathInfo.GetFiles(fileUpload.FileName).Length == 0)
                    {
                        fileName = Path.GetFileName(fileUpload.FileName);
                    }
                    else
                    {
                        fileName = this.Get_Filename() + fileExtension;
                        error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_duplicate);
                    }

                    if (CConstants.FILEUPLOAD_THUMBNAIL)
                    {
                        string uploadLocation_thumb = uploadPathDir + "\\thumb_" + fileName;
                        this.CreateThumbnail(fileUpload, uploadLocation_thumb, true);
                    }

                    string uploadLocation = uploadPathDir + "\\" + fileName;
                    fileUpload.SaveAs(uploadLocation);
                    vlreturn = uploadPath.Replace("../", "") + fileName;
                    error += CCommon.Get_Definephrase(Definephrase.Notice_fileupload_done);
                }
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}");
        }
开发者ID:thienchi,项目名称:my-bfinance,代码行数:51,代码来源:FPUploadHandler.ashx.cs

示例11: ShowPage

 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     Model.contents.article_category model = new BLL.channels.category().GetModel(this.category_id);
     if (model != null)
     {
         string _name = model.call_index;
         string _class_list = model.class_list;
         string _key = BasePage.pageUrl(model.model_id);
         string _where = "status=0 and  category_id=" + this.category_id;
         DataRowCollection list = new BasePage().get_article_list(_name, page, _where, out totalcount, out pagelist, _key, this.category_id, "__id__").Rows;
         vh.Put("channel_id", category_id);
         vh.Put("list", list);
         vh.Put("page", pagelist);
         vh.Display("../Template/newList.html");
     }
 }
开发者ID:eyren,项目名称:OScms,代码行数:19,代码来源:article_list.cs

示例12: CargaNombreUsuario

        protected bool CargaNombreUsuario()
        {
            BasePage oPagina = new BasePage();

            Usuarios objUsuario = (Usuarios)oPagina.LeerVariableSesion("oUsuario");

            if (objUsuario != null)
                lblUsuario.Text = "Bienvenido " + objUsuario.usrLogin.ToString();
            else
            {
                return false;
                //oPagina.MessageBox("El Usuario tiene que Iniciar una Sesion");
                //String scriptMsj = "";
                //scriptMsj = "window.location = '~/index.html'";
                //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MENSAJE", scriptMsj, true);
                //Server.Transfer("~/index.html");
            }
            return true;
        }
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:19,代码来源:Site.Master.cs

示例13: WritePageInJournal

        /// <summary>
        /// Write a page in sequence, not in absolute position
        /// </summary>
        private void WritePageInJournal(BinaryWriter writer, BasePage page)
        {
            // no need position cursor - journal writes in sequence
            var stream = writer.BaseStream;
            var posStart = stream.Position;
            var posEnd = posStart + BasePage.PAGE_SIZE;

            // Write page header
            page.WriteHeader(writer);

            // write content except for empty pages
            if (page.PageType != PageType.Empty)
            {
                page.WriteContent(writer);
            }

            // write with zero non-used page
            writer.Write(new byte[posEnd - stream.Position]);
        }
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:22,代码来源:JournalService.cs

示例14: initParam

        /// <summary>
        /// 分页初始化参数
        /// </summary>
        /// <param name="page"></param>
        public static void initParam(BasePage page)
        {
            try
            {
                HiddenField hfPageIndex = (HiddenField)page.FindControl("hfPageIndex");
                HiddenField hfPageSize = (HiddenField)page.FindControl("hfPageSize");
                if (!String.IsNullOrEmpty(hfPageIndex.Value))
                {
                    page.pageIndex = Convert.ToInt32(hfPageIndex.Value);
                }
                if (!String.IsNullOrEmpty(hfPageSize.Value))
                {
                    page.pageSize = Convert.ToInt32(hfPageSize.Value);
                }
            }
            catch (Exception)
            {

            }
        }
开发者ID:woailuoli993,项目名称:graduate_old,代码行数:24,代码来源:MyUtil.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BasePage objBase = new BasePage();

            DataSet ds = UserInfo.GetAllActiveLanguages();

            DataRow dr = ds.Tables[0].Select("LanguageId =" + objBase.LanguageId)[0];
            litLangauge.Text = Convert.ToString(dr["CountryName"]);
            img.Src = "/images/" + Convert.ToString(dr["Flag"]);

            DataView dv = ds.Tables[0].DefaultView;
            dv.RowFilter = "LanguageId <>" + objBase.LanguageId;

            rptLanguage.DataSource = dv;
            rptLanguage.DataBind();

        }
    }
开发者ID:AsmaBabarISL,项目名称:Epr_General,代码行数:20,代码来源:editionControl.ascx.cs


注:本文中的BasePage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。